Salome HOME
Various fixes for test runs - introducing MEDCOUPLING_RESOURCE_DIR env variable
[tools/medcoupling.git] / src / ParaMEDMEM / MPIAccessDEC.cxx
index 5c74dbec7acf0a4d9e8e6b320c639be9638d162d..7ffa94195119e23fd508447918b65d417eb767f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -34,11 +34,7 @@ namespace MEDCoupling
     \param source_group working side ProcessorGroup
     \param target_group lazy side ProcessorGroup
     \param Asynchronous Communication mode (default asynchronous)
-    \param nStepBefore Number of Time step needed for the interpolation before current time
-    \param nStepAfter Number of Time step needed for the interpolation after current time
-
   */
-
   MPIAccessDEC::MPIAccessDEC( const ProcessorGroup& source_group,
                               const ProcessorGroup& target_group,
                               bool Asynchronous )
@@ -152,6 +148,11 @@ namespace MEDCoupling
             sts = _MPI_access->ISend( &((int *) sendbuf)[offset] , sendcount , sendtype ,
                                       target , SendRequestId ) ;
           }
+        else if ( sendtype == MPI_LONG )
+          {
+            sts = _MPI_access->ISend( &((long *) sendbuf)[offset] , sendcount , sendtype ,
+                                      target , SendRequestId ) ;
+          }
         else
           {
             sts = _MPI_access->ISend( &((double *) sendbuf)[offset] , sendcount , sendtype ,
@@ -165,6 +166,11 @@ namespace MEDCoupling
             sts = _MPI_access->send( &((int *) sendbuf)[offset] , sendcount , sendtype ,
                                      target , SendRequestId ) ;
           }
+        else if ( sendtype == MPI_LONG )
+          {
+            sts = _MPI_access->send( &((long *) sendbuf)[offset] , sendcount , sendtype ,
+                                     target , SendRequestId ) ;
+          }
         else
           {
             sts = _MPI_access->send( &((double *) sendbuf)[offset] , sendcount , sendtype ,
@@ -192,6 +198,11 @@ namespace MEDCoupling
             sts = _MPI_access->IRecv( &((int *) recvbuf)[offset] , recvcount , recvtype ,
                                       target , RecvRequestId ) ;
           }
+        else if ( recvtype == MPI_LONG )
+          {
+            sts = _MPI_access->IRecv( &((long *) recvbuf)[offset] , recvcount , recvtype ,
+                                      target , RecvRequestId ) ;
+          }
         else
           {
             sts = _MPI_access->IRecv( &((double *) recvbuf)[offset] , recvcount , recvtype ,
@@ -205,6 +216,11 @@ namespace MEDCoupling
             sts = _MPI_access->recv( &((int *) recvbuf)[offset] , recvcount , recvtype ,
                                      target , RecvRequestId ) ;
           }
+        else if ( recvtype == MPI_LONG )
+          {
+            sts = _MPI_access->recv( &((long *) recvbuf)[offset] , recvcount , recvtype ,
+                                     target , RecvRequestId ) ;
+          }
         else
           {
             sts = _MPI_access->recv( &((double *) recvbuf)[offset] , recvcount , recvtype ,
@@ -319,7 +335,7 @@ namespace MEDCoupling
       {
         return allToAllTime( sendbuf, sendcount, sendtype , recvbuf, recvcount, recvtype ) ;
       }
-    int sts ;
+    int sts = 0;
     int target ;
     int sendoffset = 0 ;
     int recvoffset = 0 ;
@@ -381,7 +397,7 @@ namespace MEDCoupling
         return allToAllvTime( sendbuf, sendcounts, sdispls, sendtype ,
                               recvbuf, recvcounts, rdispls, recvtype ) ;
       }
-    int sts ;
+    int sts = 0;
     int target ;
     int SendRequestId ;
     int RecvRequestId ;
@@ -496,7 +512,7 @@ namespace MEDCoupling
   int MPIAccessDEC::allToAllTime( void* sendbuf, int sendcount , MPI_Datatype sendtype ,
                                   void* recvbuf, int recvcount , MPI_Datatype recvtype )
   {
-    int sts ;
+    int sts = 0;
     int target ;
     int sendoffset = 0 ;
     int SendTimeRequestId ;
@@ -565,7 +581,7 @@ namespace MEDCoupling
       {
         for ( target = 0 ; target < _group_size ; target++ )
           {
-            int recvsize = recvcount*_MPI_access->extent( recvtype ) ;
+            int recvsize = (int)(recvcount*_MPI_access->extent( recvtype ));
             checkTime( recvcount , recvtype , target , false ) ;
             //===========================================================================
             //TODO : it is assumed actually that we have only 1 timestep before and after
@@ -616,7 +632,7 @@ namespace MEDCoupling
                                    void* recvbuf, int* recvcounts, int* rdispls,
                                    MPI_Datatype recvtype )
   {
-    int sts ;
+    int sts = 0;
     int target ;
     int SendTimeRequestId ;
     int SendDataRequestId ;
@@ -714,7 +730,7 @@ namespace MEDCoupling
           {
             if ( recvcounts[target] )
               {
-                int recvsize = recvcounts[target]*_MPI_access->extent( recvtype ) ;
+                int recvsize = (int)(recvcounts[target]*_MPI_access->extent( recvtype ));
                 checkTime( recvcounts[target] , recvtype , target , false ) ;
                 //===========================================================================
                 //TODO : it is assumed actually that we have only 1 timestep before nad after