I found the problem... I was inserting PointData instead of CellData :) ,,,<br>Anyway it seems to be starting to work now.. 2 things though :<br><br>-> Whenever I try to run directly a python script exported from paraview (Through the Coprocessing export state) it won't run until I remove all references to LIC and all lines containing Null...<br>
<br>For the LIC, is it because the python script doesn't automatically load the LIC plugin ? <br>For the Null, do you have this problem as well ?<br><br>-> Is the Live Source Data code already available in git ? I'd love to test it out even if it is not robust yet. <br>
<br>Best, <br>Jacques<br><br><br><div class="gmail_quote">2010/8/12 Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
You probably want to add the field data to the specific grids in the multiblock data set and not just the block itself. As an example:<br><br>create multiblock<br>for each grid:<br> create grid points and cells<br> add point and cell data to grid<br>
add grid to block<br><br>Note that in parallel for coprocessing that the block must have the same structure on each process but whether a leaf node is empty or not can change. For example:<br><br>proc 0 mutliblock:<br>
block 0 -> unstructured grid<br> block 1 -> uniform grid<br> block 2 -> NULL<br>proc 1 multiblock:<br> block 0 -> NULL<br>
block 1 -> NULL<br>
block 2 -> unstructured grid<br>
<br>I'm not sure of all of the details but what I do is that I set a block to only be non-NULL on a single process.<br><br>Hope this helps,<br><font color="#888888">Andy</font><div><div></div><div><br><br>
<div class="gmail_quote">On Thu, Aug 12, 2010 at 2:38 PM, Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi All, <br><br>I am making some more progress on this. Everything was working until I tried adding field data... I now get an explosion :<br>
<br>#2 ?? in "/lib64/libc.so.6"<br>#3 vtkDataArrayTemplate<double>::ComputeScalarRange(int) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkCommon.so.pv3.9"<br>
#4 vtkDataArray::ComputeRange(int) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkCommon.so.pv3.9"<br>#5 vtkPVArrayInformation::CopyFromObject(vtkObject*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>
#6 vtkPVDataSetAttributesInformation::CopyFromDataSetAttributes(vtkDataSetAttributes*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>#7 vtkPVDataInformation::CopyFromDataSet(vtkDataSet*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>
#8 vtkPVDataInformation::CopyFromObject(vtkObject*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>#9 vtkPVCompositeDataInformation::CopyFromObject(vtkObject*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>
#10 vtkPVDataInformation::CopyFromCompositeDataSet(vtkCompositeDataSet*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>#11 vtkPVDataInformation::CopyFromObject(vtkObject*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>
#12 vtkSelfConnection::GatherInformation(unsigned int, vtkPVInformation*, vtkClientServerID) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>#13 vtkSynchronousMPISelfConnection::GatherInformation(unsigned int, vtkPVInformation*, vtkClientServerID) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerCommon.so"<br>
#14 vtkSMOutputPort::GatherDataInformation() in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>#15 vtkSMOutputPort::GetDataInformation() in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>
#16 vtkSMDataTypeDomain::IsInDomain(vtkSMSourceProxy*, int) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>#17 vtkSMDataTypeDomain::IsInDomain(vtkSMProperty*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>
#18 vtkSMProperty::IsInDomains() in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>#19 vtkSMRenderViewProxy::CreateDefaultRepresentation(vtkSMProxy*, int) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVServerManager.so"<br>
#20 ?? at vtkSMRenderViewProxyPython.cxx:0<br>#21 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>#22 PyEval_EvalCodeEx in "/usr/lib64/libpython2.6.so.1.0"<br>#23 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>
#24 PyEval_EvalCodeEx in "/usr/lib64/libpython2.6.so.1.0"<br>#25 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>#26 PyEval_EvalCodeEx in "/usr/lib64/libpython2.6.so.1.0"<br>#27 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>
#28 PyEval_EvalCodeEx in "/usr/lib64/libpython2.6.so.1.0"<br>#29 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>#30 PyEval_EvalFrameEx in "/usr/lib64/libpython2.6.so.1.0"<br>#31 PyEval_EvalCodeEx in "/usr/lib64/libpython2.6.so.1.0"<br>
#32 PyEval_EvalCode in "/usr/lib64/libpython2.6.so.1.0"<br>#33 ?? in "/usr/lib64/libpython2.6.so.1.0"<br>#34 PyRun_StringFlags in "/usr/lib64/libpython2.6.so.1.0"<br>#35 PyRun_SimpleStringFlags in "/usr/lib64/libpython2.6.so.1.0"<br>
#36 vtkPVPythonInterpretor::RunSimpleString(char const*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkPVPythonInterpretor.so"<br>#37 vtkCPPythonScriptPipeline::CoProcess(vtkCPDataDescription*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkCoProcessor.so"<br>
#38 vtkCPProcessor::CoProcess(vtkCPDataDescription*) in "/users/boreas01/jacques/PARAVIEW/ParaView-bin/bin/libvtkCoProcessor.so"<br><br>Any ideas where this can be coming from ?<br>When I do not add the field data it just complains about missing fields so I know that the code is not completely wrong...<br>
I am adding the data to the first block of my multiblockdataset... Is that a problem ? <br><br><br><br>Thanks ! <br>Jacques<br><br><br><div class="gmail_quote">2010/8/12 Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span><div>
<div></div><div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Andy, Pat,<br><br>I have the skeleton of the coprocessing working (for the moment I just tried by populating the point field - no cells, no data).<br>
I am trying to figure out the most efficient way of transferring my data structure to VTK with minimal copying and looping... <br>
I would like to use the vtkUnstructuredGrid::SetCells() method, which means I probably need to use the vtkCellArray::SetCells() method, and therefore the vtkIdType::SetArray() method... <br>The problem is I am not sure what the format of the array should be ?<br>
I am dealing with unstructured polyhedra cells (most of which are known types like hex prism etc..). <br><br>Of course, I could also use the InsertNextCell() methods, but I was wondering if there wasn't a more efficient way... <br>
<br>Best,<br>Jacques<br><br><br><div class="gmail_quote">2010/8/9 Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span><div><div></div><div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jacques,<br><br>I put an example on the wiki based on Pat's example for running a coprocessing. It's at:<br><a href="http://paraview.org/Wiki/Coprocessing_example#Python_Scripts" target="_blank">http://paraview.org/Wiki/Coprocessing_example#Python_Scripts</a><br>
Let me know if you have any problems with it so that I can fix any errors that I have.<br><br>Also, I just made changes so that the coprocessing library gets installed properly.<br><br>Thanks,<br><font color="#888888">Andy</font><div>
<div></div><div><br><br><div class="gmail_quote">
On Wed, Aug 4, 2010 at 7:21 PM, Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks Pat, <br><br>I am trying to compile my first attempt.<br>Although I do find the headers I need, I am having some trouble identifying which libraries I need to link to. <br>
For example, I assume that I should be linking to libvtkCoProcessor.so ... Although I find this library in the compilation folder (under bin), I do not find it in the make installed version under lib... <br>
Is this normal ? <br><br>Best, <br>Jacques<br><br><div class="gmail_quote">2010/8/4 pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>></span><div><div></div>
<div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Below is a simple cxx program I have used for testing. It creates one sphere per process, positions the sphere as a function of the process id, and the spheres grow/shrink over time.<br><br>Pat<br><br>#include "vtkCPProcessor.h"<br>
#include "vtkCPPythonScriptPipeline.h"<br>#include "vtkMultiProcessController.h"<br>#include "vtkXMLUnstructuredGridReader.h"<br>#include "vtkUnstructuredGrid.h"<br>#include "vtkCPDataDescription.h"<br>
#include "vtkCPInputDataDescription.h"<br>#include "vtkSmartPointer.h"<br>#include "vtkPolyData.h"<br>#include "vtkSphereSource.h"<br><br>#include <stdio.h><br>#include <string><br>
#include <sstream><br><br>static unsigned int procId;<br><br>void myprint(const std::string& str)<br>{<br> printf("driver (%u): %s\n", procId, str.c_str());<br>}<br><br>class DataGenerator {<br>public:<br>
<br> DataGenerator()<br> {<br> this->Sphere = vtkSmartPointer<vtkSphereSource>::New();<br> this->Sphere->SetThetaResolution(30);<br> this->Sphere->SetPhiResolution(30);<br> this->Sphere->SetCenter(procId*4.0, 0, 0);<br>
this->Index = 0;<br> }<br><br> vtkSmartPointer<vtkPolyData> GetNext()<br> {<br> double radius = fabs(sin(0.1 * this->Index));<br> this->Index++;<br> this->Sphere->SetRadius(1.0 + radius);<br>
this->Sphere->Update();<br> vtkSmartPointer<vtkPolyData> ret = vtkSmartPointer<vtkPolyData>::New();<br> ret->DeepCopy(this->Sphere->GetOutput());<br> return ret;<br> }<br><br>protected:<br>
<br> int Index;<br> vtkSmartPointer<vtkSphereSource> Sphere;<br> <br><br>};<br><br>int main(int argc, char* argv[])<br>{<br> if (argc < 3)<br> {<br> printf("Usage: %s <cp python file> <number of steps>\n", argv[0]);<br>
return 1;<br> }<br><br> std::string cpPythonFile = argv[1];<br> int nSteps = atoi(argv[2]);<br><br> myprint("starting coprocessor");<br><br> vtkCPProcessor* processor = vtkCPProcessor::New();<br> processor->Initialize();<br>
vtkCPPythonScriptPipeline* pipeline = vtkCPPythonScriptPipeline::New();<br><br> // mpi was initialized when we called vtkCPPythonScriptPipeline::New()<br> procId = vtkMultiProcessController::GetGlobalController()->GetLocalProcessId();<br>
<br><br> // read the coprocessing python file<br> myprint("loading pipeline python file: " + cpPythonFile);<br> int success = pipeline->Initialize(cpPythonFile.c_str());<br> if (!success)<br> {<br> myprint("aborting");<br>
return 1;<br> }<br><br> processor->AddPipeline(pipeline);<br> pipeline->Delete();<br><br> if (nSteps == 0)<br> {<br> return 0;<br> }<br><br> // create a data source<br> DataGenerator generator;<br>
<br> // do coprocessing<br> double tStart = 0.0;<br> double tEnd = 1.0;<br> double stepSize = (tEnd - tStart)/nSteps;<br><br> vtkCPDataDescription* dataDesc = vtkCPDataDescription::New();<br> dataDesc->AddInput("input");<br>
<br> for (int i = 0; i < nSteps; ++i)<br> {<br><br> double currentTime = tStart + stepSize*i;<br> std::stringstream timeStr;<br> timeStr << "time(" << i << ", " << currentTime << ")";<br>
<br><br> dataDesc->SetTimeData(currentTime, i);<br><br> myprint("call RequestDataDescription, " + timeStr.str());<br> int do_coprocessing = processor->RequestDataDescription(dataDesc);<br><br> if (do_coprocessing)<br>
{<br> myprint("calling CoProcess, " + timeStr.str());<br><br> vtkSmartPointer<vtkDataObject> dataObject =<br> generator.GetNext();<br><br> dataDesc->GetInputDescriptionByName("input")->SetGrid(dataObject);<br>
processor->CoProcess(dataDesc);<br> }<br> }<br><br><br> myprint("finalizing");<br> dataDesc->Delete();<br> processor->Finalize();<br> processor->Delete();<br><br> return 0;<div><div>
</div><div><br>}<br>
<br><br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 12:14 PM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jacques,<br><br>There is a polyhedra cell type in VTK now -- <a href="http://www.vtk.org/doc/nightly/html/classvtkPolyhedron.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkPolyhedron.html</a><br>As far as I know it works with all of the proper filters but since I haven't tried it yet I won't promise that. The good news is that Will Schroeder had a high interest in it and probably worked on some of it so I'd assume that it's working quite well right now.<br>
<br>As for Phasta, it does run in parallel (as props to their developers it was a finalist for the 2009 Gordon Bell prize). The grid is already partitioned and each process runs the adaptor and creates an unstructured grid from its portion of the partitioned mesh. Thus, there isn't any need for mpi calls in the adaptor code. If you had ghost cell information in your partitioned mesh and wanted to get fancy you should be able to add that to your partitioned grid to make some of the filters faster but I haven't tried that.<br>
<font color="#888888">
<br>Andy</font><div><div></div><div><br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 11:58 AM, Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks a lot Andy, Takuya,<br><br>I'm using the PhastaAdaptor, and the FortranAdaptorAPI as a guide for the moment. <br>I know there were talks of getting POLYHEDRAL cell support in VTK. Do you know if this is there yet?<br>
My dataset is multiregion unstructured polyhedral mesh domain decomposed amongst each processor. <br><br>Is the Phasta code parallelized ? If so, I do not see any MPI statements in the adaptor code ?<br><br>Jacques<br><br>
<div class="gmail_quote">2010/8/4 Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jacques,<br><br>What type of data set do you have? Even though the PHASTA adaptor ( ParaView/CoProcessing/Adaptors/FortranAdaptors/PhastaAdaptor) is for fortran code it may give you an idea. Also stepping through the example in ParaView/CoProcessing/CoProcessor/Testing/Cxx/PythonScriptCoProcessingExample.cxx may help as well.<br>
<br>I'll spend some time this week putting up a skeleton of a simulation code on the coprocessing wiki that should hopefully be easier to follow. I'll let you know when it's done.<br><font color="#888888"><br>
Andy<br><br></font><div class="gmail_quote"><div><div></div><div>
On Wed, Aug 4, 2010 at 8:02 AM, Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>
Hi All,<br><br>Sorry for my last post, I figured out that I had wrongly set my PYTHONPATH.. <br>All the tests work ok now. Still interested in CoProcessing adaptors examples though :) <br><br>Thanks <br>Jacques<br><br><div class="gmail_quote">
2010/8/4 Jacques Papper <span dir="ltr"><<a href="mailto:jacques.papper@gmail.com" target="_blank">jacques.papper@gmail.com</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class="gmail_quote">Hi All, <br><br>I'm starting to look into the ParaView CoProcessing libraries. <br>I just pulled from git today, and compiled it all up following the guidelines in :<br><a href="http://www.paraview.org/Wiki/CoProcessing" target="_blank">http://www.paraview.org/Wiki/CoProcessing</a><br>
I didn't find :<br><b>BUILD_PYTHON_COPROCESSING_ADAPTOR<br></b>but instead :<br>PARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator<br>anyway the compilation went through without any issues.<br>I then tried :<br><br>ctest -R CoProcessing<br>
Test project /users/boreas01/jacques/PARAVIEW/ParaView-bin<br> Start 491: CoProcessingTestPythonScript<br>1/3 Test #491: CoProcessingTestPythonScript ........... Passed 0.45 sec<br> Start 492: CoProcessingPythonScriptGridPlot<br>
2/3 Test #492: CoProcessingPythonScriptGridPlot .......***Failed 0.09 sec<br> Start 493: CoProcessingPythonScriptPressurePlot<br>3/3 Test #493: CoProcessingPythonScriptPressurePlot ...***Failed 0.09 sec<br><br>33% tests passed, 2 tests failed out of 3<br>
<br>Total Test time (real) = 0.68 sec<br><br>The following tests FAILED:<br> 492 - CoProcessingPythonScriptGridPlot (Failed)<br> 493 - CoProcessingPythonScriptPressurePlot (Failed)<br>Errors while running CTest<br>
<br>Is this a problem in my current installation or on the master branch ? <br><br>Finally, I would like to start writing an adaptor to a C++ parallelised code. Can you tell me what is the closest code I can inspire myself from ? <br>
<br><br>Thank you, <br><font color="#888888"><font color="#888888">Jacques<br>
</font></font></div><br><br>PS sorry mixed up the subjects.. <br>
</blockquote></div></div></div><br>
<br></div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></div></blockquote></div><br>
</blockquote></div></div></div><br>
</blockquote></div><br>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>
</div></div></blockquote></div></div></div><br>
</blockquote></div></div></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>