Salome HOME
Update tests for Fedora-24 and Ubuntu-16.04
[tools/medcoupling.git] / src / ParaMEDMEM / MPIAccess.cxx
index b7fe80393e94e8ebd1f7cc94f17f9e012cdd010f..65e903676fd0e7ca6fcd65d6fe03c8699de204fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  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
@@ -24,7 +24,7 @@
 
 using namespace std;
 
-namespace ParaMEDMEM
+namespace MEDCoupling
 {
   /**!
     \anchor MPIAccess-det
@@ -49,14 +49,14 @@ namespace ParaMEDMEM
     {
     //initialization
     MPI_Init(&argc, &argv);
-    ParaMEDMEM::CommInterface comm_interface;
+    MEDCoupling::CommInterface comm_interface;
 
     //setting up a processor group with proc 0
     set<int> procs;
     procs.insert(0);
-    ParaMEDMEM::ProcessorGroup group(procs, comm_interface);
+    MEDCoupling::ProcessorGroup group(procs, comm_interface);
 
-    ParaMEDMEM::MPIAccess mpi_access(group);
+    MEDCoupling::MPIAccess mpi_access(group);
 
     //cleanup
     MPI_Finalize();
@@ -137,7 +137,7 @@ namespace ParaMEDMEM
     array_of_displacements[0] = 0 ;
     array_of_displacements[1] = sizeof(double) ;
     array_of_displacements[2] = 2*sizeof(double) ;
-    MPI_Type_struct(3, array_of_blocklengths, array_of_displacements,
+    MPI_Type_create_struct(3, array_of_blocklengths, array_of_displacements,
                     array_of_types, &_MPI_TIME) ;
     MPI_Type_commit(&_MPI_TIME) ;
   }
@@ -788,7 +788,7 @@ namespace ParaMEDMEM
         source = aMPIStatus.MPI_SOURCE ;
         MPITag = aMPIStatus.MPI_TAG ;
         int MethodId = (MPITag % MODULO_TAG) ;
-        myDatatype = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
+        myDatatype = datatype( (MEDCoupling::_MessageIdent) MethodId ) ;
         _comm_interface.getCount(&aMPIStatus, myDatatype, &outcount ) ;
         if ( _trace )
           cout << "MPIAccess::Probe" << _my_rank << " FromSource " << FromSource
@@ -822,7 +822,7 @@ namespace ParaMEDMEM
         source = aMPIStatus.MPI_SOURCE ;
         MPITag = aMPIStatus.MPI_TAG ;
         int MethodId = (MPITag % MODULO_TAG) ;
-        myDataType = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
+        myDataType = datatype( (MEDCoupling::_MessageIdent) MethodId ) ;
         _comm_interface.getCount(&aMPIStatus, myDataType, &outcount ) ;
         if ( _trace )
           cout << "MPIAccess::IProbe" << _my_rank << " FromSource " << FromSource
@@ -865,9 +865,9 @@ namespace ParaMEDMEM
   int MPIAccess::cancel( int source, int theMPITag, MPI_Datatype datatype, int outcount, int &flag )
   {
     int sts ;
-    MPI_Aint extent ;
+    MPI_Aint extent, lbound ;
     flag = 0 ;
-    sts =  MPI_Type_extent( datatype , &extent ) ;
+    sts =  MPI_Type_get_extent( datatype , &lbound, &extent ) ;
     if ( sts == MPI_SUCCESS )
       {
         void * recvbuf = malloc( extent*outcount ) ;
@@ -1039,24 +1039,24 @@ namespace ParaMEDMEM
   // Returns the MPI size of a TimeMessage
   MPI_Aint MPIAccess::timeExtent() const
   {
-    MPI_Aint aextent ;
-    MPI_Type_extent( _MPI_TIME , &aextent ) ;
+    MPI_Aint aextent, lbound ;
+    MPI_Type_get_extent( _MPI_TIME , &lbound, &aextent ) ;
     return aextent ;
   }
 
   // Returns the MPI size of a MPI_INT
   MPI_Aint MPIAccess::intExtent() const
   {
-    MPI_Aint aextent ;
-    MPI_Type_extent( MPI_INT , &aextent ) ;
+    MPI_Aint aextent, lbound ;
+    MPI_Type_get_extent( MPI_INT , &lbound, &aextent ) ;
     return aextent ;
   }
 
   // Returns the MPI size of a MPI_DOUBLE
   MPI_Aint MPIAccess::doubleExtent() const
   {
-    MPI_Aint aextent ;
-    MPI_Type_extent( MPI_DOUBLE , &aextent ) ;
+    MPI_Aint aextent, lbound ;
+    MPI_Type_get_extent( MPI_DOUBLE , &lbound, &aextent ) ;
     return aextent ;
   }