-// Copyright (C) 2007-2014 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
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllvDECSynchronousPointToPoint() {
test_AllToAllvDEC( false ) ;
test_AllToAllvDEC( true ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access.errorString(sts, msgerr, &lenerr) ;
- cout << "test_AllToAllvDEC" << myrank << " lenerr " << lenerr << " "
+ debugStream << "test_AllToAllvDEC" << myrank << " lenerr " << lenerr << " "
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test_AllToAllvDEC" << myrank << " KO"
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
return ;
void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) {
- cout << "test_AllToAllvDEC" << endl ;
+ debugStream << "test_AllToAllvDEC" << endl ;
// MPI_Init(&argc, &argv) ;
strstream << "usage :" << endl
<< "mpirun -np <nbprocs> test_AllToAllvDEC" << endl
<< " (nbprocs >=2)" << endl
- << "test must be runned with more than 1 proc and less than 12 procs"
+ << "test must be run with more than 1 proc and less than 12 procs"
<< endl ;
- cout << strstream.str() << endl ;
+ cerr << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
// int Asynchronous = atoi(argv[1]);
- cout << "test_AllToAllvDEC" << myrank << endl ;
+ debugStream << "test_AllToAllvDEC" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
MyMPIAccessDEC->allToAllv( sendbuf, sendcounts , sdispls , MPI_INT ,
recvbuf, recvcounts , rdispls , MPI_INT ) ;
- // cout << "test_AllToAllvDEC" << myrank << " recvbuf before CheckSent" ;
+ // debugStream << "test_AllToAllvDEC" << myrank << " recvbuf before CheckSent" ;
// for ( i = 0 ; i < datamsglength*size ; i++ ) {
- // cout << " " << recvbuf[i] ;
+ // debugStream << " " << recvbuf[i] ;
// }
- // cout << endl ;
+ // debugStream << endl ;
- // cout << "test_AllToAllvDEC" << myrank << " sendbuf " << sendbuf << endl ;
+ // debugStream << "test_AllToAllvDEC" << myrank << " sendbuf " << sendbuf << endl ;
// MyMPIAccessDEC->CheckSent() ;
int nRecvReq = mpi_access->recvRequestIdsSize() ;
- // cout << "test_AllToAllvDEC" << myrank << " WaitAllRecv " << nRecvReq << " Requests" << endl ;
+ // debugStream << "test_AllToAllvDEC" << myrank << " WaitAllRecv " << nRecvReq << " Requests" << endl ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
mpi_access->deleteRequests( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
- // cout << "test_AllToAllvDEC" << myrank << " recvbuf" ;
+ // debugStream << "test_AllToAllvDEC" << myrank << " recvbuf" ;
// for ( i = 0 ; i < datamsglength*size ; i++ ) {
- // cout << " " << recvbuf[i] ;
+ // debugStream << " " << recvbuf[i] ;
// }
- // cout << endl ;
+ // debugStream << endl ;
}
- // cout << "test_AllToAllvDEC" << myrank << " final CheckSent" << endl ;
+ // debugStream << "test_AllToAllvDEC" << myrank << " final CheckSent" << endl ;
// MyMPIAccessDEC->CheckSent() ;
int nSendReq = mpi_access->sendRequestIdsSize() ;
- cout << "test_AllToAllvDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+ debugStream << "test_AllToAllvDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
ostringstream strstream ;
strstream << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
<< " RecvRequests # 0 Error" << endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
else {
- cout << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
+ debugStream << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
<< " RecvRequests = 0 OK" << endl ;
}
// MPI_Finalize();
- cout << "test_AllToAllvDEC" << myrank << " OK" << endl ;
+ debugStream << "test_AllToAllvDEC" << myrank << " OK" << endl ;
return ;
}