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

Method Reduce

Parallel/Core/vtkMultiProcessController.cxx:733–762  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

731}
732//------------------------------------------------------------------------------
733int vtkMultiProcessController::Reduce(
734 const vtkBoundingBox& sendBuffer, vtkBoundingBox& recvBuffer, int destProcessId)
735{
736 if (this->GetNumberOfProcesses() <= 1)
737 {
738 recvBuffer = sendBuffer;
739 return 1;
740 }
741
742 double send_min[3] = { VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX };
743 double send_max[3] = { VTK_DOUBLE_MIN, VTK_DOUBLE_MIN, VTK_DOUBLE_MIN };
744 if (sendBuffer.IsValid())
745 {
746 sendBuffer.GetMinPoint(send_min);
747 sendBuffer.GetMaxPoint(send_max);
748 }
749 double recv_min[3], recv_max[3];
750 if (this->Reduce(send_min, recv_min, 3, vtkCommunicator::MIN_OP, destProcessId) &&
751 this->Reduce(send_max, recv_max, 3, vtkCommunicator::MAX_OP, destProcessId))
752 {
753 if (this->GetLocalProcessId() == destProcessId)
754 {
755 const double bds[6] = { recv_min[0], recv_max[0], recv_min[1], recv_max[1], recv_min[2],
756 recv_max[2] };
757 recvBuffer.SetBounds(bds);
758 }
759 return 1;
760 }
761 return 0;
762}
763
764//------------------------------------------------------------------------------
765int vtkMultiProcessController::AllReduce(

Callers 1

AllReduceMethod · 0.95

Calls 15

GetNumberOfProcessesMethod · 0.95
GetLocalProcessIdMethod · 0.95
GetMinPointMethod · 0.80
GetMaxPointMethod · 0.80
RemoveAllArraysMethod · 0.80
CopySelectionsMethod · 0.80
backMethod · 0.80
SetArraySettingMethod · 0.80
stringClass · 0.50
reverseFunction · 0.50
swapFunction · 0.50
IsValidMethod · 0.45

Tested by

no test coverage detected