1 // Copyright (C) 2007-2023 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "CommInterface.hxx"
24 MPI_Datatype ParaTraits<double>::MPIDataType = MPI_DOUBLE;
26 MPI_Datatype ParaTraits<Int32>::MPIDataType = MPI_INT;
28 MPI_Datatype ParaTraits<Int64>::MPIDataType = MPI_LONG;
30 void CommInterface::gatherArrays(MPI_Comm comm, int root, const DataArrayIdType *array, std::vector< MCAuto<DataArrayIdType> >& arraysOut) const
32 this->gatherArraysT2<mcIdType>(comm,root,array,arraysOut);
36 * Generalized AllGather collective communication.
37 * This method send input \a array to all procs.
39 void CommInterface::allGatherArrays(MPI_Comm comm, const DataArrayIdType *array, std::vector< MCAuto<DataArrayIdType> >& arraysOut) const
41 this->allGatherArraysT2<mcIdType>(comm,array,arraysOut);
45 * Generalized AllGather collective communication.
46 * This method send input \a array to all procs.
48 int CommInterface::allGatherArrays(MPI_Comm comm, const DataArrayIdType *array, std::unique_ptr<mcIdType[]>& result, std::unique_ptr<mcIdType[]>& resultIndex) const
50 return this->allGatherArraysT<mcIdType>(comm,array,result,resultIndex);
53 void CommInterface::allToAllArrays(MPI_Comm comm, const std::vector< MCAuto<DataArrayDouble> >& arrays, std::vector< MCAuto<DataArrayDouble> >& arraysOut) const
55 this->allToAllArraysT<double>(comm,arrays,arraysOut);
58 void CommInterface::allToAllArrays(MPI_Comm comm, const std::vector< MCAuto<DataArrayDouble> >& arrays, MCAuto<DataArrayDouble>& arraysOut) const
60 std::unique_ptr<mcIdType[]> notUsed1;
62 this->allToAllArraysT2<double>(comm,arrays,arraysOut,notUsed1,notUsed2);
66 * Generalized AllToAll collective communication.
68 void CommInterface::allToAllArrays(MPI_Comm comm, const std::vector< MCAuto<DataArrayIdType> >& arrays, std::vector< MCAuto<DataArrayIdType> >& arraysOut) const
70 this->allToAllArraysT<mcIdType>(comm,arrays,arraysOut);