X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEMTest%2Ftest_AllToAllvDEC.cxx;h=da022e46421b708496063632a0d1922e432b16bb;hb=4c22ba01f2901896d1ec9ca302640f4d7e50d147;hp=60b5a8e898bd1c65db3f61487c0afbdcc0b1505d;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEMTest/test_AllToAllvDEC.cxx b/src/ParaMEDMEMTest/test_AllToAllvDEC.cxx index 60b5a8e89..da022e464 100644 --- a/src/ParaMEDMEMTest/test_AllToAllvDEC.cxx +++ b/src/ParaMEDMEMTest/test_AllToAllvDEC.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 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 @@ -38,7 +38,7 @@ #define ENABLE_FORCED_FAILURES using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; void MPIAccessDECTest::test_AllToAllvDECSynchronousPointToPoint() { test_AllToAllvDEC( false ) ; @@ -47,19 +47,19 @@ void MPIAccessDECTest::test_AllToAllvDECAsynchronousPointToPoint() { 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 ; @@ -67,7 +67,7 @@ static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) { void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) { - cout << "test_AllToAllvDEC" << endl ; + debugStream << "test_AllToAllvDEC" << endl ; // MPI_Init(&argc, &argv) ; @@ -81,17 +81,17 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) { strstream << "usage :" << endl << "mpirun -np 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 sourceprocs; std::set targetprocs; int i ; @@ -102,8 +102,8 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) { 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 ) ; @@ -139,35 +139,35 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool 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] ; @@ -181,11 +181,11 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) { 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 ; } @@ -202,7 +202,7 @@ void MPIAccessDECTest::test_AllToAllvDEC( bool Asynchronous ) { // MPI_Finalize(); - cout << "test_AllToAllvDEC" << myrank << " OK" << endl ; + debugStream << "test_AllToAllvDEC" << myrank << " OK" << endl ; return ; }