Skip Menu |

This queue is for tickets about the Parallel-MPI-Simple CPAN distribution.

Report information
The Basics
Id: 90825
Status: new
Priority: 0/
Queue: Parallel-MPI-Simple

People
Owner: Nobody in particular
Requestors: matthieu.volat [...] ujf-grenoble.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Recv and MPI_ANY_SOURCE
Date: Tue, 26 Nov 2013 12:16:07 +0100
To: bug-Parallel-MPI-Simple [...] rt.cpan.org
From: Matthieu Volat <matthieu.volat [...] ujf-grenoble.fr>
Hi, I've noticed the logic behind Recv() in the perl module is to do 2 MPI_Recv() to get first an integer for the size of the perl scalar, then the scalar itself. But both MPI_Recv() calls use the same source and tags arguments, so if you use the ANY_SOURCE source control, the function may mix unrelated messages and fails. The problem can simply be fixed by binding the 2nd MPI_Recv() to the source/tag of the first one: --- Simple.xs.orig 2013-11-26 11:32:16.169406199 +0100 +++ Simple.xs 2013-11-26 11:32:51.863960405 +0100 @@ -68,7 +68,7 @@ MPI_Recv(len_buf, 1, MPI_INT, source, tag, (MPI_Comm)SvIVX(comm), &tstatus); recv_buf = (char*)malloc((len_buf[0]+1)*sizeof(char)); if (recv_buf == NULL) croak("Allocation error in _Recv"); - MPI_Recv(recv_buf, len_buf[0], MPI_CHAR, source, tag, + MPI_Recv(recv_buf, len_buf[0], MPI_CHAR, tstatus.MPI_SOURCE, tstatus.MPI_TAG, (MPI_Comm)SvIVX(comm), &tstatus); rval = newSVpvn(recv_buf, len_buf[0]); sv_setiv(status, tstatus.MPI_SOURCE); -- Matthieu Volat <matthieu.volat@ujf-grenoble.fr> Ingénieur de Recherche CNRS ISTerre - Institut des Sciences de la Terre Université Joseph Fourier, Grenoble
Download signature.asc
application/pgp-signature 841b

Message body not shown because it is not plain text.