Dear Gabriele,

to the best of my knowledge the MPI standard does not provide such a function. The reason is that when calling MPI_Gather, the standard requires matching type signatures (i.e., the sendcount and sendtype argument on each of the non root processes must match the recvcount and recvtype arguments at the root process). This still allows having disting type maps (type and displacement pairs) at a sender process and at the root process, but it is a feature seldom used in practice, at least in my experience.

Therefore, you must know in advance the datatype you are receiving even in the case this datatype is a derived datatype. If not, the likely outcome is that the receive buffer at the root process gets overwritten, which causes MPI_Gather to return an error.

Due to the signature of the MPI_Gather function, the only possibility I see to achieve what you are trying to do is to use the MPI_BYTE datatype, and use the communicator argument to distinguish between a collective gather in which you receive MPI_INT, MPI_DOUBLE etc. Of course I would not create nor recommend to create new communicators for this purpose only.

Kind regards,
Massimo

On 30/mar/09, at 17:43, Gabriele Fatigati wrote:

Dear OpenMPI developers,
i'm writing an MPI_Gather wrapper to collect void elements. My
queation is: is there a portable way to know the type of received
elements, like MPI_INT or MPI_DOUBLE? I've noted that i can retrieve
this information by ompi_datatype_t-> name field, but i think isn't
portable. Is there aMPI function that does this check?

--
Ing. Gabriele Fatigati

Parallel programmer

CINECA Systems & Tecnologies Department

Supercomputing Group

Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy

www.cineca.it                    Tel:   +39 051 6171722

g.fatigati [AT] cineca.it
_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users



--

*******************************************************************************************************

Massimo Cafaro, Ph.D. Additional affiliations: Assistant Professor National Nanotechnology Laboratory (NNL/CNR-INFM) Dept. of Engineering for Innovation Euro-Mediterranean Centre for Climate Change
 University of Salento, Lecce, Italy            SPACI Consortium
 Via per Monteroni                                        E-mail 
massimo.caf...@unisalento.it
 73100 Lecce, Italy                                                             
        caf...@ieee.org
 Voice  +39 0832 297371                                                         
        caf...@acm.org
 Fax +39 0832 298173
 Web     http://sara.unisalento.it/~cafaro

*******************************************************************************************************



Reply via email to