-// 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
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_SendRecv() {
- cout << "MPIAccessTest::test_MPI_Access_SendRecv" << endl ;
+ debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << endl ;
// MPI_Init(&argc, &argv) ;
MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ;
if ( size < 2 ) {
- cout << "MPIAccessTest::test_MPI_Access_SendRecv must be runned with 2 procs" << endl ;
- CPPUNIT_FAIL("test_MPI_Access_SendRecv must be runned with 2 procs") ;
+ cerr << "MPIAccessTest::test_MPI_Access_SendRecv must be runned with 2 procs" << endl ;
+ //CPPUNIT_FAIL("test_MPI_Access_SendRecv must be runned with 2 procs") ;
+ return;
}
- cout << "MPIAccessTest::test_MPI_Access_SendRecv" << myrank << endl ;
+ debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << 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() ;
// outcount = mpi_access.MPIOutCount( recvRequestId[i] ) ;
outcount = 1 ;
}
- cout << "test" << myrank << " Send sendRequestId " << sendRequestId[i]
+ debugStream << "test" << myrank << " Send sendRequestId " << sendRequestId[i]
<< " tag " << mpi_access.sendMPITag(target)
<< " recvRequestId " << recvRequestId[i]
<< " tag " << mpi_access.recvMPITag(target)
<< " recvbuf " << recvbuf << " KO"
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
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 ;
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.waitAll(10,sendRequestId) ;
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.waitAll(10,recvRequestId) ;
- mpi_access.check() ;
+ if(MPI_ACCESS_VERBOSE) mpi_access.check() ;
int sendrequests[10] ;
int sendreqsize = mpi_access.sendRequestIds( target , 10 , sendrequests ) ;
strstream << "=========================================================" << endl
<< "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl
<< "=========================================================" << endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
int recvrequests[10] ;
strstream << "=========================================================" << endl
<< "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl
<< "=========================================================" << endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
// MPI_Finalize();
- cout << "test" << myrank << " OK" << endl ;
+ debugStream << "test" << myrank << " OK" << endl ;
return ;
}