X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEMTest%2Ftest_MPI_Access_IProbe.cxx;h=653b68627c54e3f4b7ff29ac257f98f3df66d582;hb=c4551c56aa89896595842e5b41b048044681b4e8;hp=a45afd9163591a937f59ce7a40e62ed7d777335f;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx b/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx index a45afd916..653b68627 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_IProbe.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -43,11 +43,11 @@ #define ENABLE_FORCED_FAILURES using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; void MPIAccessTest::test_MPI_Access_IProbe() { - cout << "test_MPI_Access_IProbe" << endl ; + debugStream << "test_MPI_Access_IProbe" << endl ; // MPI_Init(&argc, &argv) ; @@ -58,18 +58,19 @@ 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() ) ; + strstream << "test_MPI_Access_IProbe must be run with 2 procs" << endl ; + 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 ; + 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 ) ; if ( myrank >= 2 ) { mpi_access.barrier() ; @@ -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 ; }