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

Method PieceNodeMinToNode0

Filters/Parallel/vtkIntegrateAttributes.cxx:560–585  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

558
559//------------------------------------------------------------------------------
560int vtkIntegrateAttributes::PieceNodeMinToNode0(
561 vtkUnstructuredGrid* data, double& totalSum, double totalSumCenter[3], int& integrationDimension)
562{
563 int numProcs = this->Controller ? this->Controller->GetNumberOfProcesses() : 1;
564 int processId = this->Controller ? this->Controller->GetLocalProcessId() : 0;
565 int localMin = (data->GetNumberOfCells() == 0 ? numProcs : processId);
566 int globalMin = numProcs;
567 if (numProcs == 1)
568 {
569 return 0;
570 }
571 this->Controller->AllReduce(&localMin, &globalMin, 1, vtkCommunicator::MIN_OP);
572 if (globalMin == 0 || globalMin == numProcs)
573 {
574 return globalMin;
575 }
576 if (processId == 0)
577 {
578 this->ReceivePiece(data, globalMin, totalSum, totalSumCenter, integrationDimension);
579 }
580 else if (processId == globalMin)
581 {
582 this->SendPiece(data, totalSum, totalSumCenter, integrationDimension);
583 }
584 return globalMin;
585}
586
587//------------------------------------------------------------------------------
588void vtkIntegrateAttributes::SendPiece(vtkUnstructuredGrid* src, const double totalSum,

Callers 1

RequestDataMethod · 0.95

Calls 6

ReceivePieceMethod · 0.95
SendPieceMethod · 0.95
GetNumberOfProcessesMethod · 0.80
GetLocalProcessIdMethod · 0.45
GetNumberOfCellsMethod · 0.45
AllReduceMethod · 0.45

Tested by

no test coverage detected