[mpich-discuss] MPI_GET_COUNT behaviour unclear

Wei-keng Liao wkliao at ece.northwestern.edu
Tue Dec 15 10:30:09 CST 2009


The "the number of entries received" is returned in the argument  
"count".
So, if you check the value of "count", it should be 2 in your case.

As for the return value of function MPI_Get_count(), it is the status
of the call, such as MPI_SUCCESS, which may be defined as constant 1.

Wei-keng

On Dec 15, 2009, at 6:18 AM, Tamás Faragó wrote:

> I have a question about MPI_GET_COUNT and MPI_GET_ELEMENTS. What do  
> these functions exactly return?
>
> As I have read from the documentation (3.2.5) MPI_GET_COUNT returns  
> the count of 'entries' of type 'datatype' received. According to me  
> in example 4.12 (line 13) MPI_GET_COUNT should return 2 as we have  
> sent two MPI_REAL types. The example however shows 1. Is this  
> because as at when you send 2 types MPI transparently creates a new  
> custom datatype (4.1.11) consisting of these two elements and thus  
> the top-entry is 1?
>
> This, however should suggest that MPI_GET_COUNT always returns 1, or  
> MPI_UNDEFINED on an error (eg unmached receive count or type). Is  
> this correct?
>
> MPI_GET_ELEMENTS than receives what?
>
> How is the example (4.12) even working correctly when a custom  
> datatype Type2 consists of two MPI_REALs and you want to receive two  
> of those, eg 4 MPI_REALs?
>
> I am using the MPI 2.1 documentation (http://www.mpi-forum.org/docs/docs.html 
>  in hardcover)
>
> Regards, Thomas
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list