Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] How to "guess" the incoming data type ?
From: Jed Brown (jed_at_[hidden])
Date: 2010-04-26 12:13:06

On Sun, 25 Apr 2010 20:38:54 -0700, Eugene Loh <eugene.loh_at_[hidden]> wrote:
> Could you encode it into the tag?

This sounds dangerous.

> Or, append a data type to the front of each message?

This is the idea, unfortunately this still requires multiple messages
for collectives (because you can't probe for a suitable buffer size, and
no dynamic language will be happy with "the buffer can be anything as
long as it's type is in this list and the total number of bytes is N").

This file is a pretty easy to read reference for a friendly MPI in
dynamic language:

Note that mpi4py also exposes the low-level functionality. Numpy arrays
can be sent without pickling:

Something that could be done to prevent packing in some cases is to
define an MPI datatype for the send and receive types, but this will
usually require an extra message because the receiver has to wire up an
empty object that is ready to receive the incoming message.