------------------------------------------------------------------------------
| 59 | |
| 60 | //------------------------------------------------------------------------------ |
| 61 | void 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 | //------------------------------------------------------------------------------ |
| 85 | int vtkProcessGroup::GetLocalProcessId() |
no test coverage detected