{
if ( WithWait )
{
- cout << "CheckSent" << _my_rank << " " << i << "./" << nSendRequest
- << " SendRequestId " << ArrayOfSendRequests[i] << " MPITarget "
- << _MPI_access->MPITarget(ArrayOfSendRequests[i]) << " MPITag "
- << _MPI_access->MPITag(ArrayOfSendRequests[i]) << " Wait :" << endl ;
+ if (SendTrace)
+ {
+ cout << "CheckSent" << _my_rank << " " << i << "./" << nSendRequest
+ << " SendRequestId " << ArrayOfSendRequests[i] << " MPITarget "
+ << _MPI_access->MPITarget(ArrayOfSendRequests[i]) << " MPITag "
+ << _MPI_access->MPITag(ArrayOfSendRequests[i]) << " Wait :" << endl ;
+ }
sts = _MPI_access->wait( ArrayOfSendRequests[i] ) ;
}
else
#include <iostream>
#include "mpi.h"
+// (ABN]: too many text output in the MPIAccesTest - this renders
+// the analysis complicated:
+#define MPI_ACCESS_VERBOSE 0
+#define debugStream \
+ if (!MPI_ACCESS_VERBOSE) {} \
+ else std::cout
class MPIAccessDECTest : public CppUnit::TestFixture
{
delete target_group;
delete source_group;
delete dec;
+ if(partialComm != MPI_COMM_NULL)
+ comm.commFree(&partialComm);
+ comm.groupFree(&grp);
+ comm.groupFree(&group_world);
MPI_Barrier(MPI_COMM_WORLD);
}
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access.errorString(sts, msgerr, &lenerr) ;
- cout << "test" << myrank << " lenerr " << lenerr << " "
+ debugStream << "test" << myrank << " lenerr " << lenerr << " "
<< msgerr << endl ;
ostringstream strstream ;
strstream << "===========================================================" << endl
<< "test_AllToAllDEC" << myrank << " KO" << endl
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
return ;
void MPIAccessDECTest::test_AllToAllDEC( bool Asynchronous ) {
- cout << "test_AllToAllDEC" << endl ;
+ debugStream << "test_AllToAllDEC" << 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() ) ;
}
- cout << "test_AllToAllDEC" << myrank << endl ;
+ debugStream << "test_AllToAllDEC" << myrank << endl ;
ParaMEDMEM::CommInterface interface ;
std::set<int> sourceprocs;
}
int nSendReq = mpi_access->sendRequestIdsSize() ;
- cout << "test_AllToAllDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
+ debugStream << "test_AllToAllDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
ostringstream strstream ;
strstream << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
<< " RecvRequests # 0 Error" << endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
else {
- cout << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
+ debugStream << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
<< " RecvRequests = 0 OK" << endl ;
}
// MPI_Finalize();
- cout << "test_AllToAllDEC" << myrank << " OK" << endl ;
+ debugStream << "test_AllToAllDEC" << myrank << " OK" << endl ;
return ;
}
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 ;
std::set<int> sourceprocs;
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 ;
}
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) ;
<< " (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_AllToAllvDEC" << myrank << endl ;
+ debugStream << "test_AllToAllvDEC" << myrank << endl ;
ParaMEDMEM::CommInterface interface ;
std::set<int> sourceprocs;
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 ;
}
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access->errorString(sts, msgerr, &lenerr) ;
- cout << "test_AllToAllvTimeDEC" << myrank << " lenerr " << lenerr << " "
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " lenerr " << lenerr << " "
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test_AllToAllvTimeDEC" << myrank << " KO"
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
return ;
void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINative ) {
- cout << "test_AllToAllvTimeDEC" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << 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() ) ;
}
// UseMPI_Alltoallv = atoi(argv[2]) ;
// }
- cout << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
<< " UseMPI_Alltoallv " << UseMPI_Alltoallv << endl ;
ParaMEDMEM::CommInterface interface ;
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp , 0.5 ) ;
MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
#define maxproc 11
#define maxreq 10000
// MyMPIAccessDEC->NextTime( nextdeltatime ) ;
}
MyMPIAccessDEC->setTime( timeLoc , nextdeltatime ) ;
- cout << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
+ debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME "
<< nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ;
int * sendbuf = new int[datamsglength*size] ;
// int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;
aRecvTimeMessage, recvtimecounts , rtimedispls ,
mpi_access->timeType() , *comm ) ;
// for ( j = 0 ; j < size ; j++ ) {
- // cout << "test_AllToAllvTimeDEC" << myrank << " TimeMessage received " << j << " "
+ // debugStream << "test_AllToAllvTimeDEC" << myrank << " TimeMessage received " << j << " "
// << aRecvTimeMessage[j] << endl ;
// }
delete aSendTimeMessage ;
chksts( sts , myrank , mpi_access ) ;
}
- // cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
+ // debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
// for ( i = 0 ; i < datamsglength*size ; i++ ) {
- // cout << " " << recvbuf[i] ;
+ // debugStream << " " << recvbuf[i] ;
// }
- // cout << endl ;
+ // debugStream << endl ;
- // cout << "test_AllToAllvTimeDEC" << myrank << " sendbuf " << sendbuf << endl ;
+ // debugStream << "test_AllToAllvTimeDEC" << 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_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
+ // debugStream << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
bool badrecvbuf = false ;
for ( i = 0 ; i < size ; i++ ) {
int j ;
if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(index%datamsglength) ) {
badrecvbuf = true ;
- cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " # " << (index/datamsglength)*1000000 +
myrank*1000 +
myrank*datamsglength+(index%datamsglength) << endl ;
}
else if ( badrecvbuf ) {
- cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " == " << (index/datamsglength)*1000000 +
myrank*1000 +
myrank*datamsglength+(index%datamsglength) << endl ;
}
else if ( recvbuf[index] != -1 ) {
badrecvbuf = true ;
- cout << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " # -1" << endl ;
}
}
<< "test_AllToAllvTimeDEC" << myrank << " badrecvbuf"
<< endl << "============================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
delete [] recvbuf ;
}
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
- cout << "test_AllToAllvTimeDEC" << myrank << " CheckFinalSent" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " CheckFinalSent" << endl ;
sts = MyMPIAccessDEC->checkFinalSent() ;
if ( sts != MPI_SUCCESS ) {
ostringstream strstream ;
<< "test_AllToAllvTimeDEC" << myrank << " final CheckSent ERROR"
<< endl << "================================================================"
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
- cout << "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv" << endl ;
sts = MyMPIAccessDEC->checkFinalRecv() ;
if ( sts != MPI_SUCCESS ) {
ostringstream strstream ;
<< "test_AllToAllvTimeDEC" << myrank << " CheckFinalRecv ERROR"
<< endl << "================================================================"
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
<< " RecvRequests # 0 Error"
<< endl << "==============================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
else {
- cout << "test_AllToAllvTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " RecvRequestIds " << nRecvReq
<< " RecvRequests = 0 OK" << endl ;
}
time_t endtime = time(NULL) ;
- cout << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
<< " calls to AllToAll" << endl ;
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " Barrier done" << endl ;
delete sourcegroup ;
delete targetgroup ;
endtime = time(NULL) ;
- cout << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
+ debugStream << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
<< " calls to AllToAll" << endl ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access->errorString(sts, msgerr, &lenerr) ;
- cout << "test" << myrank << " lenerr " << lenerr << " "
+ debugStream << "test" << myrank << " lenerr " << lenerr << " "
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test" << myrank << " KO"
<< "==========================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
return ;
void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) {
- cout << "test_AllToAllvTimeDoubleDEC" << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << 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_AllToAllvTimeDoubleDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
ParaMEDMEM::CommInterface interface ;
std::set<int> sourceprocs;
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
#define maxproc 11
}
}
MyMPIAccessDEC->setTime( timeLoc[myrank] , nextdeltatime[myrank] ) ;
- cout << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME "
+ debugStream << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME "
<< nextdeltatime[myrank] << "=====MAXTIME " << maxtime[myrank] << " ======"
<< endl ;
double * sendbuf = new double[datamsglength*size] ;
// double * sendbuf = (double *) malloc(sizeof(double)*datamsglength*size) ;
double * recvbuf = new double[datamsglength*size] ;
int j ;
- //cout << "test_AllToAllvTimeDoubleDEC" << myrank << " sendbuf" ;
+ //debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " sendbuf" ;
for ( target = 0 ; target < size ; target++ ) {
for ( j = 0 ; j < datamsglength ; j++ ) {
//sendbuf[j] = myrank*10000 + (j/datamsglength)*100 + j ;
sendbuf[target*datamsglength+j] = myrank*1000000 + target*10000 +
(timeLoc[myrank]/deltatime[myrank])*100 + j ;
- //cout << " " << (int ) sendbuf[target*datamsglength+j] ;
+ //debugStream << " " << (int ) sendbuf[target*datamsglength+j] ;
recvbuf[target*datamsglength+j] = -1 ;
}
- //cout << endl ;
+ //debugStream << endl ;
}
int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE ,
recvbuf, recvcounts , rdispls , MPI_DOUBLE ) ;
chksts( sts , myrank , mpi_access ) ;
-// cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf before CheckSent" ;
+// debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf before CheckSent" ;
// for ( i = 0 ; i < datamsglength*size ; i++ ) {
-// cout << " " << recvbuf[i] ;
+// debugStream << " " << recvbuf[i] ;
// }
-// cout << endl ;
+// debugStream << endl ;
int nRecvReq = mpi_access->recvRequestIdsSize() ;
if ( nRecvReq != 0 ) {
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_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ;
+// debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ;
bool badrecvbuf = false ;
for ( target = 0 ; target < size ; target++ ) {
int j ;
if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 +
(timeLoc[target]/deltatime[target])*100 + j)) > 101) {
badrecvbuf = true ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] "
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] "
<< timeLoc[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index]
<< " # " << (int ) (target*1000000 +
myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j)
<< endl ;
}
else if ( badrecvbuf ) {
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " ~= " << (int ) (target*1000000 +
myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ;
}
}
else if ( recvbuf[index] != -1 ) {
badrecvbuf = true ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " # -1" << endl ;
}
}
<< "test_AllToAllvTimeDoubleDEC" << myrank << " badrecvbuf"
<< endl << "=================================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
delete [] recvbuf ;
}
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent" << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent" << endl ;
sts = MyMPIAccessDEC->checkFinalSent() ;
if ( sts != MPI_SUCCESS ) {
ostringstream strstream ;
<< "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalSent ERROR"
<< endl << "================================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv" << endl ;
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv" << endl ;
sts = MyMPIAccessDEC->checkFinalRecv() ;
if ( sts != MPI_SUCCESS ) {
ostringstream strstream ;
<< "test_AllToAllvTimeDoubleDEC" << myrank << " CheckFinalRecv ERROR"
<< endl << "================================================================"
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
<< " RecvRequests # 0 Error"
<< endl << "==============================================================="
<< endl ;
- cout << strstream.str() << endl ;
+ debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
else {
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " RecvRequestIds " << nRecvReq
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " RecvRequestIds " << nRecvReq
<< " RecvRequests = 0 OK" << endl ;
}
time_t endtime = time(NULL) ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
<< " calls to AllToAll" << endl ;
- cout << "test" << myrank << " Barrier :" << endl ;
+ debugStream << "test" << myrank << " Barrier :" << endl ;
mpi_access->barrier() ;
delete sourcegroup ;
endtime = time(NULL) ;
- cout << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
+ debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
<< " calls to AllToAll" << endl ;