-// 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 MPIAccessDECTest::test_AllToAllTimeDECSynchronousPointToPoint() {
test_AllToAllTimeDEC( false ) ;
test_AllToAllTimeDEC( 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_AllToAllTimeDEC" << myrank << " lenerr " << lenerr << " "
+ debugStream << "test_AllToAllTimeDEC" << myrank << " lenerr " << lenerr << " "
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test_AllToAllTimeDEC" << myrank << " KO"
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
return ;
void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) {
- cout << "test_AllToAllTimeDEC" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << endl ;
// MPI_Init(&argc, &argv) ;
<< " (nbprocs >=2)" << endl
<< "test must be runned 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_AllToAllTimeDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " Asynchronous " << Asynchronous << 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) ;
// LinearTimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
- cout << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
#define maxproc 11
#define maxreq 10000
// MyMPIAccessDEC->NextTime( nextdeltatime ) ;
}
MyMPIAccessDEC->setTime( time , nextdeltatime ) ;
- cout << "test_AllToAllTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
+ debugStream << "test_AllToAllTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
<< nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ;
int * sendbuf = new int[datamsglength*size] ;
// int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;
recvbuf, recvcount , MPI_INT ) ;
chksts( sts , myrank , mpi_access ) ;
- // cout << "test_AllToAllTimeDEC" << myrank << " recvbuf before CheckSent" ;
+ // debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf before CheckSent" ;
// for ( i = 0 ; i < datamsglength*size ; i++ ) {
- // cout << " " << recvbuf[i] ;
+ // debugStream << " " << recvbuf[i] ;
// }
- // cout << endl ;
+ // debugStream << endl ;
- // cout << "test_AllToAllTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
+ // debugStream << "test_AllToAllTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
// MyMPIAccessDEC->CheckSent() ;
int nRecvReq = mpi_access->recvRequestIdsSize() ;
int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
- // cout << "test_AllToAllTimeDEC" << myrank << " recvbuf" << endl ;
+ // debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf" << endl ;
bool badrecvbuf = false ;
for ( i = 0 ; i < datamsglength*size ; i++ ) {
if ( recvbuf[i] != (i/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(i%datamsglength) ) {
badrecvbuf = true ;
- cout << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
+ debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
<< recvbuf[i] << " # " << (i/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(i%datamsglength) << endl ;
}
else if ( badrecvbuf ) {
- cout << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
+ debugStream << "test_AllToAllTimeDEC" << myrank << " recvbuf[" << i << "] "
<< recvbuf[i] << " == " << (i/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(i%datamsglength) << endl ;
}
<< "test_AllToAllTimeDEC" << myrank << " badrecvbuf"
<< endl << "============================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
delete [] recvbuf ;
}
- cout << "test_AllToAllTimeDEC" << myrank << " final CheckSent" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " final CheckSent" << endl ;
sts = MyMPIAccessDEC->checkSent() ;
if ( sts != MPI_SUCCESS ) {
ostringstream strstream ;
<< "test_AllToAllTimeDEC" << myrank << " final CheckSent ERROR"
<< endl << "================================================================"
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
int nSendReq = mpi_access->sendRequestIdsSize() ;
- cout << "test_AllToAllTimeDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+ debugStream << "test_AllToAllTimeDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
<< " RecvRequests # 0 Error"
<< endl << "==============================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
else {
- cout << "test_AllToAllTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
+ debugStream << "test_AllToAllTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
<< " RecvRequests = 0 OK" << endl ;
}
- cout << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " Barrier done" << endl ;
delete sourcegroup ;
delete targetgroup ;
// MPI_Finalize();
- cout << "test_AllToAllTimeDEC" << myrank << " OK" << endl ;
+ debugStream << "test_AllToAllTimeDEC" << myrank << " OK" << endl ;
return ;
}