<div dir="ltr"><div><div><div>Hi,<br><br></div>Can you use a different controller that has the same MPI processes assigned to it? If that works for you, you should be able to just create a vtkMPIController and use either CreateSubController() or PartitionController() to create one similar to what you want. Note that you may need to create two vtkMPIControllers, one that corresponds to MPI_COMM_WORLD and one for your partitioning. After you've done that you can use the vtkMPIController::SetGlobalController() to have VTK and ParaView use that for interprocess communication.<br><br></div>Best,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 10:09 AM, VAUTRIN Yohann (SAFRAN) <span dir="ltr"><<a href="mailto:yohann.vautrin@safran.fr" target="_blank">yohann.vautrin@safran.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="FR">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m working on a Catalyst adaptor written in Python for one of the CFD codes I use at work and I’m having trouble setting the MPI communicator I want the vtkCPProcessor object to use (in order to use a subset of MPI_COMM_WORLD).
The MPI communicator I create is a mpi4py.MPI_Comm object, which I convert to a vtkMPICommunicator object using vtk.vtkMPI4PyCommunicator.ConvertToVTK. However vtk.vtkPVCatalystPython.vtkCPProcessor.Initialize is expecting a vtkMPICommunicatorOpaqueComm object
and there does not seem to be a way for me to create such an object from the Python interface. Am I missing something here or is something not wrapped correctly or wrong?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">For the moment I use mpi4py.MPI.COMM_WORLD to test everything. The following minimal example replicates my problem:<u></u><u></u></span></p>
<p class="MsoNormal"><i><span lang="EN-US">import mpi4py.MPI<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US">import vtk<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US">comm = mpi4py.MPI.COMM_WORLD<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US">coprocessor = vtk.vtkPVCatalystPython.vtkCPProcessor()<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US">coprocessor.Initialize(vtk.vtkMPI4PyCommunicator.ConvertToVTK(comm))<u></u><u></u></span></i></p>
<p class="MsoNormal"><span lang="EN-US">The last line fails with this message:<u></u><u></u></span></p>
<p class="MsoNormal"><i><span lang="EN-US">TypeError: Initialize argument 1: method requires a vtkMPICommunicatorOpaqueComm, a vtkMPICommunicator was provided.<u></u><u></u></span></i></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I hope I post on the right mailing list as this could actually be a problem in VTK.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you for your help.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Best,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Yohann V.<u></u><u></u></span></p>
</div>
<p>#<br>
" Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles, être soumis aux règlementations relatives au contrôle des exportations ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Toute exportation ou réexportation non autorisée est interdite.Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés."<br>
******<br>
" This e-mail and any attached documents may contain confidential or proprietary information and may be subject to export control laws and regulations. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. Unauthorized export or re-export is prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system."<br>
#</p></div>
<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>
<br></blockquote></div><br></div>