Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] MPI_Send, MPI_Recv problem on Mac and Linux
From: Jeffrey Squyres (jsquyres_at_[hidden])
Date: 2012-04-18 08:17:07

On Apr 18, 2012, at 3:15 AM, Peter Sels wrote:

> I suppose with C++ MPI it's possible to enforce more strict type
> checking using template or so.)

Not really, unfortunately. :-(

The idea is to be able to send *anything* through the (void*) choice buffer designation -- that includes even sending a pointer address if you want to. We also wouldn't want to restrict the choice buffer to known/pre-defined data types, because then you couldn't send user-defined structs and the like. The Forum also explicitly rejected enforcing hierarchy (a la Java, where every sendable item must be derived from a common ancestor).

For example, it may actually be *useful* to send a pointer address via MPI_SEND. Granted, a pointer address is usually only valid locally, but:

- maybe you're sending a pointer address to a shared memory location, and it could be valid in another remote process
- maybe you're sending a pointer address so that it can be echoed back to you later (e.g., as a context)
- ...

Jeff Squyres
For corporate legal information go to: