Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] failure withzero-lengthReduce()andbothsbuf=rbuf=NULL
From: Lisandro Dalcin (dalcinl_at_[hidden])
Date: 2010-02-11 14:14:08

On 11 February 2010 15:06, George Bosilca <bosilca_at_[hidden]> wrote:
> This is absolutely not true. Open MPI supports zero length collective operations (all of them actually), but if their arguments are correctly shaped.

OK, you are right here ...

> What you're asking for is a free ticket to write MPI calls that do not follow the MPI requirements when a special value for count is given.

But you did not answer my previous question... What's the rationale
for requiring sendbuf!=recvbuf when count=0? I would argue you want a
free ticket :-) to put restrictions on user code (without an actual
rationale) in order to simplify your implementation.

> While zero-length arrays/sequence/containers do appears in real code, they are not equal to NULL. If they are NULL, that means they do not contain any useful data, and they don't need to be source or target of any kind of [collective or point-to-point] communications.

Yes, I know. Moreover, I agree with you. NULL should be reserved for
invalid pointers, not for zero-length array... The problem is that
people out there seem to disagree or just do not pay any attention to
this, thus (pointer=NULL,length=0) DO APPEAR in real life (like the
Python example I previously showed you)... Additionally, some time ago
(while discussing MPI_Alloc_mem(size=0)) we commented on the different
return values for malloc(0) depending on the platform...

Well, this discussion got too far... In the end, I agree that
representing zero-length arrays with (pointer=NULL,length=0) should be
regarded as bad practice...

Lisandro Dalcin
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