Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Gilles Gouaillardet
Jim, if i understand correctly, George point is that OpenMPI is currently correct with respect to the MPI standard : MPI_DATATYPE_NULL is *not* a predefined datatype, hence it is not (expected to be) a committed datatype, and hence it cannot be used in MPI_Alltoallw (regardless the correspondi

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jeff Hammond
That's ridiculous. You can have 0 of anything. There is absolutely no logical reason why MPI_DATATYPE_NULL should not be valid with count=0. Are you suggesting that one cannot pass buffer=NULL when count=0 either? Jeff On Tue, Jan 12, 2016 at 6:06 PM, George Bosilca wrote: > As JH mentioned

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jim Edwards
Sorry there was a mistake in that code, stypes and rtypes should be of type MPI_Datatype not integer however the result is the same. *** An error occurred in MPI_Alltoallw *** reported by process [204406785,1] *** on communicator MPI_COMM_WORLD *** MPI_ERR_TYPE: invalid datatype On Tue, Jan

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jim Edwards
Maybe the example is too simple. Here is another one which when run on two tasks sends two integers from each task to task 0. Task 1 receives nothing. This works with mpich and impi but fails with openmpi. #include #include my_mpi_test(int rank, int ntasks) { MPI_Datatype stype, rtype;

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Gilles Gouaillardet
+1 FWIW, the trivial patch below does not make the test run because MPI_DATATYPE_NULL is not commited. also, FWIW, this simple test case fails with both OpenMPI and MPICH (and i expected it to work with MPICH) /* * This is a dumb example that sendrecv to/from self * with MPI_DATATYPE_NULL and

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread George Bosilca
As JH mentioned the examples are not normative. The type MPI_DATATYPE_NULL is not part of the MPI predefined datatypes, and as such is not expected to be a commited datatype, thus improper for communications (even when the count is 0). George. On Tue, Jan 12, 2016 at 8:25 PM, Jim Edwards wrot

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jim Edwards
​Hi Gilles, I think that your conversation with Jeff pretty much covered it but your understanding of my original problem is correct. Thanks for the prompt response and the PR. On Tue, Jan 12, 2016 at 5:59 PM, Jeff Hammond wrote: > Consider MPI_Get_accumulate with op=MPI_NO_OP, which is used to

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jeff Hammond
Consider MPI_Get_accumulate with op=MPI_NO_OP, which is used to achieve atomic Get. Obviously, one does not want to allocate and describe a source buffer that will not be touched by this. This is a case like MPI_Alltoallw where (NULL,0,MPI_DATATYPE_NULL) needs to work at participating processes.

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Gilles Gouaillardet
Thanks Jeff, i could not find anything in the standard that says this is an invalid usage ... so i can only agree this is a bug. fwiw, example 4.23 is working fine with OpenMPI but that is a different case : with MPI_Gather and friends, recv stuff is irrelevant on non root task. in the case of MP

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jeff Hammond
Example 4.23 of MPI 3.1 (it is hardly a new example, but may have a different number in older versions) demonstrates the use of (buffer=NULL,count=0,type=MPI_DATATYPE_NULL). While examples in the MPI standard are not normative text, this is certainly a valid use of MPI. I can't find a citation wh

Re: [OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Gilles Gouaillardet
Hi Jim, can you please confirm my understanding is correct : - OpenMPI does *not* accept MPI_DATATYPE_NULL as an input of MPI_Alltoallw - mpich does accept MPI_DATATYPE_NULL as an input of MPI_Alltoallw *if* the corresponding count *is* zero - mpich does *not* accept MPI_DATATYPE_NULL as an inp

[OMPI users] MPI_DATATYPE_NULL and MPI_AlltoallW

2016-01-12 Thread Jim Edwards
Hi, I am using OpenMPI-1.8.3 built with gcc 4.8.3 and I am using an MPI_Alltoallw call to perform an all to some (or some to all) communication. In the case in which my task is not sending (or receiving) any data I set the datatype for that send or recv buffer to MPI_DATATYPE_NULL - this works fi