From: Rolf Rabenseifner Subject: Re: MPI-2 standard issues - MPI_Type_create_f90_... To: Nicholas.Nevin@XXXXXXXXXXXX Date: Fri, 9 Feb 2001 18:01:39 +0100 (CET) Cc: gropp@XXXXXXXXXXX,In-Reply-To: <20010209111839.F20056@XXXX>, 2001 11:18:40 AM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit [I'm splitting the stream by using a new subject] Nick: > > >2. Why the restriction that types obtained from calls to > > >MPI_Type_create_f90_{real,complex,integer} cannot be freed? This > > >restriction doesn't appear to serve any useful purpose and the > > >requirement that MPI_Type_get_envelope return the precision/range used > > >to create such a type seems to either require an implementation to > > >maintain a potentially very large table or allocate dynamic storage > > >(which cannot be freed) to store the precision/range. Bill: > > This looks like a mistake. A correction could say that the type returned > > is effectively a dup of the predefined type, it can (and should be) freed > > by the user, and implementer could use internal attributes to store the > > info needed for MPI_Type_get_envelope. Note that for layered libraries on > > heterogeneous system, it is necessary to provide the features specified for > > MPI_Type_get_envelope. Nick: > I'm happy with such a correction. Sorry, but this would really change the MPI-2 standard. MPI-2 allows to return always the same handle, and not a dup. And to save memory, the best is that - MPI_Type_get_envelope returns the original (predefined) handle and not a dup (no costs!) (--> therefore no reason for freeing it!) - and MPI_Type_create_f90_{real,complex,integer} should check whether it has already returned a predefined handle with the same semantics. May cost typically a small search, because application will not use dozens of such datatypes. For this purpose, you need to link your predefined dataypes in a list or to setup a small hash table. Not more. With this, you have no problem with - the MPI-2 standard (p.295, line 32 "They cannot be freed;") and - the MPI-1 standard (p.8, line 36 "Such objects [predefined opaque objects] may not be destroyed.") Is this okay or have I make a mistake? Rolf Dr. Rolf Rabenseifner High Performance Computing Parallel Computing Center Stuttgart (HLRS) Rechenzentrum Universitaet Stuttgart (RUS) Phone: ++49 711 6855530 Allmandring 30 FAX: ++49 711 6787626 D-70550 Stuttgart rabenseifner@XXXXXXXXXXXXXXXXXXXX Germany http://www.hlrs.de/people/rabenseifner