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

Method PrepareSummaryFile

IO/ParallelXML/vtkXMLPDataObjectWriter.cxx:202–218  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

200
201//------------------------------------------------------------------------------
202void vtkXMLPDataObjectWriter::PrepareSummaryFile()
203{
204 if (this->Controller && this->Controller->GetNumberOfProcesses() > 1)
205 {
206 assert(this->PieceWrittenFlags != nullptr);
207 // Reduce information about which pieces were written out to rank 0.
208 int myId = this->Controller->GetLocalProcessId();
209 unsigned char* recvBuffer = (myId == 0) ? new unsigned char[this->NumberOfPieces] : nullptr;
210 this->Controller->Reduce(
211 this->PieceWrittenFlags, recvBuffer, this->NumberOfPieces, vtkCommunicator::MAX_OP, 0);
212 if (myId == 0)
213 {
214 std::swap(this->PieceWrittenFlags, recvBuffer);
215 }
216 delete[] recvBuffer;
217 }
218}
219
220//------------------------------------------------------------------------------
221int vtkXMLPDataObjectWriter::WriteData()

Callers 1

WriteInternalMethod · 0.95

Calls 5

GetNumberOfProcessesMethod · 0.80
assertFunction · 0.50
swapFunction · 0.50
GetLocalProcessIdMethod · 0.45
ReduceMethod · 0.45

Tested by

no test coverage detected