Salome HOME
Various fixes for test runs - introducing MEDCOUPLING_RESOURCE_DIR env variable
[tools/medcoupling.git] / src / ParaMEDMEM / MPIAccess.cxx
index 65e903676fd0e7ca6fcd65d6fe03c8699de204fc..8ddaf698c2779ae943ae2895335c4b85535f1135 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  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
@@ -170,7 +170,7 @@ namespace MEDCoupling
     "_MapOfRequestStruct".
     That structure RequestStruct give the possibility to manage
     the structures MPI_Request and MPI_Status * of MPI. It give
-    also the possibility to get informations about that request :
+    also the possibility to get information about that request :
     target, send/recv, tag, [a]synchronous, type, outcount.
 
     . That identifier is used to control an asynchronous request
@@ -290,7 +290,7 @@ namespace MEDCoupling
   {
     int size = 0;
     for (int i = 0 ; i < _processor_group_size ; i++ )
-      size += _send_requests[ i ].size() ;
+      size += (int)_send_requests[ i ].size() ;
     return size ;
   }
 
@@ -315,7 +315,7 @@ namespace MEDCoupling
   {
     int size = 0 ;
     for (int i = 0 ; i < _processor_group_size ; i++ )
-      size += _recv_requests[ i ].size() ;
+      size += (int)_recv_requests[ i ].size() ;
     return size ;
   }
 
@@ -344,7 +344,7 @@ namespace MEDCoupling
     list< int >::const_iterator iter ;
     for (iter = _send_requests[ destrank ].begin() ; iter != _send_requests[destrank].end() ; iter++ )
       ArrayOfSendRequests[i++] = *iter ;
-    return _send_requests[destrank].size() ;
+    return (int)_send_requests[destrank].size() ;
   }
 
   // Returns in ArrayOfRecvRequests with the dimension "size" all the
@@ -358,7 +358,7 @@ namespace MEDCoupling
     _recv_requests[ sourcerank ] ;
     for (iter = _recv_requests[ sourcerank ].begin() ; iter != _recv_requests[sourcerank].end() ; iter++ )
       ArrayOfRecvRequests[i++] = *iter ;
-    return _recv_requests[sourcerank].size() ;
+    return (int)_recv_requests[sourcerank].size() ;
   }
 
   // Send in synchronous mode count values of type datatype from buffer to target
@@ -391,7 +391,7 @@ namespace MEDCoupling
   // Receive (read) in synchronous mode count values of type datatype in buffer from source
   // (returns RequestId identifier even if the corresponding structure is deleted :
   // it is only in order to have the same signature as the asynchronous mode)
-  // The output argument OutCount is optionnal : *OutCount <= count
+  // The output argument OutCount is optional : *OutCount <= count
   int MPIAccess::recv(void* buffer, int count, MPI_Datatype datatype, int source, int &RequestId, int *OutCount)
   {
     int sts = MPI_SUCCESS ;
@@ -407,8 +407,8 @@ namespace MEDCoupling
         int outcount = 0 ;
         if ( sts == MPI_SUCCESS )
           {
-            MPI_Datatype datatype = MPIDatatype( RequestId ) ;
-            _comm_interface.getCount(MPIStatus( RequestId ), datatype, &outcount ) ;
+            MPI_Datatype datatype2 = MPIDatatype( RequestId ) ;
+            _comm_interface.getCount(MPIStatus( RequestId ), datatype2, &outcount ) ;
             setMPIOutCount( RequestId , outcount ) ;
             setMPICompleted( RequestId , true ) ;
             deleteStatus( RequestId ) ;
@@ -1003,7 +1003,7 @@ namespace MEDCoupling
     return _comm_interface.requestFree( request ) ;
   }
   
-  // Print all informations of all known requests for debugging purpose
+  // Print all information of all known requests for debugging purpose
   void MPIAccess::check() const
   {
     int i = 0 ;
@@ -1052,6 +1052,14 @@ namespace MEDCoupling
     return aextent ;
   }
 
+  // Returns the MPI size of a MPI_LONG
+  MPI_Aint MPIAccess::longExtent() const
+  {
+    MPI_Aint aextent, lbound ;
+    MPI_Type_get_extent( MPI_LONG , &lbound, &aextent ) ;
+    return aextent ;
+  }
+
   // Returns the MPI size of a MPI_DOUBLE
   MPI_Aint MPIAccess::doubleExtent() const
   {