-// Copyright (C) 2007-2013 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
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
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) ;
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 ;
+ 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 10000
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 ] ;
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 ;
}
}
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 ;
}
<< "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 ;
}
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 ;
}
delete [] ArrayOfRecvRequests ;
}
- mpi_access.check() ;
+ if(MPI_ACCESS_VERBOSE) mpi_access.check() ;
if ( myrank == 0 ) {
int sendrequests[maxreq] ;
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 ;
}