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

Method SetCommunicator

Parallel/Core/vtkProcessGroup.cxx:61–82  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

59
60//------------------------------------------------------------------------------
61void vtkProcessGroup::SetCommunicator(vtkCommunicator* communicator)
62{
63 // Adjust ProcessIds array.
64 int* newProcessIds = nullptr;
65 int newNumberOfProcessIds = 0;
66 if (communicator)
67 {
68 newProcessIds = new int[communicator->GetNumberOfProcesses()];
69 newNumberOfProcessIds = communicator->GetNumberOfProcesses();
70 newNumberOfProcessIds = std::min(newNumberOfProcessIds, this->NumberOfProcessIds);
71 }
72 if (this->ProcessIds)
73 {
74 std::copy(newProcessIds, newProcessIds + newNumberOfProcessIds, this->ProcessIds);
75 }
76 if (this->Communicator)
77 delete[] this->ProcessIds;
78 this->ProcessIds = newProcessIds;
79 this->NumberOfProcessIds = newNumberOfProcessIds;
80
81 vtkSetObjectBodyMacro(Communicator, vtkCommunicator, communicator);
82}
83
84//------------------------------------------------------------------------------
85int vtkProcessGroup::GetLocalProcessId()

Callers 5

~vtkProcessGroupMethod · 0.95
InitializeMethod · 0.95
CopyMethod · 0.95
CreateSubControllerMethod · 0.45
~vtkDummyControllerMethod · 0.45

Calls 3

GetNumberOfProcessesMethod · 0.80
minFunction · 0.50
copyFunction · 0.50

Tested by

no test coverage detected