From: abn Date: Wed, 21 Oct 2015 14:33:50 +0000 (+0200) Subject: Introducing CMake test for ParaMEDMEM. Making MPI_Access tests X-Git-Tag: V8_0_pre~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8b587c9a8c1441b6ab085865f6d02a5e2974bdf;p=modules%2Fmed.git Introducing CMake test for ParaMEDMEM. Making MPI_Access tests much less verbose by default. --- diff --git a/src/ParaMEDMEMTest/CMakeLists.txt b/src/ParaMEDMEMTest/CMakeLists.txt index d31e6f4f5..513031360 100644 --- a/src/ParaMEDMEMTest/CMakeLists.txt +++ b/src/ParaMEDMEMTest/CMakeLists.txt @@ -111,6 +111,21 @@ FOREACH(bintestparamem ${TESTSParaMEDMEM}) TARGET_LINK_LIBRARIES(${bintestparamem} ParaMEDMEMTest) ENDFOREACH(bintestparamem ${TESTSParaMEDMEM}) +# Now add CMake tests - test_perf, ParaMEDMEMTestMPI2_1 and ParaMEDMEMTestMPI2_2 +# are left aside, as they are too specific +# +# -- some tests require 2, 3, 4 or 5 procs -- +ADD_TEST(NAME TestParaMEDMEM_Proc2 COMMAND ${MPIEXEC} -np 2 $) +ADD_TEST(NAME TestParaMEDMEM_Proc3 COMMAND ${MPIEXEC} -np 3 $) +ADD_TEST(NAME TestParaMEDMEM_Proc4 COMMAND ${MPIEXEC} -np 4 $) +ADD_TEST(NAME TestParaMEDMEM_Proc5 COMMAND ${MPIEXEC} -np 5 $) + +ADD_TEST(NAME TestMPIAccess_Proc2 COMMAND ${MPIEXEC} -np 2 $) +ADD_TEST(NAME TestMPIAccess_Proc3 COMMAND ${MPIEXEC} -np 3 $) + +ADD_TEST(NAME TestMPIAccessDEC_Proc4 COMMAND ${MPIEXEC} -np 4 $) + +# Installation rules INSTALL(TARGETS ${TESTSParaMEDMEM} DESTINATION ${SALOME_INSTALL_BINS}) SET(COMMON_HEADERS_HXX MPIMainTest.hxx diff --git a/src/ParaMEDMEMTest/MPIAccessTest.hxx b/src/ParaMEDMEMTest/MPIAccessTest.hxx index 07d704819..f98fb5578 100644 --- a/src/ParaMEDMEMTest/MPIAccessTest.hxx +++ b/src/ParaMEDMEMTest/MPIAccessTest.hxx @@ -27,6 +27,12 @@ #include #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 MPIAccessTest : public CppUnit::TestFixture { diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx index 133a2c658..8b26823f6 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx @@ -47,7 +47,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Cancel() { - cout << "test_MPI_Access_Cancel" << endl ; + debugStream << "test_MPI_Access_Cancel" << endl ; // MPI_Init(&argc, &argv) ; @@ -59,11 +59,12 @@ void MPIAccessTest::test_MPI_Access_Cancel() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_Cancel must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_Cancel" << myrank << endl ; + debugStream << "test_MPI_Access_Cancel" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -85,20 +86,20 @@ void MPIAccessTest::test_MPI_Access_Cancel() { int i , j ; for ( j = 0 ; j < 3 ; j++ ) { for ( i = 0 ; i < 10 ; i++ ) { - cout << "test" << myrank << " ============================ i " << i + debugStream << "test" << myrank << " ============================ i " << i << "============================" << endl ; if ( myrank == 0 ) { if ( i < 5 ) { intsendbuf[i] = i ; sts = mpi_access.ISend(&intsendbuf[i],1,MPI_INT,target, RequestId[i]) ; - cout << "test" << myrank << " Send MPI_INT RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send MPI_INT RequestId " << RequestId[i] << endl ; } else { doublesendbuf[i] = i ; sts = mpi_access.ISend(&doublesendbuf[i],1,MPI_DOUBLE,target, RequestId[i]) ; - cout << "test" << myrank << " Send MPI_DOUBLE RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send MPI_DOUBLE RequestId " << RequestId[i] << endl ; } } @@ -110,12 +111,12 @@ void MPIAccessTest::test_MPI_Access_Cancel() { sts = mpi_access.IProbe(target, source, tag, datatype, outcount, flag ) ; if ( flag ) { - cout << "test" << myrank << " " << i << " IProbe target " << target + debugStream << "test" << myrank << " " << i << " IProbe target " << target << " source " << source << " tag " << tag << " outcount " << outcount << " flag " << flag << endl ; } else { - cout << "test" << myrank << " flag " << flag << endl ; + debugStream << "test" << myrank << " flag " << flag << endl ; sleep( 1 ) ; } if ( flag ) { @@ -134,10 +135,10 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << " recvbuf " << recvbuf << " KO" << endl << "======================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - cout << "========================================================" + debugStream << "========================================================" << endl << "test" << myrank << " outcount " << outcount << " recvbuf " << recvbuf << " OK" << endl << "========================================================" @@ -149,7 +150,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { ostringstream strstream ; @@ -157,16 +158,16 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << endl << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } if ( myrank != 0 ) { int iprobe ; for ( iprobe = 5 ; iprobe < 10 ; iprobe++ ) { - cout << "test" << myrank << " ============================ iprobe " + debugStream << "test" << myrank << " ============================ iprobe " << iprobe << "============================" << endl ; int source, tag, outcount ; MPI_Datatype datatype ; @@ -177,7 +178,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " IProbe iprobe " << iprobe + debugStream << "test" << myrank << " IProbe iprobe " << iprobe << " target " << target << " probeflag " << probeflag << " tag " << tag << " outcount " << outcount << " datatype " << datatype << " lenerr " << lenerr << " " << msgerr << endl ; @@ -188,18 +189,18 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << endl << "==========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } if ( !probeflag ) { - //cout << "========================================================" + //debugStream << "========================================================" // << endl << "test" << myrank << " IProbe KO(OK) iprobe " << iprobe // << " probeflag " << probeflag << endl // << "========================================================" // << endl ; } else { - cout << "test" << myrank << " " << iprobe << " IProbe target " + debugStream << "test" << myrank << " " << iprobe << " IProbe target " << target << " source " << source << " tag " << tag << " outcount " << outcount << " probeflag " << probeflag << endl ; @@ -209,7 +210,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << endl << "test" << myrank << " MPI_DOUBLE KO" << endl << "========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { @@ -217,7 +218,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { sts = mpi_access.cancel( source, tag, datatype, outcount, flag ) ; if ( sts != MPI_SUCCESS || !flag ) { mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "======================================================" + debugStream << "======================================================" << endl << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl << "test" << myrank << " Cancel PendingIrecv KO flag " << flag << " iprobe " @@ -227,7 +228,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { //return 1 ; } else { - cout << "======================================================" + debugStream << "======================================================" << endl << "test" << myrank << " Cancel PendingIrecv OK RequestId " << " flag " << flag << " iprobe " << iprobe << endl @@ -238,12 +239,12 @@ void MPIAccessTest::test_MPI_Access_Cancel() { int Reqtarget, Reqtag, Reqerror, Reqoutcount ; mpi_access.status( RequestId[iprobe], Reqtarget, Reqtag, Reqerror, Reqoutcount, true ) ; - cout << "test" << myrank << " Status Reqtarget "<< Reqtarget + debugStream << "test" << myrank << " Status Reqtarget "<< Reqtarget << " Reqtag " << Reqtag << " Reqoutcount " << Reqoutcount << endl ; int Reqflag ; sts = mpi_access.cancel( RequestId[iprobe] , Reqflag ) ; - cout << "test" << myrank << " " << iprobe + debugStream << "test" << myrank << " " << iprobe << " Cancel Irecv done Reqtarget " << Reqtarget << " Reqtag " << Reqtag << " Reqoutcount " << Reqoutcount << " Reqflag " << Reqflag << endl ; @@ -257,11 +258,11 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << iprobe << endl << "========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "========================================================" + debugStream << "========================================================" << endl << "test" << myrank << " Cancel Irecv OK RequestId " << RequestId[iprobe] << " Reqflag " << Reqflag << " iprobe " << iprobe << endl @@ -283,7 +284,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS || flag ) { ostringstream strstream ; @@ -293,7 +294,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { << " source " << source << " tag " << tag << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } @@ -304,10 +305,10 @@ void MPIAccessTest::test_MPI_Access_Cancel() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; mpi_access.barrier() ; @@ -315,7 +316,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_ISend_IRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_ISend_IRecv.cxx index ef785ab0f..00ce3e69c 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_ISend_IRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_ISend_IRecv.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { - cout << "test_MPI_Access_Cyclic_ISend_IRecv" << endl ; + debugStream << "test_MPI_Access_Cyclic_ISend_IRecv" << endl ; // MPI_Init(&argc, &argv) ; @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 3 ) { - cout << "test_MPI_Access_Cyclic_ISend_IRecv must be runned with 3 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_Cyclic_ISend_IRecv must be runned with 3 procs") ; + cerr << "test_MPI_Access_Cyclic_ISend_IRecv must be runned with 3 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_Cyclic_ISend_IRecv must be runned with 3 procs") ; + return; } - cout << "test_MPI_Access_Cyclic_ISend_IRecv" << myrank << endl ; + debugStream << "test_MPI_Access_Cyclic_ISend_IRecv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -84,19 +85,19 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { sendbuf[i] = i ; sts = mpi_access.ISend(&sendbuf[i],1,MPI_INT,alltarget[myrank], SendRequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " Send RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } for ( i = 0 ; i < maxsend ; i++ ) { recvbuf[i] = -1 ; sts = mpi_access.IRecv(&recvbuf[i],1,MPI_INT,allsource[myrank], RecvRequestId[i]) ; - cout << "test" << myrank << " Recv RequestId " << RecvRequestId[i] + debugStream << "test" << myrank << " Recv RequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(allsource[myrank]) << endl ; char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -105,34 +106,34 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } int j ; for (j = 0 ; j <= i ; j++) { int flag ; if ( j < i ) { - cout << "test" << myrank << " " << j << " -> Test-Send("<< SendRequestId[j] + debugStream << "test" << myrank << " " << j << " -> Test-Send("<< SendRequestId[j] << ")" << endl ; mpi_access.test( SendRequestId[j], flag ) ; if ( flag ) { int target, tag, error, outcount ; mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Send RequestId " << SendRequestId[j] << " target " << target << " tag " << tag << " error " << error << endl ; mpi_access.deleteRequest( SendRequestId[j] ) ; } } - cout << "test" << myrank << " " << j << " -> Test-Recv("<< SendRequestId[j] + debugStream << "test" << myrank << " " << j << " -> Test-Recv("<< SendRequestId[j] << ")" << endl ; mpi_access.test( RecvRequestId[j], flag ) ; if ( flag ) { int source, tag, error, outcount ; mpi_access.status( RecvRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Recv RequestId" << j << " " + debugStream << "test" << myrank << " Recv RequestId" << j << " " << RecvRequestId[j] << " source " << source << " tag " << tag << " error " << error << " outcount " << outcount << endl ; if ( (outcount != 1) | (recvbuf[j] != j) ) { @@ -142,7 +143,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { << outcount << " recvbuf[ " << j << " ] " << recvbuf[j] << " KO" << endl << "=====================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -152,7 +153,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { sendbuf[i+1] = i + 1 ; sts = mpi_access.ISend(&sendbuf[i+1],1,MPI_INT,alltarget[myrank], SendRequestId[i+1]) ; - cout << "test" << myrank << " Send RequestId " << SendRequestId[i+1] + debugStream << "test" << myrank << " Send RequestId " << SendRequestId[i+1] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } } @@ -160,11 +161,11 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { sendbuf[i] = i ; sts = mpi_access.ISend(&sendbuf[i],1,MPI_INT,alltarget[myrank], SendRequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " Send RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -173,10 +174,10 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; @@ -186,18 +187,18 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { mpi_access.deleteRequests(maxsend,SendRequestId) ; mpi_access.waitAll(maxsend,RecvRequestId) ; mpi_access.deleteRequests(maxsend,RecvRequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; mpi_access.testAll(maxsend,SendRequestId,flag) ; if ( !flag ) { ostringstream strstream ; strstream << "=========================================================" << endl << "test" << myrank << " TestAllSendflag " << flag << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " TestAllSendflag " << flag << " OK" << endl << "=========================================================" << endl ; } @@ -207,11 +208,11 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { strstream << "=========================================================" << endl << "test" << myrank << " TestAllRecvflag " << flag << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " TestAllRecvflag " << flag << " OK" << endl << "=========================================================" << endl ; } @@ -224,16 +225,16 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; int source, tag, error, outcount ; mpi_access.status(sendrequests[0], source, tag, error, outcount, true) ; - cout << "test" << myrank << " RequestId " << sendrequests[0] + debugStream << "test" << myrank << " RequestId " << sendrequests[0] << " source " << source << " tag " << tag << " error " << error << " outcount " << outcount << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -245,11 +246,11 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -260,7 +261,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx index 21ee606e8..67c687f54 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx @@ -41,7 +41,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { - cout << "test_MPI_Access_Cyclic_Send_Recv" << endl ; + debugStream << "test_MPI_Access_Cyclic_Send_Recv" << endl ; // MPI_Init(&argc, &argv) ; @@ -51,11 +51,12 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 3 ) { - cout << "test_MPI_Access_Send_Recv must be runned with 3 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 3 procs") ; + cerr << "test_MPI_Access_Send_Recv must be runned with 3 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 3 procs") ; + return; } - cout << "test_MPI_Access_Cyclic_Send_Recv" << myrank << endl ; + debugStream << "test_MPI_Access_Cyclic_Send_Recv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -76,7 +77,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { int i = 0 ; if ( myrank == 0 ) { sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } for ( i = 0 ; i < 10 ; i++ ) { @@ -93,7 +94,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { } //int source, tag, error, outcount ; //mpi_access.Status( RequestId[i], source, tag, error, outcount, true) ; - cout << "test" << myrank << " Recv RequestId " << RequestId[i] + debugStream << "test" << myrank << " Recv RequestId " << RequestId[i] << " tag " << mpi_access.recvMPITag(allsource[myrank]) << " outcount " << outcount << endl ; if ( (outcount != 1) | (recvbuf != i) ) { @@ -103,26 +104,26 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { << outcount << " recvbuf " << recvbuf << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } if ( myrank == 0 ) { if ( i != 9 ) { int ii = i + 1 ; sts = mpi_access.send(&ii,1,MPI_INT,alltarget[myrank], RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } } else { sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ; } char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -131,10 +132,10 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; @@ -142,11 +143,11 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,RequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; int sendrequests[10] ; int sendreqsize = mpi_access.sendRequestIds( alltarget[myrank] , 10 , @@ -156,7 +157,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } int recvrequests[10] ; @@ -167,7 +168,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } @@ -177,7 +178,7 @@ void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx b/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx index 92fdcf2f2..5fd4c2d0c 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx @@ -47,7 +47,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_IProbe() { - cout << "test_MPI_Access_IProbe" << endl ; + debugStream << "test_MPI_Access_IProbe" << endl ; // MPI_Init(&argc, &argv) ; @@ -59,11 +59,12 @@ void MPIAccessTest::test_MPI_Access_IProbe() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_IProbe must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_IProbe" << myrank << endl ; + debugStream << "test_MPI_Access_IProbe" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -86,7 +87,7 @@ void MPIAccessTest::test_MPI_Access_IProbe() { if ( myrank == 0 ) { sendbuf[i] = i ; sts = mpi_access.ISend(&sendbuf[i],1,MPI_INT,target, RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << endl ; } else { @@ -96,12 +97,12 @@ void MPIAccessTest::test_MPI_Access_IProbe() { MPI_Datatype datatype ; sts = mpi_access.IProbe(target, source, tag, datatype, outcount, flag ) ; if ( flag ) { - cout << "test" << myrank << " " << i << " IProbe target " << target + debugStream << "test" << myrank << " " << i << " IProbe target " << target << " source " << source << " tag " << tag << " outcount " << outcount << " flag " << flag << endl ; } else { - cout << "test" << myrank << " IProbe flag " << flag << endl ; + debugStream << "test" << myrank << " IProbe flag " << flag << endl ; sleep( 1 ) ; } if ( flag ) { @@ -115,10 +116,10 @@ void MPIAccessTest::test_MPI_Access_IProbe() { << " recvbuf " << recvbuf << " KO" << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " outcount " << outcount << " recvbuf " << recvbuf << " OK" << endl << "===========================================================" @@ -129,7 +130,7 @@ void MPIAccessTest::test_MPI_Access_IProbe() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -138,10 +139,10 @@ void MPIAccessTest::test_MPI_Access_IProbe() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; mpi_access.testAll(10,RequestId,flag) ; @@ -151,10 +152,10 @@ void MPIAccessTest::test_MPI_Access_IProbe() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; mpi_access.barrier() ; @@ -162,7 +163,7 @@ void MPIAccessTest::test_MPI_Access_IProbe() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx index 07dcb41aa..126cc8eb7 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_ISendRecv() { - cout << "test_MPI_Access_ISendRecv" << endl ; + debugStream << "test_MPI_Access_ISendRecv" << endl ; // MPI_Init(&argc, &argv) ; @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 2 ) { - cout << "test_MPI_Access_ISendRecv must be runned with 2 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_ISendRecv must be runned with 2 procs") ; + cerr << "test_MPI_Access_ISendRecv must be runned with 2 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_ISendRecv must be runned with 2 procs") ; + return; } - cout << "test_MPI_Access_ISendRecv" << myrank << endl ; + debugStream << "test_MPI_Access_ISendRecv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -81,14 +82,14 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { sendbuf[i] = i ; sts = mpi_access.ISendRecv(&sendbuf[i],1,MPI_INT,target, SendRequestId[i], &recvbuf[i],1,MPI_INT,target, RecvRequestId[i]) ; - cout << "test" << myrank << " Send sendRequestId " << SendRequestId[i] + debugStream << "test" << myrank << " Send sendRequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << " recvRequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -97,34 +98,34 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } int j ; for (j = 0 ; j <= i ; j++) { int flag ; if ( j < i ) { - cout << "test" << myrank << " " << j << " -> Test-Send("<< SendRequestId[j] + debugStream << "test" << myrank << " " << j << " -> Test-Send("<< SendRequestId[j] << ")" << endl ; mpi_access.test( SendRequestId[j], flag ) ; if ( flag ) { int target, tag, error, outcount ; mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Send RequestId " << SendRequestId[j] << " target " << target << " tag " << tag << " error " << error << endl ; mpi_access.deleteRequest( SendRequestId[j] ) ; } } - cout << "test" << myrank << " " << j << " -> Test-Recv("<< SendRequestId[j] + debugStream << "test" << myrank << " " << j << " -> Test-Recv("<< SendRequestId[j] << ")" << endl ; mpi_access.test( RecvRequestId[j], flag ) ; if ( flag ) { int source, tag, error, outcount ; mpi_access.status( RecvRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Recv RequestId" << j << " " + debugStream << "test" << myrank << " Recv RequestId" << j << " " << RecvRequestId[j] << " source " << source << " tag " << tag << " error " << error << " outcount " << outcount << endl ; if ( (outcount != 1) | (recvbuf[j] != j) ) { @@ -134,15 +135,15 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { << outcount << " recvbuf[ " << j << " ] " << recvbuf[j] << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } } mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; @@ -153,7 +154,7 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } @@ -164,10 +165,10 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; int sendrequests[10] ; int sendreqsize = mpi_access.sendRequestIds( target , 10 , sendrequests ) ; @@ -176,11 +177,11 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -191,11 +192,11 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -206,7 +207,7 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx index 3498074df..baa3572c1 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_ISend_IRecv() { - cout << "test_MPI_Access_ISend_IRecv" << endl ; + debugStream << "test_MPI_Access_ISend_IRecv" << endl ; // MPI_Init(&argc, &argv) ; @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 2 ) { - cout << "test_MPI_Access_ISend_IRecv must be runned with 2 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_ISend_IRecv must be runned with 2 procs") ; + cerr << "test_MPI_Access_ISend_IRecv must be runned with 2 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_ISend_IRecv must be runned with 2 procs") ; + return; } - cout << "test_MPI_Access_ISend_IRecv" << myrank << endl ; + debugStream << "test_MPI_Access_ISend_IRecv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -83,12 +84,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { if ( myrank == 0 ) { sendbuf[i] = i ; sts = mpi_access.ISend(&sendbuf[i],1,MPI_INT,target, SendRequestId[i]) ; - cout << "test" << myrank << " ISend RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { sts = mpi_access.IRecv(&recvbuf[i],1,MPI_INT,target, RecvRequestId[i]) ; - cout << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] + debugStream << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; } int j ; @@ -105,14 +106,14 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { if ( myrank == 0 ) { mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] << ") : target " << target << " tag " << tag << " error " << error << " flag " << flag << endl ; } else { mpi_access.status( RecvRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Recv RequestId " + debugStream << "test" << myrank << " Test(Recv RequestId " << RecvRequestId[j] << ") : source " << source << " tag " << tag << " error " << error << " outcount " << outcount << " flag " << flag << endl ; @@ -123,11 +124,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { << outcount << " recvbuf " << recvbuf[j] << " KO" << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } //else { - // cout << "===========================================================" + // debugStream << "===========================================================" // << endl << "test" << myrank << " outcount " << outcount // << " RequestId " << RecvRequestId[j] << " recvbuf " // << recvbuf[j] << " OK" << endl @@ -140,7 +141,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -149,12 +150,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { mpi_access.waitAll(maxreq, SendRequestId) ; mpi_access.deleteRequests(maxreq, SendRequestId) ; @@ -163,7 +164,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { mpi_access.waitAll(maxreq, RecvRequestId) ; mpi_access.deleteRequests(maxreq, RecvRequestId) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int sendrequests[maxreq] ; @@ -174,15 +175,15 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; for ( i = 0 ; i < sendreqsize ; i++ ) { - cout << "test" << myrank << " sendrequests[ " << i << " ] = " + debugStream << "test" << myrank << " sendrequests[ " << i << " ] = " << sendrequests[i] << endl ; } CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -195,11 +196,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -211,7 +212,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx index 5bdf39a5f..820340197 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx @@ -43,7 +43,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { - cout << "test_MPI_Access_ISend_IRecv_BottleNeck" << endl ; + debugStream << "test_MPI_Access_ISend_IRecv_BottleNeck" << endl ; // MPI_Init(&argc, &argv) ; @@ -56,11 +56,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { ostringstream strstream ; strstream << "test_MPI_Access_ISend_IRecv_BottleNeck must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_ISend_IRecv_BottleNeck" << myrank << endl ; + debugStream << "test_MPI_Access_ISend_IRecv_BottleNeck" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -87,13 +88,13 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { if ( myrank == 0 ) { sendbuf[i] = i ; sts = mpi_access.ISend(sendbuf,i,MPI_INT,target, SendRequestId[i]) ; - cout << "test" << myrank << " ISend RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { //sleep( 1 ) ; sts = mpi_access.IRecv(recvbuf,i,MPI_INT,target, RecvRequestId[i]) ; - cout << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] + debugStream << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; int recvreqsize = mpi_access.recvRequestIdsSize() ; int * recvrequests = new int[ recvreqsize ] ; @@ -106,14 +107,14 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { int source, tag, error, outcount ; mpi_access.status( recvrequests[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Recv RequestId " + debugStream << "test" << myrank << " Test(Recv RequestId " << recvrequests[j] << ") : source " << source << " tag " << tag << " error " << error << " outcount " << outcount << " flag " << flag << " : DeleteRequest" << endl ; mpi_access.deleteRequest( recvrequests[j] ) ; } else { -// cout << "test" << myrank << " Test(Recv RequestId " +// debugStream << "test" << myrank << " Test(Recv RequestId " // << recvrequests[j] << ") flag " << flag << endl ; } } @@ -123,7 +124,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; } @@ -133,18 +134,18 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int size = mpi_access.sendRequestIdsSize() ; - cout << "test" << myrank << " before WaitAll sendreqsize " << size << endl ; + debugStream << "test" << myrank << " before WaitAll sendreqsize " << size << endl ; mpi_access.waitAll(maxreq, SendRequestId) ; size = mpi_access.sendRequestIdsSize() ; - cout << "test" << myrank << " after WaitAll sendreqsize " << size << endl ; + debugStream << "test" << myrank << " after WaitAll sendreqsize " << size << endl ; int * ArrayOfSendRequests = new int[ size ] ; int nSendRequest = mpi_access.sendRequestIds( size , ArrayOfSendRequests ) ; int i ; @@ -155,10 +156,10 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { } else { int size = mpi_access.recvRequestIdsSize() ; - cout << "test" << myrank << " before WaitAll recvreqsize " << size << endl ; + debugStream << "test" << myrank << " before WaitAll recvreqsize " << size << endl ; mpi_access.waitAll(maxreq, RecvRequestId) ; size = mpi_access.recvRequestIdsSize() ; - cout << "test" << myrank << " after WaitAll recvreqsize " << size << endl ; + debugStream << "test" << myrank << " after WaitAll recvreqsize " << size << endl ; int * ArrayOfRecvRequests = new int[ size ] ; int nRecvRequest = mpi_access.recvRequestIds( size , ArrayOfRecvRequests ) ; int i ; @@ -167,7 +168,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { } delete [] ArrayOfRecvRequests ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int sendrequests[maxreq] ; @@ -178,15 +179,15 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; for ( i = 0 ; i < sendreqsize ; i++ ) { - cout << "test" << myrank << " sendrequests[ " << i << " ] = " + debugStream << "test" << myrank << " sendrequests[ " << i << " ] = " << sendrequests[i] << endl ; } CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -199,11 +200,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -215,7 +216,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx index 16c575557..546f60a0f 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { - cout << "test_MPI_Access_ISend_IRecv_Length" << endl ; + debugStream << "test_MPI_Access_ISend_IRecv_Length" << endl ; // MPI_Init(&argc, &argv) ; @@ -54,11 +54,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_ISend_IRecv_Length must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_ISend_IRecv_Length" << myrank << endl ; + debugStream << "test_MPI_Access_ISend_IRecv_Length" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -87,13 +88,13 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { for ( i = 0 ; i < maxreq ; i++ ) { if ( myrank == 0 ) { sts = mpi_access.ISend( sendbuf, 1000*i, MPI_INT, target, SendRequestId[i] ) ; - cout << "test" << myrank << " ISend RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { sts = mpi_access.IRecv( recvbuf[i], 1000*i, MPI_INT, target, RecvRequestId[i] ) ; - cout << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] + debugStream << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; } int j ; @@ -110,14 +111,14 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { if ( myrank == 0 ) { mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] << ") : target " << target << " tag " << tag << " error " << error << " flag " << flag << endl ; } else { mpi_access.status( RecvRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Recv RequestId " + debugStream << "test" << myrank << " Test(Recv RequestId " << RecvRequestId[j] << ") : source " << source << " tag " << tag << " error " << error << " outcount " << outcount << " flag " << flag << endl ; @@ -131,11 +132,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " outcount " << outcount << " RequestId " << RecvRequestId[j] << " recvbuf " << recvbuf[j][outcount-1] << " OK" << endl @@ -144,7 +145,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { } } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " outcount " << outcount << " RequestId " << RecvRequestId[j] << " OK" << endl << "===========================================================" @@ -156,7 +157,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -165,13 +166,13 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } - mpi_access.check() ; - cout << "test" << myrank << " WaitAll" << endl ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; + debugStream << "test" << myrank << " WaitAll" << endl ; if ( myrank == 0 ) { mpi_access.waitAll(maxreq, SendRequestId) ; mpi_access.deleteRequests(maxreq, SendRequestId) ; @@ -180,7 +181,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { mpi_access.waitAll(maxreq, RecvRequestId) ; mpi_access.deleteRequests(maxreq, RecvRequestId) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int sendrequests[maxreq] ; @@ -191,11 +192,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -208,11 +209,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -224,7 +225,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx index 888c961d2..a60165d80 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_ISend_IRecv_Length_1 must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_ISend_IRecv_Length_1" << myrank << endl ; + debugStream << "test_MPI_Access_ISend_IRecv_Length_1" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -88,7 +89,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { sts = MPI_SUCCESS ; if ( myrank == 0 ) { sts = mpi_access.ISend( sendbuf, 1000*i, MPI_INT, target, SendRequestId[i] ) ; - cout << "test" << myrank << " ISend RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } int j ; @@ -107,7 +108,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " IProbe lenerr " << lenerr << " " + debugStream << "test" << myrank << " IProbe lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { ostringstream strstream ; @@ -115,10 +116,10 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << "test" << myrank << " IProbe KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - cout << "test" << myrank << " IProbe i/j " << i << "/" << j + debugStream << "test" << myrank << " IProbe i/j " << i << "/" << j << " MPITag " << MPITag << " datatype " << datatype << " outcount " << outcount << " flag " << flag << endl ; } @@ -127,14 +128,14 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { int target, tag, error, outcount ; mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] << ") : target " << target << " tag " << tag << " error " << error << " flag " << flag << endl ; } else { sts = mpi_access.IRecv( recvbuf[maxirecv], outcount, datatype, source, RecvRequestId[maxirecv] ) ; - cout << "test" << myrank << " maxirecv " << maxirecv << " IRecv RequestId " + debugStream << "test" << myrank << " maxirecv " << maxirecv << " IRecv RequestId " << RecvRequestId[maxirecv] << " source " << source << " outcount " << outcount << " tag " << mpi_access.recvMPITag(target) << endl ; @@ -144,7 +145,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { else if ( myrank == 1 && i == maxreq-1 && j >= maxirecv ) { sts = mpi_access.IRecv( recvbuf[j], 1000*j, MPI_INT, target, RecvRequestId[j] ) ; - cout << "test" << myrank << " maxirecv " << maxirecv << " IRecv RequestId " + debugStream << "test" << myrank << " maxirecv " << maxirecv << " IRecv RequestId " << RecvRequestId[j] << " target " << target << " length " << 1000*j << " tag " << mpi_access.recvMPITag(target) << endl ; maxirecv = maxirecv + 1 ; @@ -153,7 +154,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -162,16 +163,16 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << endl << "test" << myrank << " KO" << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; int flag ; if ( myrank == 0 ) { mpi_access.testAll( maxreq, SendRequestId, flag ) ; - cout << "test" << myrank << " TestAll SendRequest flag " << flag << endl ; + debugStream << "test" << myrank << " TestAll SendRequest flag " << flag << endl ; } else { int i ; @@ -185,17 +186,17 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << " != maxreq " << maxreq << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } while ( maxirecv > 0 ) { for ( i = 1 ; i < maxreq ; i++ ) { - cout << "test" << myrank << " IProbe : " << endl ; + debugStream << "test" << myrank << " IProbe : " << endl ; sts = mpi_access.test( RecvRequestId[i] , flag ) ; char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " flag " << flag << " lenerr " + debugStream << "test" << myrank << " flag " << flag << " lenerr " << lenerr << " " << msgerr << " maxirecv " << maxirecv << endl ; if ( sts != MPI_SUCCESS ) { ostringstream strstream ; @@ -203,10 +204,10 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - cout << "test" << myrank << " Test flag " << flag << endl ; + debugStream << "test" << myrank << " Test flag " << flag << endl ; if ( flag ) { int tag, error ; mpi_access.status( RecvRequestId[i] , source , tag , error , @@ -221,7 +222,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << " recvbuf " << recvbuf[i][outcount-1] << endl << "========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -232,7 +233,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { << " KO" << " i " << i << endl << "========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } maxirecv = maxirecv - 1 ; @@ -240,10 +241,10 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { } } mpi_access.testAll( maxreq, RecvRequestId, flag ) ; - cout << "test" << myrank << " TestAll RecvRequest flag " << flag << endl ; + debugStream << "test" << myrank << " TestAll RecvRequest flag " << flag << endl ; } - mpi_access.check() ; - cout << "test" << myrank << " WaitAll :" << endl ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; + debugStream << "test" << myrank << " WaitAll :" << endl ; if ( myrank == 0 ) { mpi_access.waitAll( maxreq, SendRequestId ) ; mpi_access.deleteRequests( maxreq, SendRequestId ) ; @@ -262,11 +263,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -279,11 +280,11 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -295,7 +296,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Probe.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Probe.cxx index 8e3bdadda..632c5d2b1 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Probe.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Probe.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Probe() { - cout << "test_MPI_Access_Probe" << endl ; + debugStream << "test_MPI_Access_Probe" << endl ; // MPI_Init(&argc, &argv) ; @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_Probe() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 2 ) { - cout << "test_MPI_Access_Probe must be runned with 2 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_Probe must be runned with 2 procs") ; + cerr << "test_MPI_Access_Probe must be runned with 2 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_Probe must be runned with 2 procs") ; + return; } - cout << "test_MPI_Access_Probe" << myrank << endl ; + debugStream << "test_MPI_Access_Probe" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -77,14 +78,14 @@ void MPIAccessTest::test_MPI_Access_Probe() { for ( i = 0 ; i < 10 ; i++ ) { if ( myrank == 0 ) { sts = mpi_access.send(&i,1,MPI_INT,target, RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << endl ; } else { int source, tag, outcount ; MPI_Datatype datatype ; sts = mpi_access.probe(target, source, tag, datatype, outcount ) ; - cout << "test" << myrank << " Probe target " << target << " source " << source + debugStream << "test" << myrank << " Probe target " << target << " source " << source << " tag " << tag << " outcount " << outcount << endl ; int recvbuf ; sts = mpi_access.recv(&recvbuf,outcount,datatype,source, RequestId[i], @@ -96,14 +97,14 @@ void MPIAccessTest::test_MPI_Access_Probe() { << " recvbuf " << recvbuf << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -112,21 +113,21 @@ void MPIAccessTest::test_MPI_Access_Probe() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; mpi_access.testAll(10,RequestId,flag) ; if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,RequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; mpi_access.barrier() ; @@ -134,7 +135,7 @@ void MPIAccessTest::test_MPI_Access_Probe() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_SendRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_SendRecv.cxx index 6055857e9..c7cbf7d05 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_SendRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_SendRecv.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_SendRecv() { - cout << "MPIAccessTest::test_MPI_Access_SendRecv" << endl ; + debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << endl ; // MPI_Init(&argc, &argv) ; @@ -52,11 +52,12 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 2 ) { - cout << "MPIAccessTest::test_MPI_Access_SendRecv must be runned with 2 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_SendRecv must be runned with 2 procs") ; + cerr << "MPIAccessTest::test_MPI_Access_SendRecv must be runned with 2 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_SendRecv must be runned with 2 procs") ; + return; } - cout << "MPIAccessTest::test_MPI_Access_SendRecv" << myrank << endl ; + debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -90,7 +91,7 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { // outcount = mpi_access.MPIOutCount( recvRequestId[i] ) ; outcount = 1 ; } - cout << "test" << myrank << " Send sendRequestId " << sendRequestId[i] + debugStream << "test" << myrank << " Send sendRequestId " << sendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << " recvRequestId " << recvRequestId[i] << " tag " << mpi_access.recvMPITag(target) @@ -103,13 +104,13 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { << " recvbuf " << recvbuf << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -118,10 +119,10 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; @@ -129,7 +130,7 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,sendRequestId) ; @@ -137,11 +138,11 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,recvRequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; int sendrequests[10] ; int sendreqsize = mpi_access.sendRequestIds( target , 10 , sendrequests ) ; @@ -150,7 +151,7 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } int recvrequests[10] ; @@ -160,7 +161,7 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } @@ -170,7 +171,7 @@ void MPIAccessTest::test_MPI_Access_SendRecv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv.cxx index 547df625c..cdaaabf30 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Send_Recv() { - cout << "test_MPI_Access_Send_Recv" << endl ; + debugStream << "test_MPI_Access_Send_Recv" << endl ; int size ; int myrank ; @@ -50,11 +50,12 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ; if ( size < 2 ) { - cout << "test_MPI_Access_Send_Recv must be runned with 2 procs" << endl ; - CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 2 procs") ; + cerr << "test_MPI_Access_Send_Recv must be runned with 2 procs" << endl ; + //CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 2 procs") ; + return; } - cout << "test_MPI_Access_Send_Recv" << myrank << endl ; + debugStream << "test_MPI_Access_Send_Recv" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -75,7 +76,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { for ( i = 0 ; i < 10 ; i++ ) { if ( myrank == 0 ) { sts = mpi_access.send(&i,1,MPI_INT,target, RequestId[i]) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { @@ -84,7 +85,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { sts = mpi_access.recv(&recvbuf,1,MPI_INT,target, RequestId[i],&outcount) ; //int source, tag, error, outcount ; //mpi_access.Status( RequestId[i], source, tag, error, outcount, true) ; - cout << "test" << myrank << " Recv RequestId " << RequestId[i] + debugStream << "test" << myrank << " Recv RequestId " << RequestId[i] << " tag " << mpi_access.recvMPITag(target) << " outcount " << outcount << endl ; if ( (outcount != 1) | (recvbuf != i) ) { @@ -94,14 +95,14 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { << " recvbuf " << recvbuf << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -112,18 +113,18 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check(); } int flag ; mpi_access.testAll(10,RequestId,flag) ; if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,RequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check(); if ( myrank == 0 ) { int sendrequests[10] ; @@ -133,7 +134,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -145,7 +146,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -156,7 +157,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv_Length.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv_Length.cxx index 3e034b661..d3385cf15 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv_Length.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Send_Recv_Length.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { - cout << "test_MPI_Access_Send_Recv_Length" << endl ; + debugStream << "test_MPI_Access_Send_Recv_Length" << endl ; // MPI_Init(&argc, &argv) ; @@ -54,11 +54,12 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_Send_Recv_Length must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_Send_Recv_Length" << myrank << endl ; + debugStream << "test_MPI_Access_Send_Recv_Length" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -85,7 +86,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { for ( i = 0 ; i < 10 ; i++ ) { if ( myrank == 0 ) { sts = mpi_access.send( sendbuf, 1000*i, MPI_INT, target, RequestId[i] ) ; - cout << "test" << myrank << " Send RequestId " << RequestId[i] + debugStream << "test" << myrank << " Send RequestId " << RequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { @@ -98,13 +99,13 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { } //int source, tag, error, outcount ; //mpi_access.Status( RequestId[i], source, tag, error, outcount, true) ; - cout << "test" << myrank << " Recv RequestId " << RequestId[i] + debugStream << "test" << myrank << " Recv RequestId " << RequestId[i] << " tag " << mpi_access.recvMPITag(target) << " outcount " << outcount << endl ; recvbufok = true ; for ( j = 0 ; j < outcount ; j++ ) { if ( recvbuf[j] != j ) { - cout << "test" << myrank << " recvbuf[ " << j << " ] = " << recvbuf[j] + debugStream << "test" << myrank << " recvbuf[ " << j << " ] = " << recvbuf[j] << endl ; recvbufok = false ; break ; @@ -117,14 +118,14 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { << " recvbuf " << recvbuf << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -133,21 +134,21 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; } int flag ; mpi_access.testAll(10,RequestId,flag) ; if ( !flag ) { ostringstream strstream ; strstream << "test" << myrank << " flag " << flag << " KO" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } mpi_access.waitAll(10,RequestId) ; - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int sendrequests[10] ; @@ -157,7 +158,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -169,7 +170,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } } @@ -180,7 +181,7 @@ void MPIAccessTest::test_MPI_Access_Send_Recv_Length() { // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx index d8e89e555..166af2e74 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx @@ -42,7 +42,7 @@ using namespace ParaMEDMEM; void MPIAccessTest::test_MPI_Access_Time() { - cout << "test_MPI_Access_Time" << endl ; + debugStream << "test_MPI_Access_Time" << endl ; // MPI_Init(&argc, &argv) ; @@ -54,11 +54,12 @@ void MPIAccessTest::test_MPI_Access_Time() { if ( size < 2 ) { ostringstream strstream ; strstream << "test_MPI_Access_Time must be runned with 2 procs" << endl ; - cout << strstream.str() << endl ; - CPPUNIT_FAIL( strstream.str() ) ; + cerr << strstream.str() << endl ; + //CPPUNIT_FAIL( strstream.str() ) ; + return; } - cout << "test_MPI_Access_Time" << myrank << endl ; + debugStream << "test_MPI_Access_Time" << myrank << endl ; ParaMEDMEM::CommInterface interface ; @@ -69,11 +70,11 @@ void MPIAccessTest::test_MPI_Access_Time() { #define maxreq 10 if ( myrank >= 2 ) { - cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->Barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->Barrier" << endl ; mpi_access.barrier() ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->Barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->Barrier" << endl ; delete group ; - cout << "test_MPI_Access_Time" << myrank << " OK" << endl ; + debugStream << "test_MPI_Access_Time" << myrank << " OK" << endl ; return ; } @@ -100,11 +101,11 @@ void MPIAccessTest::test_MPI_Access_Time() { sts = mpi_access.ISend( &aSendTimeMsg[i] , 1 , mpi_access.timeType() , target , SendTimeRequestId[i]) ; - cout << "test" << myrank << " ISend RequestId " << SendTimeRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendTimeRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; sendbuf[i] = i ; sts = mpi_access.ISend(&sendbuf[i],1,MPI_INT,target, SendRequestId[i]) ; - cout << "test" << myrank << " ISend RequestId " << SendRequestId[i] + debugStream << "test" << myrank << " ISend RequestId " << SendRequestId[i] << " tag " << mpi_access.sendMPITag(target) << endl ; } else { @@ -112,10 +113,10 @@ void MPIAccessTest::test_MPI_Access_Time() { sts = mpi_access.IRecv( &aRecvTimeMsg[i] , 1 , mpi_access.timeType() , target , RecvTimeRequestId[i]) ; - cout << "test" << myrank << " IRecv RequestId " << RecvTimeRequestId[i] + debugStream << "test" << myrank << " IRecv RequestId " << RecvTimeRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; sts = mpi_access.IRecv(&recvbuf[i],1,MPI_INT,target, RecvRequestId[i]) ; - cout << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] + debugStream << "test" << myrank << " IRecv RequestId " << RecvRequestId[i] << " tag " << mpi_access.recvMPITag(target) << endl ; } int j ; @@ -132,14 +133,14 @@ void MPIAccessTest::test_MPI_Access_Time() { if ( myrank == 0 ) { mpi_access.status( SendTimeRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Send TimeRequestId " << SendTimeRequestId[j] + debugStream << "test" << myrank << " Test(Send TimeRequestId " << SendTimeRequestId[j] << ") : target " << target << " tag " << tag << " error " << error << " flag " << flag << aSendTimeMsg[j] << endl ; } else { mpi_access.status( RecvTimeRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Recv TimeRequestId " + debugStream << "test" << myrank << " Test(Recv TimeRequestId " << RecvTimeRequestId[j] << ") : source " << source << " tag " << tag << " error " << error << " outcount " << outcount << " flag " << flag << aRecvTimeMsg[j] << endl ; @@ -150,11 +151,11 @@ void MPIAccessTest::test_MPI_Access_Time() { << " RecvTimeRequestId " << RecvTimeRequestId[j] << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " outcount " << outcount << " RecvTimeRequestId " << RecvTimeRequestId[j] << " OK" << endl << "===========================================================" @@ -173,14 +174,14 @@ void MPIAccessTest::test_MPI_Access_Time() { if ( myrank == 0 ) { mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] + debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] << ") : target " << target << " tag " << tag << " error " << error << " flag " << flag << endl ; } else { mpi_access.status( RecvRequestId[j], source, tag, error, outcount, true ) ; - cout << "test" << myrank << " Test(Recv RequestId " + debugStream << "test" << myrank << " Test(Recv RequestId " << RecvRequestId[j] << ") : source " << source << " tag " << tag << " error " << error << " outcount " << outcount << " flag " << flag << endl ; @@ -191,11 +192,11 @@ void MPIAccessTest::test_MPI_Access_Time() { << outcount << " recvbuf " << recvbuf[j] << " KO" << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " outcount " << outcount << " RequestId " << RecvRequestId[j] << " OK" << endl << "===========================================================" @@ -207,7 +208,7 @@ void MPIAccessTest::test_MPI_Access_Time() { char msgerr[MPI_MAX_ERROR_STRING] ; int lenerr ; mpi_access.errorString(sts, msgerr, &lenerr) ; - cout << "test" << myrank << " lenerr " << lenerr << " " + debugStream << "test" << myrank << " lenerr " << lenerr << " " << msgerr << endl ; if ( sts != MPI_SUCCESS ) { @@ -216,13 +217,13 @@ void MPIAccessTest::test_MPI_Access_Time() { << "test" << myrank << " KO" << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } i = i + 1 ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { mpi_access.waitAll(maxreq, SendTimeRequestId) ; mpi_access.deleteRequests(maxreq, SendTimeRequestId) ; @@ -235,7 +236,7 @@ void MPIAccessTest::test_MPI_Access_Time() { mpi_access.waitAll(maxreq, RecvRequestId) ; mpi_access.deleteRequests(maxreq, RecvRequestId) ; } - mpi_access.check() ; + if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { int sendrequests[2*maxreq] ; @@ -245,11 +246,11 @@ void MPIAccessTest::test_MPI_Access_Time() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -262,25 +263,25 @@ void MPIAccessTest::test_MPI_Access_Time() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } } - cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->Barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->Barrier" << endl ; mpi_access.barrier() ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->Barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->Barrier" << endl ; delete group ; // MPI_Finalize(); - cout << "test_MPI_Access_Time" << myrank << " OK" << endl ; + debugStream << "test_MPI_Access_Time" << myrank << " OK" << endl ; return ; } diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Time_0.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Time_0.cxx index 087814673..9000e57ea 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Time_0.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Time_0.cxx @@ -45,14 +45,14 @@ 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 ; @@ -60,7 +60,7 @@ return ; void MPIAccessTest::test_MPI_Access_Time_0() { - cout << "test_MPI_Access_Time_0" << endl ; + debugStream << "test_MPI_Access_Time_0" << endl ; // MPI_Init(&argc, &argv) ; @@ -75,8 +75,9 @@ void MPIAccessTest::test_MPI_Access_Time_0() { << "mpirun -np test_MPI_Access_Time_0" <= 2 ) { - cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; mpi_access->barrier() ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; mpi_access->barrier() ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; delete group ; delete mpi_access ; - cout << "test_MPI_Access_Time" << myrank << " OK" << endl ; + debugStream << "test_MPI_Access_Time" << myrank << " OK" << endl ; return ; } @@ -121,7 +122,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { // mpi_access->Trace() ; int istep = 0 ; for ( t = 0 ; t < maxt ; t = t+dt[myrank] ) { - cout << "test" << myrank << " ==========================TIME " << t + debugStream << "test" << myrank << " ==========================TIME " << t << " ==========================" << endl ; if ( myrank == 0 ) { aSendTimeMsg[istep].time = t ; @@ -133,12 +134,12 @@ void MPIAccessTest::test_MPI_Access_Time_0() { sts = mpi_access->ISend( &aSendTimeMsg[istep] , 1 , mpi_access->timeType() , target , SendTimeRequestId[istep]) ; - cout << "test" << myrank << " ISend TimeRequestId " << SendTimeRequestId[istep] + debugStream << "test" << myrank << " ISend TimeRequestId " << SendTimeRequestId[istep] << " tag " << mpi_access->MPITag(SendTimeRequestId[istep]) << endl ; chksts( sts , myrank , mpi_access ) ; sendbuf[istep] = istep ; sts = mpi_access->ISend(&sendbuf[istep],1,MPI_INT,target, SendRequestId[istep]) ; - cout << "test" << myrank << " ISend Data RequestId " << SendRequestId[istep] + debugStream << "test" << myrank << " ISend Data RequestId " << SendRequestId[istep] << " tag " << mpi_access->MPITag(SendRequestId[istep]) << endl ; chksts( sts , myrank , mpi_access ) ; //CheckSent @@ -152,7 +153,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { chksts( sts , myrank , mpi_access ) ; if ( flag ) { mpi_access->deleteRequest( sendrequests[j] ) ; - cout << "test" << myrank << " " << j << ". " << sendrequests[j] + debugStream << "test" << myrank << " " << j << ". " << sendrequests[j] << " sendrequest deleted" << endl ; } } @@ -165,7 +166,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 , mpi_access->timeType() , target , RecvTimeRequestId[lasttime+1]) ; - cout << "test" << myrank << " t == 0 IRecv TimeRequestId " + debugStream << "test" << myrank << " t == 0 IRecv TimeRequestId " << RecvTimeRequestId[lasttime+1] << " MPITag " << mpi_access->MPITag( RecvTimeRequestId[lasttime+1] ) << " MPICompleted " @@ -173,7 +174,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { chksts( sts , myrank , mpi_access ) ; } else { - cout << "test" << myrank << " t # 0 lasttime " << lasttime << endl ; + debugStream << "test" << myrank << " t # 0 lasttime " << lasttime << endl ; //InitialOutTime //============== bool outtime = false ; @@ -186,11 +187,11 @@ void MPIAccessTest::test_MPI_Access_Time_0() { << aRecvTimeMsg[lasttime-1].time << " KO" << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " t " << t << " > " << "aRecvTimeMsg[ " << lasttime << "-1 ].time " << aRecvTimeMsg[lasttime-1].time << " OK" << endl @@ -210,7 +211,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { if ( t <= aRecvTimeMsg[lasttime].time ) { outtime = false ; } - cout << "test" << myrank << " while outtime( " << outtime << " && t " << t + debugStream << "test" << myrank << " while outtime( " << outtime << " && t " << t << " > aRecvTimeMsg[ " << lasttime << " ] " << aRecvTimeMsg[lasttime].time << " )" << endl ; while ( !outtime && (t > aRecvTimeMsg[lasttime].time) ) { @@ -219,7 +220,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { //=========== sts = mpi_access->wait( RecvTimeRequestId[lasttime] ) ; chksts( sts , myrank , mpi_access ) ; - cout << "test" << myrank << " Wait done RecvTimeRequestId " + debugStream << "test" << myrank << " Wait done RecvTimeRequestId " << RecvTimeRequestId[lasttime] << " lasttime " << lasttime << " tag " << mpi_access->MPITag(RecvTimeRequestId[lasttime]) << aRecvTimeMsg[lasttime] << endl ; @@ -231,7 +232,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { double deltatime = aRecvTimeMsg[lasttime].deltatime ; //double maxtime = aRecvTimeMsg[lasttime].maxtime ; double nexttime = aRecvTimeMsg[lasttime].time + deltatime ; - cout << "test" << myrank << " t " << t << " lasttime " << lasttime + debugStream << "test" << myrank << " t " << t << " lasttime " << lasttime << " deltatime " << deltatime << " nexttime " << nexttime << endl ; //if ( nexttime < maxtime && t > nexttime ) { @@ -252,7 +253,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { //sts = mpi_access->cancel( source, datatype, outcount , //RecvRequestId[lasttime] , cancelflag ) ; - cout << "test" << myrank << " Recv TO CANCEL RequestId " + debugStream << "test" << myrank << " Recv TO CANCEL RequestId " << RecvRequestId[lasttime] << " tag " << mpi_access->recvMPITag( target ) << " cancelflag " << cancelflag << endl ; @@ -270,7 +271,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { //sts = mpi_access->cancel( source, datatype, outcount , //RecvRequestId[lasttime] , cancelflag ) ; - cout << "test" << myrank << " Time TO CANCEL RequestId " + debugStream << "test" << myrank << " Time TO CANCEL RequestId " << RecvRequestId[lasttime] << " tag " << mpi_access->recvMPITag( target ) << " cancelflag " << cancelflag << endl ; @@ -281,14 +282,14 @@ void MPIAccessTest::test_MPI_Access_Time_0() { else { //DoRecv //====== - cout << "test" << myrank << " Recv target " << target + debugStream << "test" << myrank << " Recv target " << target << " lasttime " << lasttime << " lasttime-1 " << aRecvTimeMsg[lasttime-1] << " lasttime " << aRecvTimeMsg[lasttime] << endl ; sts = mpi_access->recv(&recvbuf[lasttime],1,MPI_INT,target, RecvRequestId[lasttime]) ; - cout << "test" << myrank << " Recv RequestId " + debugStream << "test" << myrank << " Recv RequestId " << RecvRequestId[lasttime] << " tag " << mpi_access->recvMPITag( target ) << endl ; @@ -303,7 +304,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 , mpi_access->timeType() , target , RecvTimeRequestId[lasttime+1]) ; - cout << "test" << myrank << " IRecv TimeRequestId " + debugStream << "test" << myrank << " IRecv TimeRequestId " << RecvTimeRequestId[lasttime+1] << " MPITag " << mpi_access->MPITag( RecvTimeRequestId[lasttime+1] ) << " MPICompleted " @@ -333,11 +334,11 @@ void MPIAccessTest::test_MPI_Access_Time_0() { << RecvRequestId[lasttime-1] << " " << RecvRequestId[lasttime] << endl << "===========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "===========================================================" + debugStream << "===========================================================" << endl << "test" << myrank << " aRecvTimeMsg[ " << lasttime << "-1 ].time " << aRecvTimeMsg[lasttime-1].time << " < t " << t << " <= " @@ -356,15 +357,15 @@ void MPIAccessTest::test_MPI_Access_Time_0() { istep = istep + 1 ; } - cout << "test" << myrank << " Barrier :" << endl ; + debugStream << "test" << myrank << " Barrier :" << endl ; mpi_access->barrier() ; - mpi_access->check() ; + if (MPI_ACCESS_VERBOSE) mpi_access->check() ; if ( myrank == 0 ) { //CheckFinalSent //============== - cout << "test" << myrank << " CheckFinalSent :" << endl ; + debugStream << "test" << myrank << " CheckFinalSent :" << endl ; int sendrequests[2*maxreq] ; int sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq , sendrequests ) ; int j ; @@ -372,12 +373,12 @@ void MPIAccessTest::test_MPI_Access_Time_0() { sts = mpi_access->wait( sendrequests[j] ) ; chksts( sts , myrank , mpi_access ) ; mpi_access->deleteRequest( sendrequests[j] ) ; - cout << "test" << myrank << " " << j << ". " << sendrequests[j] << " deleted" + debugStream << "test" << myrank << " " << j << ". " << sendrequests[j] << " deleted" << endl ; } } else { - cout << "test" << myrank << " CheckFinalRecv :" << endl ; + debugStream << "test" << myrank << " CheckFinalRecv :" << endl ; int recvrequests[2*maxreq] ; int recvreqsize = mpi_access->recvRequestIds( target , 2*maxreq , recvrequests ) ; int cancelflag ; @@ -386,7 +387,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { sts = mpi_access->cancel( recvrequests[j] , cancelflag ) ; chksts( sts , myrank , mpi_access ) ; mpi_access->deleteRequest( recvrequests[j] ) ; - cout << "test" << myrank << " " << j << ". " << recvrequests[j] << " deleted" + debugStream << "test" << myrank << " " << j << ". " << recvrequests[j] << " deleted" << " cancelflag " << cancelflag << endl ; } int source, MPITag, outcount , flag ; @@ -399,7 +400,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { //sts = mpi_access->cancel( source, datatype, outcount , //RecvRequestId[lasttime] , cancelflag ) ; - cout << "test" << myrank << " TO CANCEL RequestId " + debugStream << "test" << myrank << " TO CANCEL RequestId " << RecvRequestId[lasttime] << " tag " << mpi_access->recvMPITag( target ) << " cancelflag " << cancelflag << endl ; @@ -409,7 +410,7 @@ void MPIAccessTest::test_MPI_Access_Time_0() { chksts( sts , myrank , mpi_access ) ; } } - mpi_access->check() ; + if(MPI_ACCESS_VERBOSE) mpi_access->check() ; if ( myrank == 0 ) { int sendrequests[2*maxreq] ; @@ -419,11 +420,11 @@ void MPIAccessTest::test_MPI_Access_Time_0() { strstream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -436,11 +437,11 @@ void MPIAccessTest::test_MPI_Access_Time_0() { strstream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl << "=========================================================" << endl ; - cout << strstream.str() << endl ; + debugStream << strstream.str() << endl ; CPPUNIT_FAIL( strstream.str() ) ; } else { - cout << "=========================================================" << endl + debugStream << "=========================================================" << endl << "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl << "=========================================================" << endl ; } @@ -448,20 +449,20 @@ void MPIAccessTest::test_MPI_Access_Time_0() { int i ; for ( i = 0 ; i <= lasttime ; i++ ) { - cout << "test" << myrank << " " << i << ". RecvTimeMsg " + debugStream << "test" << myrank << " " << i << ". RecvTimeMsg " << aRecvTimeMsg[i].time << " recvbuf " << recvbuf[i] << endl ; } - cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ; mpi_access->barrier() ; - cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; + debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ; delete group ; delete mpi_access ; // MPI_Finalize(); - cout << "test" << myrank << " OK" << endl ; + debugStream << "test" << myrank << " OK" << endl ; return ; }