-// Copyright (C) 2007-2014 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
#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) ;
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 run with 2 procs" << endl ;
+ //CPPUNIT_FAIL("test_MPI_Access_ISend_IRecv must be run 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
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 ;
mpi_access.test( RecvRequestId[j], flag ) ;
}
if ( flag ) {
- int target,source, tag, error, outcount ;
+ int source, tag, error, outcount ;
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 ;
<< 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
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() ;
if ( myrank == 0 ) {
mpi_access.waitAll(maxreq, SendRequestId) ;
mpi_access.deleteRequests(maxreq, SendRequestId) ;
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] ;
int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ;
- int i ;
if ( sendreqsize != 0 ) {
ostringstream strstream ;
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 ;
}
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 ;
}
// MPI_Finalize();
- cout << "test" << myrank << " OK" << endl ;
+ debugStream << "test" << myrank << " OK" << endl ;
return ;
}