<div dir="ltr"><div>Hi Ufuk,<br><br></div>I can think of two potential fixes:<br><ul><li>Use the vtkCPProcessor:: Initialize(vtkMPICommunicatorOpaqueComm& comm) method to initialize each process with the proper MPI communicator. Note that vtkMPICommunicatorOpaqueComm is defined in vtkMPICommunicator.cxx. A similar example to this is available in the Examples/Catalyst/MPISubCommunicatorExample directory.<br></li><li>Call vtkCPProcessor::Initialize() on all processes with your global communicator and then create a vtkMPIController partitioned the way you want and set that to be the "global" communicator through vtkMPIController::SetGlobalController().</li></ul><p>Please let us know if either of these methods work for you.</p><p>Also, what code are you working on and is it a publicly available code? If you show your implementation I may have some in-depth suggestions for improvements.</p><p>Best,</p><p>Andy<br></p><p><br></p></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 17, 2016 at 4:17 AM, <span dir="ltr"><<a href="mailto:u.utku.turuncoglu@be.itu.edu.tr" target="_blank">u.utku.turuncoglu@be.itu.edu.tr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I was working on the issue recently and i am very close to having<br>
prototype code but i had some difficulties in initialization of the<br>
co-processing component with coprocessorinitializewithpython call. In my<br>
case, two model components and adaptor have its own processing source (or<br>
MPI_COMM_WORLD). For example, MPI processor 0, 1, 2, 3 are used by 1st<br>
model, 4, 5, 6, 7 are used by 2nd model code and 8, 9, 10, 11 is used by<br>
adaptor. The code basically handles transferring the grid information and<br>
data to adaptor. So, the problem is that if i try to call my custom<br>
coprocessorinitializewithpython call in adaptor (only in 8, 9, 10, 11)<br>
then it hangs in g_coprocessor->Initialize(); (see code at the end of the<br>
mail) step but if i call coprocessorinitializewithpython in the main code<br>
that uses all the available processor (between 0 and 11) and it runs<br>
without any problem. It seems that there is a restriction in the ParaView<br>
side (expecially vtkCPProcessor::Initialize() that can be found in<br>
CoProcessing/Catalyst/vtkCPProcessor.cxx) but i am not sure. Do you have<br>
any suggestion about that? Do you think that is it possible to fix it<br>
easily. Of corse the adaptor code could use all the processor but it is<br>
better to have its own dedicated resource that might have GPU support in<br>
those specific servers or processors. I am relatively new to VTK and it<br>
might be difficult for me to fix it and i need your guidance to start.<br>
<br>
Best Regards,<br>
<br>
--ufuk<br>
<br>
vtkCPProcessor* g_coprocessor;<br>
<br>
extern "C" void my_coprocessorinitializewithpython_(const char*<br>
pythonScriptName, const char strarr[][255], int *size) {<br>
if (pythonScriptName != NULL) {<br>
if (!g_coprocessor) {<br>
g_coprocessor = vtkCPProcessor::New();<br>
g_coprocessor->Initialize();<br>
vtkSmartPointer<vtkCPPythonScriptPipeline> pipeline =<br>
vtkSmartPointer<vtkCPPythonScriptPipeline>::New();<br>
pipeline->Initialize(pythonScriptName);<br>
g_coprocessor->AddPipeline(pipeline);<br>
//pipeline->FastDelete();<br>
}<br>
<br>
if (!g_coprocessorData) {<br>
g_coprocessorData = vtkCPDataDescription::New();<br>
// must be input port for all model components and for all dimensions<br>
for (int i = 0; i < *size; i++) {<br>
g_coprocessorData->AddInput(strarr[i]);<br>
std::cout << "adding input port [" << i << "] = " << strarr[i] <<<br>
std::endl;<br>
}<br>
}<br>
}<br>
}<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div><br></div>