<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] MPI_Comm_split</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>vtkMPIController::PartitionController is a specialization of the more generic vtkMultiProcessController::PartitionController. You should not modify the vtkMPIController version without also making equivalent changes in vtkMultiProcessController. The correct implementation will do the following:<BR>
<BR>
</SPAN></FONT><OL><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Create a constant like vtkMultiProcessController::NO_PARTITION.
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Modify vtkMultiProcessController::PartitionController to recognize the NO_PARTITION color and return NULL instead of create a new controller for that group.
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Modify vtkMultiProcessController::PartitionController to convert NO_PARTITION to MPI_UNDEFINED and then convert any MPI_COMM_NULL to return NULL instead of a new vtkMPIController. (It is a bad idea to create controllers that do not behave properly.)
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Add code to VTK/Parallel/Testing/Cxx/ExerciseMultiProcessController.cxx to use this new feature with PartitionController. This code will be used to test both the vtkMultiProcessController and vtkMPIController versions of that method.<BR>
</SPAN></FONT></OL><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
-Ken<BR>
<BR>
<BR>
On 6/11/10 4:18 PM, "pat marion" <<a href="pat.marion@kitware.com">pat.marion@kitware.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>VTK wraps MPI_Comm_split with vtkMPIController::PartitionController(), which calls vtkMPICommunicator::SplitInitialize(). Currently there is no support for passing MPI_UNDEFINED as a color. If you pass MPI_UNDEFINED as a color you should get back a null communicator (MPI_COMM_NULL).<BR>
<BR>
There is handling of null communicators in vtkMPIController::CreateSubController() which wraps MPI_Comm_create. So I can follow the same pattern to make PartitionController support it too, no problem.<BR>
<BR>
But I do a lot of prototyping in python, and in python I can't easily use MPI_UNDEFINED. So I'm thinking about adding a static method called vtkMPICommunicator::GetMPIUndefined() that returns MPI_UNDEFINED (it's just an int). Objections? My other thought was to have vtkMPIController::PartitionController automatically convert negative color values to MPI_UNDEFINED, but that behavior could cover up programming errors, so I don't like that.<BR>
<BR>
Pat<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>