[vtk-developers] MPI_Comm_split
Moreland, Kenneth
kmorel at sandia.gov
Mon Jun 14 11:37:12 EDT 2010
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:
1. Create a constant like vtkMultiProcessController::NO_PARTITION.
2. Modify vtkMultiProcessController::PartitionController to recognize the NO_PARTITION color and return NULL instead of create a new controller for that group.
3. 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.)
4. 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.
-Ken
On 6/11/10 4:18 PM, "pat marion" <pat.marion at kitware.com> wrote:
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).
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.
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.
Pat
**** Kenneth Moreland
*** Sandia National Laboratories
***********
*** *** *** email: kmorel at sandia.gov
** *** ** phone: (505) 844-8919
*** web: http://www.cs.unm.edu/~kmorel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100614/3e3fa8bd/attachment.html>
More information about the vtk-developers
mailing list