diff --git a/Parallel/MPI/vtkMPICommunicator.cxx b/Parallel/MPI/vtkMPICommunicator.cxx index 5e6f318509af9bd2ab7ffaaaa2401fa14861a8c4..202d8a15c2aa8d17c4258e91808ba3c6231d7a20 100644 --- a/Parallel/MPI/vtkMPICommunicator.cxx +++ b/Parallel/MPI/vtkMPICommunicator.cxx @@ -13,6 +13,7 @@ #include "vtkStructuredGrid.h" #define VTK_CREATE(type, name) vtkSmartPointer<type> name = vtkSmartPointer<type>::New() +#include <algorithm> #include <cassert> #include <type_traits> // for std::is_pointer #include <vector> @@ -991,12 +992,6 @@ int vtkMPICommunicator::SendVoidArray( tag, mpiType, this->MPIComm->Handle, vtkCommunicator::UseCopy, this->UseSsend)); } -//------------------------------------------------------------------------------ -inline vtkIdType vtkMPICommunicatorMin(vtkIdType a, vtkIdType b) -{ - return (a > b) ? b : a; -} - //------------------------------------------------------------------------------ int vtkMPICommunicator::ReceiveVoidArray( void* data, vtkIdType maxlength, int type, int remoteProcessId, int tag) @@ -1042,9 +1037,9 @@ int vtkMPICommunicator::ReceiveVoidArray( vtkMPICommunicatorReceiveDataInfo info; info.Handle = this->MPIComm->Handle; info.DataType = mpiType; - while (CheckForMPIError(this->ReceiveDataInternal(byteData, - vtkMPICommunicatorMin(maxlength, maxReceive), sizeOfType, remoteProcessId, tag, &info, - vtkCommunicator::UseCopy, this->LastSenderId)) != 0) + while ( + CheckForMPIError(this->ReceiveDataInternal(byteData, std::min<vtkIdType>(maxlength, maxReceive), + sizeOfType, remoteProcessId, tag, &info, vtkCommunicator::UseCopy, this->LastSenderId)) != 0) { remoteProcessId = this->LastSenderId;