Salome HOME
Adapt for C++17
[tools/medcoupling.git] / src / ParaMEDMEMTest / test_AllToAllvTimeDEC.cxx
index bd6f4b541303f8d4416f4857467e8bdbc04a9b7e..a35a1117a1e871e1b763f95a6350412ef1bf60b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  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
@@ -40,7 +40,7 @@
 #define ENABLE_FORCED_FAILURES
 
 using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 void MPIAccessDECTest::test_AllToAllvTimeDECSynchronousNative() {
   test_AllToAllvTimeDEC( false , true ) ;
@@ -52,7 +52,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDECAsynchronousPointToPoint() {
   test_AllToAllvTimeDEC( true , false ) ;
 }
 
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess * mpi_access ) {
   char msgerr[MPI_MAX_ERROR_STRING] ;
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
@@ -86,7 +86,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
     strstream << "usage :" << endl
               << "mpirun -np <nbprocs> test_AllToAllTimeDEC" << endl
               << " (nbprocs >=2)" << endl
-              << "test must be runned with more than 1 proc and less than 12 procs"
+              << "test must be run with more than 1 proc and less than 12 procs"
               << endl ;
     cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
@@ -101,7 +101,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
   debugStream << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
        << " UseMPI_Alltoallv " << UseMPI_Alltoallv << endl ;
 
-  ParaMEDMEM::CommInterface interface ;
+  MEDCoupling::CommInterface interface ;
   std::set<int> sourceprocs;
   std::set<int> targetprocs;
   int i ;
@@ -112,8 +112,8 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
     targetprocs.insert(i);
   }
 
-  ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
-  ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+  MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+  MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
 
   //  TimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
   MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
@@ -174,7 +174,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
       //       MyMPIAccessDEC->NextTime( nextdeltatime ) ;
     }
     MyMPIAccessDEC->setTime( timeLoc , nextdeltatime ) ;
-    debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
+    debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << timeLoc << "=====DELTATIME "
          << nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ; 
     int * sendbuf = new int[datamsglength*size] ;
     //     int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;
@@ -210,9 +210,9 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
       delete [] sendbuf ;
     }
     else {
-      int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT ,
+      int sts2 = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT ,
                                                recvbuf, recvcounts , rdispls , MPI_INT ) ;
-      chksts( sts , myrank , mpi_access ) ;
+      chksts( sts2 , myrank , mpi_access ) ;
     }
 
     //     debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
@@ -242,10 +242,9 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
     //     debugStream << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
     bool badrecvbuf = false ;
     for ( i = 0 ; i < size ; i++ ) {
-      int j ;
-      for ( j = 0 ; j < datamsglength ; j++ ) {
-        int index = i*datamsglength+j ;
-        if ( j < recvcounts[i] ) {
+      for ( int jj = 0 ; jj < datamsglength ; jj++ ) {
+        int index = i*datamsglength+jj ;
+        if ( jj < recvcounts[i] ) {
           if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 +
                myrank*datamsglength+(index%datamsglength) ) {
             badrecvbuf = true ;