From f074e8da3f702d54027b82e3c0781d2f952d0bf4 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 22 Oct 2015 11:12:40 +0200 Subject: [PATCH 1/1] Fixing ugly stack overflow in test_MPI_Access_ISend_IRecv_Length* tests. --- src/ParaMEDMEM/MPIAccess.cxx | 12 ++++++------ .../test_MPI_Access_ISend_IRecv_Length.cxx | 5 ++--- .../test_MPI_Access_ISend_IRecv_Length_1.cxx | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ParaMEDMEM/MPIAccess.cxx b/src/ParaMEDMEM/MPIAccess.cxx index b9389cdcc..b7fe80393 100644 --- a/src/ParaMEDMEM/MPIAccess.cxx +++ b/src/ParaMEDMEM/MPIAccess.cxx @@ -234,29 +234,29 @@ namespace ParaMEDMEM The default is [ 0 , MPI_TAG_UB], MPI_TAG_UB being the maximum value in an implementation of MPI (minimum 32767 = 2**15-1). On awa with the implementation lam MPI_TAG_UB value is - 7353944. The norma MPI specify that value is the same in all + 7353944. The norm MPI specify that value is the same in all processes started by mpirun. In the case of the use of the same IntraCommunicator in a process for several distinct data flows (or for several IntraCommunicators - with common processes), that permits to avoid ambibuity + with common processes), that permits to avoid ambiguity and may help debug. . In MPIAccess the tags have two parts (#define MODULO_TAG 10) : + The last decimal digit decimal correspond to MPI_DataType ( 1 for TimeMessages, 2 for MPI_INT and 3 for MPI_DOUBLE) - + The value of other digits correspond to a circular numero for each + + The value of other digits correspond to a circular number for each message. - + A TimeMessage and the associated DataMessage have the same numero + + A TimeMessage and the associated DataMessage have the same number (but the types are different and the tags also). . For a Send of a message from a process "source" to a process "target", we have _send_MPI_tag[target] in the process - source (it contains the last "tag" used for the Send of a pour l'envoi de + source (it contains the last "tag" used for the Send of a message to the process target). And in the process "target" which receive that message, we have _recv_MPI_Tag[source] (it contains the last "tag" used for the Recv of messages from the process source). - Naturally in the MPI norma the values of that tags must be the same. + Naturally in the MPI norm the values of that tags must be the same. */ int MPIAccess::newSendTag( MPI_Datatype datatype, int destrank , int method , bool asynchronous, int &RequestId ) diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx index 546f60a0f..d1b556c3d 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx @@ -80,7 +80,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { int RecvRequestId[maxreq] ; int sts ; int sendbuf[1000*(maxreq-1)] ; - int recvbuf[maxreq-1][1000*(maxreq-1)] ; + int recvbuf[maxreq][1000*(maxreq-1)] ; int i ; for ( i = 0 ; i < 1000*(maxreq-1) ; i++ ) { sendbuf[i] = i ; @@ -186,7 +186,6 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { if ( myrank == 0 ) { int sendrequests[maxreq] ; int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ; - sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ; if ( sendreqsize != 0 ) { ostringstream strstream ; strstream << "=========================================================" << endl @@ -203,7 +202,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { } else { int recvrequests[maxreq] ; - int recvreqsize = mpi_access.sendRequestIds( target , maxreq , recvrequests ) ; + int recvreqsize = mpi_access.recvRequestIds( target , maxreq , recvrequests ) ; if ( recvreqsize != 0 ) { ostringstream strstream ; strstream << "=========================================================" << endl diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx index a60165d80..966bfc457 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx @@ -78,7 +78,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { int RecvRequestId[maxreq] ; int sts ; int sendbuf[1000*(maxreq-1)] ; - int recvbuf[maxreq-1][1000*(maxreq-1)] ; + int recvbuf[maxreq][1000*(maxreq-1)] ; int maxirecv = 1 ; int i ; RecvRequestId[0] = -1 ; -- 2.30.2