MCPcopy Create free account
hub / github.com/Kitware/VTK / InitializeNumberOfProcesses

Method InitializeNumberOfProcesses

Parallel/MPI/vtkMPICommunicator.cxx:856–881  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Set the number of processes and maximum number of processes to the size obtained from MPI.

Source from the content-addressed store, hash-verified

854// Set the number of processes and maximum number of processes
855// to the size obtained from MPI.
856int vtkMPICommunicator::InitializeNumberOfProcesses()
857{
858 int err;
859
860 this->Modified();
861
862 if ((err = MPI_Comm_size(*(this->MPIComm->Handle), &(this->MaximumNumberOfProcesses))) !=
863 MPI_SUCCESS)
864 {
865 char* msg = vtkMPIController::ErrorString(err);
866 vtkErrorMacro("MPI error occurred: " << msg);
867 delete[] msg;
868 return 0;
869 }
870
871 this->NumberOfProcesses = this->MaximumNumberOfProcesses;
872
873 if ((err = MPI_Comm_rank(*(this->MPIComm->Handle), &(this->LocalProcessId))) != MPI_SUCCESS)
874 {
875 char* msg = vtkMPIController::ErrorString(err);
876 vtkErrorMacro("MPI error occurred: " << msg);
877 delete[] msg;
878 return 0;
879 }
880 return 1;
881}
882
883//------------------------------------------------------------------------------
884// Copy the MPI handle

Callers 4

InitializeMethod · 0.95
SplitInitializeMethod · 0.95
InitializeExternalMethod · 0.95
GetWorldCommunicatorMethod · 0.80

Calls 2

ErrorStringFunction · 0.85
ModifiedMethod · 0.45

Tested by

no test coverage detected