X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEMTest%2Ftest_MPI_Access_ISend_IRecv.cxx;h=ce6b284e8d96b74a80b1fc7aefb7ab9e1a8dd813;hb=c8d33262ed6d2041da8512b02f8c8b4ffadf733d;hp=cd54c259c459311a0adf6d456cc63e708a955348;hpb=378cb2ebe08f8f4543ef632b2bd5f77fe180f978;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx old mode 100755 new mode 100644 index cd54c259c..ce6b284e8 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,11 +38,11 @@ #define ENABLE_FORCED_FAILURES using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; 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,17 +52,18 @@ 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 ; + MEDCoupling::CommInterface interface ; - ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ; + MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ; - ParaMEDMEM::MPIAccess mpi_access( group ) ; + MEDCoupling::MPIAccess mpi_access( group ) ; #define maxreq 100 @@ -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 ; }