[mpich-discuss] Existence of something like MPI_Type_compare()?

Jed Brown jedbrown at mcs.anl.gov
Tue Dec 13 15:28:58 CST 2011


On Tue, Dec 13, 2011 at 13:17, Eric A. Borisch <eborisch at ieee.org> wrote:

> FWIW, I've had good luck using boost::shared_ptr<MPI_Datatype_wrapper>
> where MPI_Datatype_wrapper is a tiny class that handles retention (via
> MPI_Type_dup) and release (MPI_Type_free) ...
>
> In my own (user-facing) type creation function I cache the function
> arguments -> shared_ptr mapping in a fixed-size least-recently-used
> container. The shared_ptr is the only thing returned to the calling
> program, so no MPI_Type_* calls of any kind are required to return a
> cache hit.
>

Hi, thanks. I don't want to expose anything additional to the user and I
want to tolerate the user who calls MPI_Type_create_struct(), my functions,
then MPI_Type_free() every time step to create the type for their small
structure. I don't want the cache to be based on the references (your
"cache the function arguments" or Rajeev's suggestions for using keyvals to
make the comparison more robust against false positives).

I've looked at the code that others have sent in this thread and put
together something based on unwrapping types with a few short-circuit
possibilities. I'll come back if I get stuck again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20111213/a7fe636b/attachment.htm>


More information about the mpich-discuss mailing list