Re: MPI_TYPE_DUP (Actually, what I really wanted)

John M May (johnmay@coral.llnl.gov)
Wed, 11 Dec 1996 12:24:10 -0800 (PST)

Rajeev says:
> Well, it seems to me that what you really need is only attribute
> caching on the datatype :-) When the buftype is passed to you for the
> first time, you create whatever extra information out of it and cache
> it on the datatype itself.

Yes, but if there's a public interface for accessing the cache
on the datatype, what prevents the user from messing with your
cached data (accidentally, of course...)? I guess you could
put a magic cookie in your data to make sure it's yours, and
check that there was nothing already cached on the type before
you got it.

> I need MPI_Type_dup for a different reason: The etype and filetype are
> specified only at open time and used thereafter. For safety, I need to
> maintain a copy of them, because the user could free them while the
> file is still open.

I agreee with this.

John

ps. I've redirected this message to mpi-external, since that seems
like a more appropriate list for this discussion.