-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// 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
#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) ;
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() ;
int target = 1 - myrank ;
int sendbuf[10] ;
int RequestId[10] ;
- int sts ;
+ int sts = 0;
int i ;
for ( i = 0 ; i < 10 ; i++ ) {
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 {
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 ) {
<< " 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
<< "==========================================================="
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 ) {
<< "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.check() ;
+ if(MPI_ACCESS_VERBOSE) mpi_access.check() ;
mpi_access.barrier() ;
// MPI_Finalize();
- cout << "test" << myrank << " OK" << endl ;
+ debugStream << "test" << myrank << " OK" << endl ;
return ;
}