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

Method AllReduce

Parallel/Core/vtkMultiProcessController.cxx:765–791  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

763
764//------------------------------------------------------------------------------
765int vtkMultiProcessController::AllReduce(
766 const vtkBoundingBox& sendBuffer, vtkBoundingBox& recvBuffer)
767{
768 if (this->GetNumberOfProcesses() <= 1)
769 {
770 recvBuffer = sendBuffer;
771 return 1;
772 }
773
774 double send_min[3] = { VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX };
775 double send_max[3] = { VTK_DOUBLE_MIN, VTK_DOUBLE_MIN, VTK_DOUBLE_MIN };
776 if (sendBuffer.IsValid())
777 {
778 sendBuffer.GetMinPoint(send_min);
779 sendBuffer.GetMaxPoint(send_max);
780 }
781 double recv_min[3], recv_max[3];
782 if (this->AllReduce(send_min, recv_min, 3, vtkCommunicator::MIN_OP) &&
783 this->AllReduce(send_max, recv_max, 3, vtkCommunicator::MAX_OP))
784 {
785 const double bds[6] = { recv_min[0], recv_max[0], recv_min[1], recv_max[1], recv_min[2],
786 recv_max[2] };
787 recvBuffer.SetBounds(bds);
788 return 1;
789 }
790 return 0;
791}
792
793//----------------------------------------------------------------------------
794int vtkMultiProcessController::Reduce(

Callers

nothing calls this directly

Calls 15

GetNumberOfProcessesMethod · 0.95
ReduceMethod · 0.95
GetLocalProcessIdMethod · 0.95
GetMinPointMethod · 0.80
GetMaxPointMethod · 0.80
RemoveAllArraysMethod · 0.80
SetArraySettingMethod · 0.80
stringClass · 0.50
IsValidMethod · 0.45
SetBoundsMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetArrayNameMethod · 0.45

Tested by

no test coverage detected