Salome HOME
projects
/
tools
/
medcoupling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve swig generation process on Windows platform.
[tools/medcoupling.git]
/
src
/
ParaMEDMEMTest
/
test_MPI_Access_Cyclic_Send_Recv.cxx
diff --git
a/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx
b/src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx
index 499c6f0a6fed19dbe0c662999f608b76ea6c681e..9f55ca8e80ad42b2cb4854c857cd71341870b067 100644
(file)
--- a/
src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx
+++ b/
src/ParaMEDMEMTest/test_MPI_Access_Cyclic_Send_Recv.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D
+// Copyright (C) 2007-201
6
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
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-37,11
+37,11
@@
#define ENABLE_FORCED_FAILURES
using namespace std;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace
ParaMEDMEM
;
+using namespace
MEDCoupling
;
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
-
cout
<< "test_MPI_Access_Cyclic_Send_Recv" << endl ;
+
debugStream
<< "test_MPI_Access_Cyclic_Send_Recv" << endl ;
// MPI_Init(&argc, &argv) ;
// MPI_Init(&argc, &argv) ;
@@
-51,17
+51,18
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ;
if ( size < 3 ) {
MPI_Comm_rank(MPI_COMM_WORLD,&myrank) ;
if ( size < 3 ) {
- cout << "test_MPI_Access_Send_Recv must be runned with 3 procs" << endl ;
- CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 3 procs") ;
+ cerr << "test_MPI_Access_Send_Recv must be runned with 3 procs" << endl ;
+ //CPPUNIT_FAIL("test_MPI_Access_Send_Recv must be runned with 3 procs") ;
+ return;
}
}
-
cout
<< "test_MPI_Access_Cyclic_Send_Recv" << myrank << endl ;
+
debugStream
<< "test_MPI_Access_Cyclic_Send_Recv" << 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 >= 3 ) {
mpi_access.barrier() ;
if ( myrank >= 3 ) {
mpi_access.barrier() ;
@@
-76,7
+77,7
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
int i = 0 ;
if ( myrank == 0 ) {
sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
int i = 0 ;
if ( myrank == 0 ) {
sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
-
cout
<< "test" << myrank << " Send RequestId " << RequestId[i]
+
debugStream
<< "test" << myrank << " Send RequestId " << RequestId[i]
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
for ( i = 0 ; i < 10 ; i++ ) {
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
for ( i = 0 ; i < 10 ; i++ ) {
@@
-93,7
+94,7
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
}
//int source, tag, error, outcount ;
//mpi_access.Status( RequestId[i], source, tag, error, outcount, true) ;
}
//int source, tag, error, outcount ;
//mpi_access.Status( RequestId[i], source, tag, error, outcount, true) ;
-
cout
<< "test" << myrank << " Recv RequestId " << RequestId[i]
+
debugStream
<< "test" << myrank << " Recv RequestId " << RequestId[i]
<< " tag " << mpi_access.recvMPITag(allsource[myrank])
<< " outcount " << outcount << endl ;
if ( (outcount != 1) | (recvbuf != i) ) {
<< " tag " << mpi_access.recvMPITag(allsource[myrank])
<< " outcount " << outcount << endl ;
if ( (outcount != 1) | (recvbuf != i) ) {
@@
-103,26
+104,26
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
<< outcount << " recvbuf " << recvbuf << " KO"
<< "==========================================================="
<< endl ;
<< outcount << " recvbuf " << recvbuf << " KO"
<< "==========================================================="
<< endl ;
-
cout
<< strstream.str() << endl ;
+
debugStream
<< strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
if ( myrank == 0 ) {
if ( i != 9 ) {
int ii = i + 1 ;
sts = mpi_access.send(&ii,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
CPPUNIT_FAIL( strstream.str() ) ;
}
if ( myrank == 0 ) {
if ( i != 9 ) {
int ii = i + 1 ;
sts = mpi_access.send(&ii,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
-
cout
<< "test" << myrank << " Send RequestId " << RequestId[i]
+
debugStream
<< "test" << myrank << " Send RequestId " << RequestId[i]
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
}
else {
sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
}
else {
sts = mpi_access.send(&i,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
-
cout
<< "test" << myrank << " Send RequestId " << RequestId[i]
+
debugStream
<< "test" << myrank << " Send RequestId " << RequestId[i]
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
mpi_access.errorString(sts, msgerr, &lenerr) ;
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
}
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 ) {
<< " " << msgerr << endl ;
if ( sts != MPI_SUCCESS ) {
@@
-131,10
+132,10
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
<< "test" << myrank << " KO"
<< "==========================================================="
<< endl ;
<< "test" << myrank << " KO"
<< "==========================================================="
<< endl ;
-
cout
<< strstream.str() << endl ;
+
debugStream
<< strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
CPPUNIT_FAIL( strstream.str() ) ;
}
- mpi_access.check() ;
+
if(MPI_ACCESS_VERBOSE)
mpi_access.check() ;
}
int flag ;
}
int flag ;
@@
-142,11
+143,11
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
if ( !flag ) {
ostringstream strstream ;
strstream << "test" << myrank << " flag " << flag << " KO" << endl ;
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,RequestId) ;
CPPUNIT_FAIL( strstream.str() ) ;
}
mpi_access.waitAll(10,RequestId) ;
- mpi_access.check() ;
+
if(MPI_ACCESS_VERBOSE)
mpi_access.check() ;
int sendrequests[10] ;
int sendreqsize = mpi_access.sendRequestIds( alltarget[myrank] , 10 ,
int sendrequests[10] ;
int sendreqsize = mpi_access.sendRequestIds( alltarget[myrank] , 10 ,
@@
-156,7
+157,7
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
strstream << "=========================================================" << endl
<< "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl
<< "=========================================================" << endl ;
strstream << "=========================================================" << endl
<< "test" << myrank << " sendreqsize " << sendreqsize << " KO" << endl
<< "=========================================================" << endl ;
-
cout
<< strstream.str() << endl ;
+
debugStream
<< strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
int recvrequests[10] ;
CPPUNIT_FAIL( strstream.str() ) ;
}
int recvrequests[10] ;
@@
-167,7
+168,7
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
strstream << "=========================================================" << endl
<< "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl
<< "=========================================================" << endl ;
strstream << "=========================================================" << endl
<< "test" << myrank << " recvreqsize " << recvreqsize << " KO" << endl
<< "=========================================================" << endl ;
-
cout
<< strstream.str() << endl ;
+
debugStream
<< strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
CPPUNIT_FAIL( strstream.str() ) ;
}
@@
-177,7
+178,7
@@
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
// MPI_Finalize();
// MPI_Finalize();
-
cout
<< "test" << myrank << " OK" << endl ;
+
debugStream
<< "test" << myrank << " OK" << endl ;
return ;
}
return ;
}