From: SONOLET Aymeric Date: Fri, 12 Apr 2024 16:14:56 +0000 (+0200) Subject: wip: fixing ParaMEDMEM X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3ce4cbd961673dc1345ed6287781297f4016cec;p=tools%2Fmedcoupling.git wip: fixing ParaMEDMEM --- diff --git a/src/INTERP_KERNEL/Bases/InterpKernelException.hxx b/src/INTERP_KERNEL/Bases/InterpKernelException.hxx index 3df45a91f..3eeab812d 100644 --- a/src/INTERP_KERNEL/Bases/InterpKernelException.hxx +++ b/src/INTERP_KERNEL/Bases/InterpKernelException.hxx @@ -25,6 +25,7 @@ #include #include +#include namespace INTERP_KERNEL { diff --git a/src/ParaMEDMEM/BlockTopology.cxx b/src/ParaMEDMEM/BlockTopology.cxx index 22aa08815..77cd48008 100644 --- a/src/ParaMEDMEM/BlockTopology.cxx +++ b/src/ParaMEDMEM/BlockTopology.cxx @@ -32,6 +32,7 @@ #include #include #include +#include using namespace std; @@ -144,7 +145,7 @@ namespace MEDCoupling auto* nbelems_per_proc = new mcIdType[group.size()]; const auto* mpi_group=dynamic_cast(_proc_group); const MPI_Comm* comm=mpi_group->getComm(); - mcIdType const nbtemp=nb_elem; + mcIdType nbtemp=nb_elem; mpi_group->getCommInterface().allGather(&nbtemp, 1, MPI_ID_TYPE, nbelems_per_proc, 1, MPI_ID_TYPE, *comm); @@ -253,7 +254,7 @@ namespace MEDCoupling { int position=_proc_group->myRank(); mcIdType nb_elem = 1; - int const increment=1; + int increment=1; for (int i=_dimension-1; i>=0; i--) { increment *=_nb_procs_per_dim[i]; @@ -275,7 +276,7 @@ namespace MEDCoupling { vector > local_indices (_dimension); int const myrank=_proc_group->myRank(); - int const increment=1; + int increment=1; for (int i=_dimension-1; i>=0; i--) { increment *=_nb_procs_per_dim[i]; diff --git a/src/ParaMEDMEM/BlockTopology.hxx b/src/ParaMEDMEM/BlockTopology.hxx index 029d8aefb..7412ce3ed 100644 --- a/src/ParaMEDMEM/BlockTopology.hxx +++ b/src/ParaMEDMEM/BlockTopology.hxx @@ -26,13 +26,14 @@ #include "ProcessorGroup.hxx" #include +#include namespace MEDCoupling { class ComponentTopology; class MEDCouplingCMesh; - using CYCLE_TYPE = enum{Block,Cycle}; + typedef enum{Block,Cycle} CYCLE_TYPE; /*! * \anchor BlockTopology-det diff --git a/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx b/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx index 65fab1138..fffb5e134 100644 --- a/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx +++ b/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx @@ -58,7 +58,7 @@ namespace MEDCoupling std::vector displacement(size_world, 0 ); std::vector words_size(size_world); - int const stringSize = (int) simCodeTag.size(); + int stringSize = (int) simCodeTag.size(); interface.allGather( &stringSize, 1, MPI_INT, words_size.data(), 1, MPI_INT, world_comm ); for (size_t rank = 1; rank < words_size.size(); rank++) diff --git a/src/ParaMEDMEM/CommInterface.hxx b/src/ParaMEDMEM/CommInterface.hxx index c15feb282..7a4e8ae97 100644 --- a/src/ParaMEDMEM/CommInterface.hxx +++ b/src/ParaMEDMEM/CommInterface.hxx @@ -30,6 +30,7 @@ #include #include +#include namespace MEDCoupling { @@ -199,7 +200,7 @@ namespace MEDCoupling using DataArrayT = typename Traits::ArrayType; std::unique_ptr result; std::unique_ptr resultIndex; - int const rank(-1); + int rank(-1); int size(this->gatherArraysT(comm,root,array,result,resultIndex,rank)); arraysOut.resize(size); for(int i = 0 ; i < size ; ++i) diff --git a/src/ParaMEDMEM/DECOptions.hxx b/src/ParaMEDMEM/DECOptions.hxx index 0bf7d78a4..7c2ff78d4 100644 --- a/src/ParaMEDMEM/DECOptions.hxx +++ b/src/ParaMEDMEM/DECOptions.hxx @@ -25,9 +25,9 @@ namespace MEDCoupling { //! Enum describing the allToAll method used in the communication pattern - using AllToAllMethod = enum { Native, PointToPoint }; + typedef enum { Native, PointToPoint } AllToAllMethod; //! Enum describing the time interpolation method - using TimeInterpolationMethod = enum { WithoutTimeInterp, LinearTimeInterp }; + typedef enum { WithoutTimeInterp, LinearTimeInterp } TimeInterpolationMethod; /*! This class groups the various options accepted by all \ref para-dec "DECs" (which all inherit from %DECOptions). diff --git a/src/ParaMEDMEM/DisjointDEC.cxx b/src/ParaMEDMEM/DisjointDEC.cxx index f1ad38044..1fab3ca21 100644 --- a/src/ParaMEDMEM/DisjointDEC.cxx +++ b/src/ParaMEDMEM/DisjointDEC.cxx @@ -307,7 +307,7 @@ namespace MEDCoupling for (int icomp=0; icomp<(int)_local_field->getField()->getArray()->getNumberOfComponents(); icomp++) { double const total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs); - double const source_norm = total_norm; + double source_norm = total_norm; _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast(_union_group)->getComm()); } @@ -316,7 +316,7 @@ namespace MEDCoupling for (int icomp=0; icomp<(int)_local_field->getField()->getArray()->getNumberOfComponents(); icomp++) { double const total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs); - double const source_norm=total_norm; + double source_norm=total_norm; _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast(_union_group)->getComm()); if (fabs(total_norm)>1e-100) diff --git a/src/ParaMEDMEM/ElementLocator.cxx b/src/ParaMEDMEM/ElementLocator.cxx index 91a60c86e..7ab8df3b7 100644 --- a/src/ParaMEDMEM/ElementLocator.cxx +++ b/src/ParaMEDMEM/ElementLocator.cxx @@ -21,6 +21,7 @@ #include #include "CommInterface.hxx" #include "ElementLocator.hxx" +#include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingNatureOfFieldEnum" #include "MCType.hxx" #include "ParaIdType.hxx" @@ -34,6 +35,9 @@ #include #include +#include +#include +#include using namespace std; @@ -111,7 +115,7 @@ namespace MEDCoupling void ElementLocator::exchangeMethod(const std::string& sourceMeth, int idistantrank, std::string& targetMeth) { - CommInterface const comm_interface=_union_group->getCommInterface(); + CommInterface comm_interface=_union_group->getCommInterface(); auto* group=static_cast (_union_group); const MPI_Comm* comm=(group->getComm()); MPI_Status status; @@ -231,7 +235,7 @@ namespace MEDCoupling const DataArrayIdType* distant_ids_send, mcIdType*& distant_ids_recv) { - CommInterface const comm_interface=_union_group->getCommInterface(); + CommInterface comm_interface=_union_group->getCommInterface(); // First stage : exchanging sizes // ------------------------------ diff --git a/src/ParaMEDMEM/ExplicitTopology.hxx b/src/ParaMEDMEM/ExplicitTopology.hxx index 2fca827bc..419fea84b 100644 --- a/src/ParaMEDMEM/ExplicitTopology.hxx +++ b/src/ParaMEDMEM/ExplicitTopology.hxx @@ -23,13 +23,14 @@ #include "MCType.hxx" #include "CommInterface.hxx" #include "ProcessorGroup.hxx" +#include "InterpKernelHashMap.hxx" +#include "Topology.hxx" #include namespace MEDCoupling { class ParaMESH; - class Topology; class ComponentTopology; /*! diff --git a/src/ParaMEDMEM/InterpolationMatrix.hxx b/src/ParaMEDMEM/InterpolationMatrix.hxx index df383587e..b42493d14 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.hxx +++ b/src/ParaMEDMEM/InterpolationMatrix.hxx @@ -23,11 +23,15 @@ #include "MCType.hxx" #include "MCAuto.hxx" #include "MEDCouplingFieldDouble.hxx" +#include "MEDCouplingPointSet.hxx" #include "MPIAccessDEC.hxx" #include "MxN_Mapping.hxx" #include "InterpolationOptions.hxx" #include "DECOptions.hxx" +#include "ParaFIELD.hxx" #include +#include +#include namespace MEDCoupling { diff --git a/src/ParaMEDMEM/MPIAccess/MPIAccess.hxx b/src/ParaMEDMEM/MPIAccess/MPIAccess.hxx index 3cc90a5d3..7c355fffb 100644 --- a/src/ParaMEDMEM/MPIAccess/MPIAccess.hxx +++ b/src/ParaMEDMEM/MPIAccess/MPIAccess.hxx @@ -25,15 +25,18 @@ #include #include +#include +#include +#include namespace MEDCoupling { - using TimeMessage = struct + typedef struct { double time ; double deltatime ; int tag ; - }; + } TimeMessage; static MPI_Request mpirequestnull = MPI_REQUEST_NULL ; enum _MessageIdent { _message_unknown, _message_time, _message_int, _message_double } ; diff --git a/src/ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx b/src/ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx index b6dfa9656..63dcb706b 100644 --- a/src/ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx +++ b/src/ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx @@ -108,11 +108,12 @@ namespace MEDCoupling std::vector< MPI_Datatype >* _data_messages_type; std::vector< std::vector< void * > >* _data_messages; - using SendBuffStruct = struct + typedef struct { void * SendBuffer; int Counter; - MPI_Datatype DataType; }; + MPI_Datatype DataType; } + SendBuffStruct; std::map< int , SendBuffStruct * > *_map_of_send_buffers; }; diff --git a/src/ParaMEDMEM/OverlapElementLocator.cxx b/src/ParaMEDMEM/OverlapElementLocator.cxx index 093d46573..f0ef74434 100644 --- a/src/ParaMEDMEM/OverlapElementLocator.cxx +++ b/src/ParaMEDMEM/OverlapElementLocator.cxx @@ -31,6 +31,7 @@ #include "MPIProcessorGroup.hxx" #include "OverlapInterpolationMatrix.hxx" #include "MEDCouplingFieldDiscretization.hxx" +#include "MEDCouplingFieldDouble.hxx" #include "InterpKernelAutoPtr.hxx" #include