Salome HOME
MPIAccessDEC tests cleanup.
authorabn <adrien.bruneton@cea.fr>
Thu, 22 Oct 2015 13:22:14 +0000 (15:22 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 22 Oct 2015 13:22:14 +0000 (15:22 +0200)
src/ParaMEDMEM/MPIAccessDEC.cxx
src/ParaMEDMEMTest/MPIAccessDECTest.hxx
src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx
src/ParaMEDMEMTest/test_AllToAllDEC.cxx
src/ParaMEDMEMTest/test_AllToAllTimeDEC.cxx
src/ParaMEDMEMTest/test_AllToAllvDEC.cxx
src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx
src/ParaMEDMEMTest/test_AllToAllvTimeDoubleDEC.cxx

index 942dc79d88961381bfb8490722ef89344d85defe..f8a0e1002c8183278f8227aaaaf6b4a3bb0e77a2 100644 (file)
@@ -902,10 +902,13 @@ namespace ParaMEDMEM
       {
         if ( WithWait )
           {
-            cout << "CheckSent" << _my_rank << " " << i << "./" << nSendRequest
-                 << " SendRequestId " << ArrayOfSendRequests[i] << " MPITarget "
-                 << _MPI_access->MPITarget(ArrayOfSendRequests[i]) << " MPITag "
-                 << _MPI_access->MPITag(ArrayOfSendRequests[i]) << " Wait :" << endl ;
+            if (SendTrace)
+              {
+                cout << "CheckSent" << _my_rank << " " << i << "./" << nSendRequest
+                    << " SendRequestId " << ArrayOfSendRequests[i] << " MPITarget "
+                    << _MPI_access->MPITarget(ArrayOfSendRequests[i]) << " MPITag "
+                    << _MPI_access->MPITag(ArrayOfSendRequests[i]) << " Wait :" << endl ;
+              }
             sts = _MPI_access->wait( ArrayOfSendRequests[i] ) ;
           }
         else
index 80655b5656e3b85dfdef6a23a34ae260bc3ef1d6..5afb6e5d7bc02881bc2f05e7b724ae3d585e3eec 100644 (file)
 #include <iostream>
 #include "mpi.h"
 
+// (ABN]: too many text output in the MPIAccesTest - this renders
+// the analysis complicated:
+#define MPI_ACCESS_VERBOSE 0
+#define debugStream \
+    if (!MPI_ACCESS_VERBOSE) {} \
+    else std::cout
 
 class MPIAccessDECTest : public CppUnit::TestFixture
 {
index 2350a88c852a9df26cc0a1cced902225276dff12..9ca93d3d69541f0d7b56f59ea608583b3e7ff280 100644 (file)
@@ -1910,6 +1910,10 @@ void ParaMEDMEMTest::testInterpKernelDECPartialProcs()
   delete target_group;
   delete source_group;
   delete dec;
+  if(partialComm != MPI_COMM_NULL)
+    comm.commFree(&partialComm);
+  comm.groupFree(&grp);
+  comm.groupFree(&group_world);
   MPI_Barrier(MPI_COMM_WORLD);
 }
 
index f5e702845b75dadcfc2b69ce40e1f25b60fae309..7b082560739825e2b26f021195bbf3c2987e3012 100644 (file)
@@ -48,14 +48,14 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
     mpi_access.errorString(sts, msgerr, &lenerr) ;
-    cout << "test" << myrank << " lenerr " << lenerr << " "
+    debugStream << "test" << myrank << " lenerr " << lenerr << " "
          << msgerr << endl ;
     ostringstream strstream ;
     strstream << "===========================================================" << endl
               << "test_AllToAllDEC" << myrank << " KO" << endl
               << "==========================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   return ;
@@ -63,7 +63,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
 
 void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
 
-  cout << "test_AllToAllDEC" << endl ;
+  debugStream << "test_AllToAllDEC" << endl ;
 
   //  MPI_Init(&argc, &argv) ; 
 
@@ -79,11 +79,11 @@ void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
               << " (nbprocs >=2)" << endl
               << "test must be runned with more than 1 proc and less than 12 procs"
               << endl ;
-    cout << strstream.str() << endl ;
+    cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
-  cout << "test_AllToAllDEC" << myrank << endl ;
+  debugStream << "test_AllToAllDEC" << myrank << endl ;
 
   ParaMEDMEM::CommInterface interface ;
   std::set<int> sourceprocs;
@@ -133,7 +133,7 @@ void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
   }
 
   int nSendReq = mpi_access->sendRequestIdsSize() ;
-  cout << "test_AllToAllDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+  debugStream << "test_AllToAllDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
        << endl ;
   if ( nSendReq ) {
     int *ArrayOfSendRequests = new int[nSendReq] ;
@@ -147,11 +147,11 @@ void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
     ostringstream strstream ;
     strstream << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
               << " RecvRequests # 0 Error" << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   else {
-    cout << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
+    debugStream << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
          << " RecvRequests = 0 OK" << endl ;
   }
 
@@ -164,7 +164,7 @@ void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
 
   //  MPI_Finalize();
 
-  cout << "test_AllToAllDEC" << myrank << " OK" << endl ;
+  debugStream << "test_AllToAllDEC" << myrank << " OK" << endl ;
 
   return ;
 }
index a46114e8c8aee5ea285e5827ac73cc5926526327..2f50e66a083bee0f12661710f0dedab22692cb84 100644 (file)
@@ -53,14 +53,14 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
     mpi_access->errorString(sts, msgerr, &lenerr) ;
-    cout << "test_AllToAllTimeDEC" << myrank << " lenerr " << lenerr << " "
+    debugStream << "test_AllToAllTimeDEC" << myrank << " lenerr " << lenerr << " "
          << msgerr << endl ;
     ostringstream strstream ;
     strstream << "==========================================================="
               << "test_AllToAllTimeDEC" << myrank << " KO"
               << "==========================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   return ;
@@ -68,7 +68,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
 
 void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
 
-  cout << "test_AllToAllTimeDEC" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << endl ;
 
   //  MPI_Init(&argc, &argv) ; 
 
@@ -84,13 +84,13 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
               << " (nbprocs >=2)" << endl
               << "test must be runned with more than 1 proc and less than 12 procs"
               << endl ;
-    cout << strstream.str() << endl ;
+    cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
   //  int Asynchronous = atoi(argv[1]);
 
-  cout << "test_AllToAllTimeDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
 
   ParaMEDMEM::CommInterface interface ;
   std::set<int> sourceprocs;
@@ -113,9 +113,9 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
   MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
   MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
 
-  cout << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
-  cout << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
   
 #define maxproc 11
 #define maxreq 10000
@@ -141,7 +141,7 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
       //       MyMPIAccessDEC->NextTime( nextdeltatime ) ;
     }
     MyMPIAccessDEC->setTime( time , nextdeltatime ) ;
-    cout << "test_AllToAllTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
+    debugStream << "test_AllToAllTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
          << nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ; 
     int * sendbuf = new int[datamsglength*size] ;
     //     int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;
@@ -156,13 +156,13 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
                                             recvbuf, recvcount , MPI_INT ) ;
     chksts( sts , myrank , mpi_access ) ;
 
-    //     cout << "test_AllToAllTimeDEC" << myrank << " recvbuf before CheckSent" ;
+    //     debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf before CheckSent" ;
     //     for ( i = 0 ; i < datamsglength*size ; i++ ) {
-    //        cout << " " << recvbuf[i] ;
+    //        debugStream << " " << recvbuf[i] ;
     //     }
-    //     cout << endl ;
+    //     debugStream << endl ;
 
-    //     cout << "test_AllToAllTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
+    //     debugStream << "test_AllToAllTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
     //     MyMPIAccessDEC->CheckSent() ;
 
     int nRecvReq = mpi_access->recvRequestIdsSize() ;
@@ -176,22 +176,22 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
       int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
       mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
       delete [] ArrayOfRecvRequests ;
-      cout << strstream.str() << endl ;
+      debugStream << strstream.str() << endl ;
       CPPUNIT_FAIL( strstream.str() ) ;
     }
 
-    //     cout << "test_AllToAllTimeDEC" << myrank << " recvbuf" << endl ;
+    //     debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf" << endl ;
     bool badrecvbuf = false ;
     for ( i = 0 ; i < datamsglength*size ; i++ ) {
       if ( recvbuf[i] != (i/datamsglength)*1000000 + myrank*1000 +
            myrank*datamsglength+(i%datamsglength) ) {
         badrecvbuf = true ;
-        cout << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
+        debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
              << recvbuf[i] << " # " << (i/datamsglength)*1000000 + myrank*1000 +
           myrank*datamsglength+(i%datamsglength) << endl ;
       }
       else if ( badrecvbuf ) {
-        cout << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
+        debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
              << recvbuf[i] << " == " << (i/datamsglength)*1000000 + myrank*1000 +
           myrank*datamsglength+(i%datamsglength) << endl ;
       }
@@ -202,13 +202,13 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
                 << "test_AllToAllTimeDEC" << myrank << " badrecvbuf"
                 << endl << "============================================================="
                 << endl ;
-      cout << strstream.str() << endl ;
+      debugStream << strstream.str() << endl ;
       CPPUNIT_FAIL( strstream.str() ) ;
     }
     delete [] recvbuf ;
   }
 
-  cout << "test_AllToAllTimeDEC" << myrank << " final CheckSent" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " final CheckSent" << endl ;
   sts = MyMPIAccessDEC->checkSent() ;
   if ( sts != MPI_SUCCESS ) {
     ostringstream strstream ;
@@ -216,12 +216,12 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
               << "test_AllToAllTimeDEC" << myrank << " final CheckSent ERROR"
               << endl << "================================================================"
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
   int nSendReq = mpi_access->sendRequestIdsSize() ;
-  cout << "test_AllToAllTimeDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+  debugStream << "test_AllToAllTimeDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
        << endl ;
   if ( nSendReq ) {
     int *ArrayOfSendRequests = new int[nSendReq] ;
@@ -238,17 +238,17 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
               << " RecvRequests # 0 Error"
               << endl << "==============================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   else {
-    cout << "test_AllToAllTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
+    debugStream << "test_AllToAllTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
          << " RecvRequests = 0 OK" << endl ;
   }
 
-  cout << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
-  cout << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
 
   delete sourcegroup ;
   delete targetgroup ;
@@ -257,7 +257,7 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
 
   //  MPI_Finalize();
 
-  cout << "test_AllToAllTimeDEC" << myrank << " OK" << endl ;
+  debugStream << "test_AllToAllTimeDEC" << myrank << " OK" << endl ;
 
   return ;
 }
index f0ec8e292669eeb33a26605671d9826d2ee63093..490b40437fa8cf200f2fa8ded550b8ee83a231ee 100644 (file)
@@ -52,14 +52,14 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
     mpi_access.errorString(sts, msgerr, &lenerr) ;
-    cout << "test_AllToAllvDEC" << myrank << " lenerr " << lenerr << " "
+    debugStream << "test_AllToAllvDEC" << myrank << " lenerr " << lenerr << " "
          << msgerr << endl ;
     ostringstream strstream ;
     strstream << "==========================================================="
               << "test_AllToAllvDEC" << myrank << " KO"
               << "==========================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   return ;
@@ -67,7 +67,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
 
 void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
 
-  cout << "test_AllToAllvDEC" << endl ;
+  debugStream << "test_AllToAllvDEC" << endl ;
 
   //  MPI_Init(&argc, &argv) ; 
 
@@ -83,13 +83,13 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
               << " (nbprocs >=2)" << endl
               << "test must be runned with more than 1 proc and less than 12 procs"
               << endl ;
-    cout << strstream.str() << endl ;
+    cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
   //  int Asynchronous = atoi(argv[1]);
 
-  cout << "test_AllToAllvDEC" << myrank << endl ;
+  debugStream << "test_AllToAllvDEC" << myrank << endl ;
 
   ParaMEDMEM::CommInterface interface ;
   std::set<int> sourceprocs;
@@ -139,35 +139,35 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
     MyMPIAccessDEC->allToAllv( sendbuf, sendcounts , sdispls , MPI_INT ,
                                recvbuf, recvcounts , rdispls , MPI_INT ) ;
 
-    //    cout << "test_AllToAllvDEC" << myrank << " recvbuf before CheckSent" ;
+    //    debugStream << "test_AllToAllvDEC" << myrank << " recvbuf before CheckSent" ;
     //    for ( i = 0 ; i < datamsglength*size ; i++ ) {
-    //       cout << " " << recvbuf[i] ;
+    //       debugStream << " " << recvbuf[i] ;
     //    }
-    //    cout << endl ;
+    //    debugStream << endl ;
 
-    //    cout << "test_AllToAllvDEC" << myrank << " sendbuf " << sendbuf << endl ;
+    //    debugStream << "test_AllToAllvDEC" << myrank << " sendbuf " << sendbuf << endl ;
     //    MyMPIAccessDEC->CheckSent() ;
 
     int nRecvReq = mpi_access->recvRequestIdsSize() ;
-    //    cout << "test_AllToAllvDEC" << myrank << " WaitAllRecv " << nRecvReq << " Requests" << endl ;
+    //    debugStream << "test_AllToAllvDEC" << myrank << " WaitAllRecv " << nRecvReq << " Requests" << endl ;
     int *ArrayOfRecvRequests = new int[nRecvReq] ;
     int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
     mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
     mpi_access->deleteRequests( nReq , ArrayOfRecvRequests ) ;
     delete [] ArrayOfRecvRequests ;
 
-    //    cout << "test_AllToAllvDEC" << myrank << " recvbuf" ;
+    //    debugStream << "test_AllToAllvDEC" << myrank << " recvbuf" ;
     //    for ( i = 0 ; i < datamsglength*size ; i++ ) {
-    //       cout << " " << recvbuf[i] ;
+    //       debugStream << " " << recvbuf[i] ;
     //    }
-    //    cout << endl ;
+    //    debugStream << endl ;
   }
 
-  //  cout << "test_AllToAllvDEC" << myrank << " final CheckSent" << endl ;
+  //  debugStream << "test_AllToAllvDEC" << myrank << " final CheckSent" << endl ;
   //  MyMPIAccessDEC->CheckSent() ;
 
   int nSendReq = mpi_access->sendRequestIdsSize() ;
-  cout << "test_AllToAllvDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+  debugStream << "test_AllToAllvDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
        << endl ;
   if ( nSendReq ) {
     int *ArrayOfSendRequests = new int[nSendReq] ;
@@ -181,11 +181,11 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
     ostringstream strstream ;
     strstream << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
               << " RecvRequests # 0 Error" << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   else {
-    cout << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
+    debugStream << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
          << " RecvRequests = 0 OK" << endl ;
   }
 
@@ -202,7 +202,7 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
 
   //  MPI_Finalize();
 
-  cout << "test_AllToAllvDEC" << myrank << " OK" << endl ;
+  debugStream << "test_AllToAllvDEC" << myrank << " OK" << endl ;
 
   return ;
 }
index 78d8d47c0cf74e808e58a3ec1cececb30079d8ff..bd6f4b541303f8d4416f4857467e8bdbc04a9b7e 100644 (file)
@@ -57,14 +57,14 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
     mpi_access->errorString(sts, msgerr, &lenerr) ;
-    cout << "test_AllToAllvTimeDEC" << myrank << " lenerr " << lenerr << " "
+    debugStream << "test_AllToAllvTimeDEC" << myrank << " lenerr " << lenerr << " "
          << msgerr << endl ;
     ostringstream strstream ;
     strstream << "==========================================================="
               << "test_AllToAllvTimeDEC" << myrank << " KO"
               << "==========================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   return ;
@@ -72,7 +72,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
 
 void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINative ) {
 
-  cout << "test_AllToAllvTimeDEC" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << endl ;
 
   //  MPI_Init(&argc, &argv) ; 
 
@@ -88,7 +88,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
               << " (nbprocs >=2)" << endl
               << "test must be runned with more than 1 proc and less than 12 procs"
               << endl ;
-    cout << strstream.str() << endl ;
+    cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
@@ -98,7 +98,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
   //    UseMPI_Alltoallv = atoi(argv[2]) ;
   //  }
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
        << " UseMPI_Alltoallv " << UseMPI_Alltoallv << endl ;
 
   ParaMEDMEM::CommInterface interface ;
@@ -122,9 +122,9 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
   MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp , 0.5 ) ;
   MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
 
 #define maxproc 11
 #define maxreq 10000
@@ -174,7 +174,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
       //       MyMPIAccessDEC->NextTime( nextdeltatime ) ;
     }
     MyMPIAccessDEC->setTime( timeLoc , nextdeltatime ) ;
-    cout << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
+    debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
          << nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ; 
     int * sendbuf = new int[datamsglength*size] ;
     //     int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;
@@ -199,7 +199,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
                           aRecvTimeMessage, recvtimecounts , rtimedispls ,
                           mpi_access->timeType() , *comm ) ;
       //       for ( j = 0 ; j < size ; j++ ) {
-      //          cout << "test_AllToAllvTimeDEC" << myrank << " TimeMessage received " << j << " "
+      //          debugStream << "test_AllToAllvTimeDEC" << myrank << " TimeMessage received " << j << " "
       //               << aRecvTimeMessage[j] << endl ;
       //       }
       delete aSendTimeMessage ;
@@ -215,13 +215,13 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
       chksts( sts , myrank , mpi_access ) ;
     }
 
-    //     cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
+    //     debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
     //     for ( i = 0 ; i < datamsglength*size ; i++ ) {
-    //        cout << " " << recvbuf[i] ;
+    //        debugStream << " " << recvbuf[i] ;
     //     }
-    //     cout << endl ;
+    //     debugStream << endl ;
 
-    //     cout << "test_AllToAllvTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
+    //     debugStream << "test_AllToAllvTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
     //     MyMPIAccessDEC->CheckSent() ;
 
     int nRecvReq = mpi_access->recvRequestIdsSize() ;
@@ -235,11 +235,11 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
       int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
       mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
       delete [] ArrayOfRecvRequests ;
-      cout << strstream.str() << endl ;
+      debugStream << strstream.str() << endl ;
       CPPUNIT_FAIL( strstream.str() ) ;
     }
 
-    //     cout << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
+    //     debugStream << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
     bool badrecvbuf = false ;
     for ( i = 0 ; i < size ; i++ ) {
       int j ;
@@ -249,13 +249,13 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
           if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 +
                myrank*datamsglength+(index%datamsglength) ) {
             badrecvbuf = true ;
-            cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+            debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
                  << recvbuf[index] << " # " << (index/datamsglength)*1000000 +
               myrank*1000 +
               myrank*datamsglength+(index%datamsglength) << endl ;
           }
           else if ( badrecvbuf ) {
-            cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+            debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
                  << recvbuf[index] << " == " << (index/datamsglength)*1000000 +
               myrank*1000 +
               myrank*datamsglength+(index%datamsglength) << endl ;
@@ -263,7 +263,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
         }
         else if ( recvbuf[index] != -1 ) {
           badrecvbuf = true ;
-          cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+          debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
                << recvbuf[index] << " # -1" << endl ;
         }
       }
@@ -274,17 +274,17 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
                 << "test_AllToAllvTimeDEC" << myrank << " badrecvbuf"
                 << endl << "============================================================="
                 << endl ;
-      cout << strstream.str() << endl ;
+      debugStream << strstream.str() << endl ;
       CPPUNIT_FAIL( strstream.str() ) ;
     }
     delete [] recvbuf ;
   }
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " CheckFinalSent" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " CheckFinalSent" << endl ;
   sts = MyMPIAccessDEC->checkFinalSent() ;
   if ( sts != MPI_SUCCESS ) {
     ostringstream strstream ;
@@ -292,11 +292,11 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
               << "test_AllToAllvTimeDEC" << myrank << " final CheckSent ERROR"
               << endl << "================================================================"
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv" << endl ;
   sts = MyMPIAccessDEC->checkFinalRecv() ;
   if ( sts != MPI_SUCCESS ) {
     ostringstream strstream ;
@@ -304,7 +304,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
               << "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv ERROR"
               << endl << "================================================================"
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
@@ -316,22 +316,22 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
               << " RecvRequests # 0 Error"
               << endl << "==============================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   else {
-    cout << "test_AllToAllvTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
+    debugStream << "test_AllToAllvTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
          << " RecvRequests = 0 OK" << endl ;
   }
 
   time_t endtime = time(NULL) ;
-  cout << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime
        << " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
        << " calls to AllToAll" << endl ;
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
-  cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
 
   delete sourcegroup ;
   delete targetgroup ;
@@ -351,7 +351,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat
 
   endtime = time(NULL) ;
 
-  cout << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
+  debugStream << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
        << " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
        << " calls to AllToAll" << endl ;
 
index f69c4428576940a795482814871b8a21e62b41a5..01b7bd685df783551797e26b43d5b61741493423 100644 (file)
@@ -55,14 +55,14 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
   int lenerr ;
   if ( sts != MPI_SUCCESS ) {
     mpi_access->errorString(sts, msgerr, &lenerr) ;
-    cout << "test" << myrank << " lenerr " << lenerr << " "
+    debugStream << "test" << myrank << " lenerr " << lenerr << " "
          << msgerr << endl ;
     ostringstream strstream ;
     strstream << "==========================================================="
               << "test" << myrank << " KO"
               << "==========================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   return ;
@@ -70,7 +70,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access )
 
 void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
 
-  cout << "test_AllToAllvTimeDoubleDEC" << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << endl ;
 
 //  MPI_Init(&argc, &argv) ; 
 
@@ -86,13 +86,13 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
               << " (nbprocs >=2)" << endl
               << "test must be runned with more than 1 proc and less than 12 procs"
               << endl ;
-    cout << strstream.str() << endl ;
+    cerr << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
 //  int Asynchronous = atoi(argv[1]) ;
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
 
   ParaMEDMEM::CommInterface interface ;
   std::set<int> sourceprocs;
@@ -115,7 +115,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
   MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
   MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
 
 #define maxproc 11
@@ -170,34 +170,34 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
         }
      }
      MyMPIAccessDEC->setTime( timeLoc[myrank] , nextdeltatime[myrank] ) ;
-     cout << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME "
+     debugStream << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME "
           << nextdeltatime[myrank] << "=====MAXTIME " << maxtime[myrank] << " ======"
           << endl ; 
      double * sendbuf = new double[datamsglength*size] ;
 //     double * sendbuf = (double *) malloc(sizeof(double)*datamsglength*size) ;
      double * recvbuf = new double[datamsglength*size] ;
      int j ;
-     //cout << "test_AllToAllvTimeDoubleDEC" << myrank << " sendbuf" ;
+     //debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " sendbuf" ;
      for ( target = 0 ; target < size ; target++ ) {
         for ( j = 0 ; j < datamsglength ; j++ ) {
            //sendbuf[j] = myrank*10000 + (j/datamsglength)*100 + j ;
            sendbuf[target*datamsglength+j] = myrank*1000000 + target*10000 +
                                              (timeLoc[myrank]/deltatime[myrank])*100 + j ;
-           //cout << " " << (int ) sendbuf[target*datamsglength+j] ;
+           //debugStream << " " << (int ) sendbuf[target*datamsglength+j] ;
            recvbuf[target*datamsglength+j] = -1 ;
         }
-        //cout << endl ;
+        //debugStream << endl ;
      }
 
      int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE ,
                                             recvbuf, recvcounts , rdispls , MPI_DOUBLE ) ;
      chksts( sts , myrank , mpi_access ) ;
 
-//     cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf before CheckSent" ;
+//     debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf before CheckSent" ;
 //     for ( i = 0 ; i < datamsglength*size ; i++ ) {
-//        cout << " " << recvbuf[i] ;
+//        debugStream << " " << recvbuf[i] ;
 //     }
-//     cout << endl ;
+//     debugStream << endl ;
 
      int nRecvReq = mpi_access->recvRequestIdsSize() ;
      if ( nRecvReq != 0 ) {
@@ -211,11 +211,11 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
        int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
        mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
        delete [] ArrayOfRecvRequests ;
-       cout << strstream.str() << endl ;
+       debugStream << strstream.str() << endl ;
        CPPUNIT_FAIL( strstream.str() ) ;
      }
 
-//     cout << "test_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ;
+//     debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ;
      bool badrecvbuf = false ;
      for ( target = 0 ; target < size ; target++ ) {
         int j ;
@@ -225,21 +225,21 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
              if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 +
                   (timeLoc[target]/deltatime[target])*100 + j)) > 101) {
                badrecvbuf = true ;
-               cout << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] "
+               debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] "
                     << timeLoc[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index]
                     << " # " << (int ) (target*1000000 +
                        myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j)
                     << endl ;
              }
              else if ( badrecvbuf ) {
-               cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
+               debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
                     << recvbuf[index] << " ~= " << (int ) (target*1000000 +
                        myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ;
              }
            }
            else if ( recvbuf[index] != -1 ) {
              badrecvbuf = true ;
-             cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
+             debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
                   << recvbuf[index] << " # -1" << endl ;
            }
         }
@@ -250,16 +250,16 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
                  << "test_AllToAllvTimeDoubleDEC" << myrank << " badrecvbuf"
                  << endl << "=================================================================="
                  << endl ;
-       cout << strstream.str() << endl ;
+       debugStream << strstream.str() << endl ;
        CPPUNIT_FAIL( strstream.str() ) ;
      }
      delete [] recvbuf ;
   }
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent" << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent" << endl ;
   sts = MyMPIAccessDEC->checkFinalSent() ;
   if ( sts != MPI_SUCCESS ) {
     ostringstream strstream ;
@@ -267,11 +267,11 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
               << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent ERROR"
               << endl << "================================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv" << endl ;
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv" << endl ;
   sts = MyMPIAccessDEC->checkFinalRecv() ;
   if ( sts != MPI_SUCCESS ) {
     ostringstream strstream ;
@@ -279,7 +279,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
               << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv ERROR"
               << endl << "================================================================"
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
 
@@ -291,20 +291,20 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
               << " RecvRequests # 0 Error"
               << endl << "==============================================================="
               << endl ;
-    cout << strstream.str() << endl ;
+    debugStream << strstream.str() << endl ;
     CPPUNIT_FAIL( strstream.str() ) ;
   }
   else {
-    cout << "test_AllToAllvTimeDoubleDEC" << myrank << " RecvRequestIds " << nRecvReq
+    debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " RecvRequestIds " << nRecvReq
          << " RecvRequests = 0 OK" << endl ;
   }
 
   time_t endtime = time(NULL) ;
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime
        << " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
        << " calls to AllToAll" << endl ;
 
-  cout << "test" << myrank << " Barrier :" << endl ;
+  debugStream << "test" << myrank << " Barrier :" << endl ;
   mpi_access->barrier() ;
 
   delete sourcegroup ;
@@ -325,7 +325,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
 
   endtime = time(NULL) ;
 
-  cout << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
+  debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
        << " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
        << " calls to AllToAll" << endl ;