BUMP. See http://code.google.com/p/mpi4py/issues/detail?id=14
On 12 December 2009 00:31, Lisandro Dalcin <dalcinl_at_[hidden]> wrote:
> On Thu, Dec 10, 2009 at 4:26 PM, George Bosilca <bosilca_at_[hidden]> wrote:
>> Lisandro,
>>
>> This code is not correct from the MPI standard perspective. The reason is independent of the datatype or count, it is solely related to the fact that the MPI_Reduce cannot accept a sendbuf equal to the recvbuf (or one has to use MPI_IN_PLACE).
>>
>
> George, I have to disagree. Zero-length buffers are a very special
> case, and the MPI std is not very explicit about this limit case. Try
> the code pasted at the end.
>
> 1) In Open MPI, the only one of these failing for sbuf=rbuf=NULL is MPI_Reduce()
>
> 2) As reference, all the calls succeed in MPICH2.
>
>
>
> #include <mpi.h>
> #include <stdlib.h>
>
> int main( int argc, char ** argv ) {
> Â int ierr;
> Â MPI_Init(&argc, &argv);
> Â ierr = MPI_Scan(
> Â Â Â Â Â Â Â Â Â NULL, NULL,
> Â Â Â Â Â Â Â Â Â 0,
> Â Â Â Â Â Â Â Â Â MPI_INT,
> Â Â Â Â Â Â Â Â Â MPI_SUM,
> Â Â Â Â Â Â Â Â Â MPI_COMM_WORLD);
> Â ierr = MPI_Exscan(
> Â Â Â Â Â Â Â Â Â Â NULL, NULL,
> Â Â Â Â Â Â Â Â Â Â 0,
> Â Â Â Â Â Â Â Â Â Â MPI_INT,
> Â Â Â Â Â Â Â Â Â Â MPI_SUM,
> Â Â Â Â Â Â Â Â Â Â MPI_COMM_WORLD);
> Â ierr = MPI_Allreduce(
> Â Â Â Â Â Â Â Â Â Â Â NULL, NULL,
> Â Â Â Â Â Â Â Â Â Â Â 0,
> Â Â Â Â Â Â Â Â Â Â Â MPI_INT,
> Â Â Â Â Â Â Â Â Â Â Â MPI_SUM,
> Â Â Â Â Â Â Â Â Â Â Â MPI_COMM_WORLD);
> #if 1
> Â ierr = MPI_Reduce(
> Â Â Â Â Â Â Â Â Â Â NULL, NULL,
> Â Â Â Â Â Â Â Â Â Â 0,
> Â Â Â Â Â Â Â Â Â Â MPI_INT,
> Â Â Â Â Â Â Â Â Â Â MPI_SUM,
> Â Â Â Â Â Â Â Â Â Â 0,
> Â Â Â Â Â Â Â Â Â Â MPI_COMM_WORLD);
> #endif
> Â MPI_Finalize();
> Â return 0;
> }
>
>
>
> --
> Lisandro DalcÃn
> ---------------
> Centro Internacional de Métodos Computacionales en IngenierÃa (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria QuÃmica (INTEC)
> Consejo Nacional de Investigaciones CientÃficas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
>
--
Lisandro DalcÃn
---------------
Centro Internacional de Métodos Computacionales en IngenierÃa (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria QuÃmica (INTEC)
Consejo Nacional de Investigaciones CientÃficas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
|