//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access->errorString(sts, msgerr, &lenerr) ;
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
mpi_access->errorString(sts, msgerr, &lenerr) ;
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test" << myrank << " KO"
<< "==========================================================="
<< endl ;
<< msgerr << endl ;
ostringstream strstream ;
strstream << "==========================================================="
<< "test" << myrank << " KO"
<< "==========================================================="
<< endl ;
- << "test must be runned with 2 procs" << endl ;
- cout << strstream.str() << endl ;
- CPPUNIT_FAIL( strstream.str() ) ;
+ << "test must be run with 2 procs" << endl ;
+ cerr << strstream.str() << endl ;
+ //CPPUNIT_FAIL( strstream.str() ) ;
+ return;
double dt[2] = {2., 1.} ;
double maxt = maxreq/dt[myrank] ;
double dt[2] = {2., 1.} ;
double maxt = maxreq/dt[myrank] ;
- cout << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ;
- cout << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ;
+ debugStream << "test_MPI_Access_Time_0 rank" << myrank << " <-- mpi_access->barrier" << endl ;
+ debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ;
- ParaMEDMEM::TimeMessage RecvTimeMessages[maxreq+1] ;
- ParaMEDMEM::TimeMessage *aRecvTimeMsg = &RecvTimeMessages[1] ;
+ MEDCoupling::TimeMessage RecvTimeMessages[maxreq+1] ;
+ MEDCoupling::TimeMessage *aRecvTimeMsg = &RecvTimeMessages[1] ;
sts = mpi_access->ISend( &aSendTimeMsg[istep] , 1 ,
mpi_access->timeType() , target ,
SendTimeRequestId[istep]) ;
sts = mpi_access->ISend( &aSendTimeMsg[istep] , 1 ,
mpi_access->timeType() , target ,
SendTimeRequestId[istep]) ;
<< " tag " << mpi_access->MPITag(SendTimeRequestId[istep]) << endl ;
chksts( sts , myrank , mpi_access ) ;
sendbuf[istep] = istep ;
sts = mpi_access->ISend(&sendbuf[istep],1,MPI_INT,target, SendRequestId[istep]) ;
<< " tag " << mpi_access->MPITag(SendTimeRequestId[istep]) << endl ;
chksts( sts , myrank , mpi_access ) ;
sendbuf[istep] = istep ;
sts = mpi_access->ISend(&sendbuf[istep],1,MPI_INT,target, SendRequestId[istep]) ;
<< " tag " << mpi_access->MPITag(SendRequestId[istep]) << endl ;
chksts( sts , myrank , mpi_access ) ;
//CheckSent
<< " tag " << mpi_access->MPITag(SendRequestId[istep]) << endl ;
chksts( sts , myrank , mpi_access ) ;
//CheckSent
chksts( sts , myrank , mpi_access ) ;
if ( flag ) {
mpi_access->deleteRequest( sendrequests[j] ) ;
chksts( sts , myrank , mpi_access ) ;
if ( flag ) {
mpi_access->deleteRequest( sendrequests[j] ) ;
sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 ,
mpi_access->timeType() ,
target , RecvTimeRequestId[lasttime+1]) ;
sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 ,
mpi_access->timeType() ,
target , RecvTimeRequestId[lasttime+1]) ;
<< RecvTimeRequestId[lasttime+1]
<< " MPITag " << mpi_access->MPITag( RecvTimeRequestId[lasttime+1] )
<< " MPICompleted "
<< RecvTimeRequestId[lasttime+1]
<< " MPITag " << mpi_access->MPITag( RecvTimeRequestId[lasttime+1] )
<< " MPICompleted "
<< aRecvTimeMsg[lasttime-1].time << " KO" << endl
<< "==========================================================="
<< endl ;
<< aRecvTimeMsg[lasttime-1].time << " KO" << endl
<< "==========================================================="
<< endl ;
<< endl << "test" << myrank << " t " << t << " > "
<< "aRecvTimeMsg[ " << lasttime << "-1 ].time "
<< aRecvTimeMsg[lasttime-1].time << " OK" << endl
<< endl << "test" << myrank << " t " << t << " > "
<< "aRecvTimeMsg[ " << lasttime << "-1 ].time "
<< aRecvTimeMsg[lasttime-1].time << " OK" << endl
<< " > aRecvTimeMsg[ " << lasttime << " ] "
<< aRecvTimeMsg[lasttime].time << " )" << endl ;
while ( !outtime && (t > aRecvTimeMsg[lasttime].time) ) {
<< " > aRecvTimeMsg[ " << lasttime << " ] "
<< aRecvTimeMsg[lasttime].time << " )" << endl ;
while ( !outtime && (t > aRecvTimeMsg[lasttime].time) ) {
//===========
sts = mpi_access->wait( RecvTimeRequestId[lasttime] ) ;
chksts( sts , myrank , mpi_access ) ;
//===========
sts = mpi_access->wait( RecvTimeRequestId[lasttime] ) ;
chksts( sts , myrank , mpi_access ) ;
<< RecvTimeRequestId[lasttime] << " lasttime " << lasttime
<< " tag " << mpi_access->MPITag(RecvTimeRequestId[lasttime])
<< aRecvTimeMsg[lasttime] << endl ;
<< RecvTimeRequestId[lasttime] << " lasttime " << lasttime
<< " tag " << mpi_access->MPITag(RecvTimeRequestId[lasttime])
<< aRecvTimeMsg[lasttime] << endl ;
double deltatime = aRecvTimeMsg[lasttime].deltatime ;
//double maxtime = aRecvTimeMsg[lasttime].maxtime ;
double nexttime = aRecvTimeMsg[lasttime].time + deltatime ;
double deltatime = aRecvTimeMsg[lasttime].deltatime ;
//double maxtime = aRecvTimeMsg[lasttime].maxtime ;
double nexttime = aRecvTimeMsg[lasttime].time + deltatime ;
<< " deltatime " << deltatime
<< " nexttime " << nexttime << endl ;
//if ( nexttime < maxtime && t > nexttime ) {
<< " deltatime " << deltatime
<< " nexttime " << nexttime << endl ;
//if ( nexttime < maxtime && t > nexttime ) {
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
<< " lasttime " << lasttime
<< " lasttime-1 " << aRecvTimeMsg[lasttime-1]
<< " lasttime " << aRecvTimeMsg[lasttime]
<< endl ;
sts = mpi_access->recv(&recvbuf[lasttime],1,MPI_INT,target,
RecvRequestId[lasttime]) ;
<< " lasttime " << lasttime
<< " lasttime-1 " << aRecvTimeMsg[lasttime-1]
<< " lasttime " << aRecvTimeMsg[lasttime]
<< endl ;
sts = mpi_access->recv(&recvbuf[lasttime],1,MPI_INT,target,
RecvRequestId[lasttime]) ;
sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 ,
mpi_access->timeType() , target ,
RecvTimeRequestId[lasttime+1]) ;
sts = mpi_access->IRecv( &aRecvTimeMsg[lasttime+1] , 1 ,
mpi_access->timeType() , target ,
RecvTimeRequestId[lasttime+1]) ;
<< RecvTimeRequestId[lasttime+1] << " MPITag "
<< mpi_access->MPITag( RecvTimeRequestId[lasttime+1] )
<< " MPICompleted "
<< RecvTimeRequestId[lasttime+1] << " MPITag "
<< mpi_access->MPITag( RecvTimeRequestId[lasttime+1] )
<< " MPICompleted "
<< RecvRequestId[lasttime-1] << " " << RecvRequestId[lasttime] << endl
<< "==========================================================="
<< endl ;
<< RecvRequestId[lasttime-1] << " " << RecvRequestId[lasttime] << endl
<< "==========================================================="
<< endl ;
<< endl << "test" << myrank
<< " aRecvTimeMsg[ " << lasttime << "-1 ].time "
<< aRecvTimeMsg[lasttime-1].time << " < t " << t << " <= "
<< endl << "test" << myrank
<< " aRecvTimeMsg[ " << lasttime << "-1 ].time "
<< aRecvTimeMsg[lasttime-1].time << " < t " << t << " <= "
int sendrequests[2*maxreq] ;
int sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq , sendrequests ) ;
int j ;
int sendrequests[2*maxreq] ;
int sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq , sendrequests ) ;
int j ;
sts = mpi_access->wait( sendrequests[j] ) ;
chksts( sts , myrank , mpi_access ) ;
mpi_access->deleteRequest( sendrequests[j] ) ;
sts = mpi_access->wait( sendrequests[j] ) ;
chksts( sts , myrank , mpi_access ) ;
mpi_access->deleteRequest( sendrequests[j] ) ;
int recvrequests[2*maxreq] ;
int recvreqsize = mpi_access->recvRequestIds( target , 2*maxreq , recvrequests ) ;
int cancelflag ;
int recvrequests[2*maxreq] ;
int recvreqsize = mpi_access->recvRequestIds( target , 2*maxreq , recvrequests ) ;
int cancelflag ;
sts = mpi_access->cancel( recvrequests[j] , cancelflag ) ;
chksts( sts , myrank , mpi_access ) ;
mpi_access->deleteRequest( recvrequests[j] ) ;
sts = mpi_access->cancel( recvrequests[j] , cancelflag ) ;
chksts( sts , myrank , mpi_access ) ;
mpi_access->deleteRequest( recvrequests[j] ) ;
<< " cancelflag " << cancelflag << endl ;
}
int source, MPITag, outcount , flag ;
<< " cancelflag " << cancelflag << endl ;
}
int source, MPITag, outcount , flag ;
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
//sts = mpi_access->cancel( source, datatype, outcount ,
//RecvRequestId[lasttime] ,
cancelflag ) ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
<< RecvRequestId[lasttime]
<< " tag " << mpi_access->recvMPITag( target )
<< " cancelflag " << cancelflag << endl ;
strstream << "=========================================================" << endl
<< "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl
<< "=========================================================" << endl ;
strstream << "=========================================================" << endl
<< "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl
<< "=========================================================" << endl ;
<< "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl
<< "=========================================================" << endl ;
}
<< "test" << myrank << " sendreqsize " << sendreqsize << " OK" << endl
<< "=========================================================" << endl ;
}
strstream << "=========================================================" << endl
<< "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl
<< "=========================================================" << endl ;
strstream << "=========================================================" << endl
<< "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl
<< "=========================================================" << endl ;
<< "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl
<< "=========================================================" << endl ;
}
<< "test" << myrank << " recvreqsize " << recvreqsize << " OK" << endl
<< "=========================================================" << endl ;
}