Received: (from listserv@localhost) by antares.mcs.anl.gov (8.6.10/8.6.10) id OAA03990 for mpi-bind-out; Thu, 25 Jun 1998 14:32:40 -0500 Received: from lsc.nd.edu (lsc.nd.edu [129.74.22.171]) by antares.mcs.anl.gov (8.6.10/8.6.10) with ESMTP id OAA03981 for ; Thu, 25 Jun 1998 14:32:22 -0500 Received: from localhost (jsquyres@localhost) by lsc.nd.edu (8.8.8/8.8.8) with SMTP id OAA14438 for ; Thu, 25 Jun 1998 14:32:18 -0500 (EST) Date: Thu, 25 Jun 1998 14:32:18 -0500 (EST) From: Jeff Squyres To: mpi-bind@mcs.anl.gov Subject: Questions from Michael Holzheu Message-ID: X-URL: http://www.cse.nd.edu/~jsquyres/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-mpi-core@mcs.anl.gov Precedence: bulk Michael Holzheu sent us a few questions about the C++ bindings. I figured that a few others may benefit from the discussion; here is his initial e-mail with Jeremy Siek's reply: ----- > 1. C++ datatypes: > > On page 276 there are described the C++ MPI datatypes COMPLEX,DOUBLE_COMPLEX > and LONG_DOUBLE_COMPLEX. > The corresponding C++ type seems to be the template class "Complex". As far as > I know there does not exist a "standard" > C++ class "Complex" (even not in the Standard Template Library). So I assume > that this should be a user defined class? > If this is true, which memory layout should we assume? > There is a "standard" C++ complex type. It is described in Section 26.2 of the standard. It is in the "numerics" section so it is not part of the "STL". Some compilers support this type, and of course, some do not, in which case the thing to do would be to implement your own version (pretty much just copy the text from the standard) or complain to your compiler company about their lack of standard conformance. One small note: the MPI standard has the C++ complex type capitalized: "Complex". It should be all lowercase. > Are there corresponding MPI-Datatypes MPI_CPP_COMPLEX, ... for the C-bindings? No, this is because there is no "standard" C datatype for complex numbers. > 2. MPI::DUP_FN, MPI::NULL_COPY_FN, ... > On page 346 there are documented the attribute-functions MPI::NULL_COPY_FN, > MPI::DUP_FN, MPI::NULL_DELETE_FN. > I can't see, where these functions are used. For the classes "Comm", "Datatype" > and "Win" there exist MPI::XXX:::NULL_COPY_FN, > MPI::XXX::DUP_FN and MPI::XXX::NULL_DELETE_FN. They are of types > "MPI::XXX::Copy_attr_function" and > "MPI::XXX::Delete_attr_function (p. 200). Perhaps I have missed here something? They are used in the deprecated functions. The typedefs are still there so that the deprecated functions will still work. > 3. Example for language interoperability on p. 53 > > The example on p. 53 does not compile on both OS390 and AIX. When calling > "cpp_lib_call()" a temporary object > of type MPI::Comm is created with use of the constructor MPI::Comm(MPI_Comm&). > If this is passed "call by reference" > the compiler complains, because this object is temporary and it makes no sense > to modify it. The correct example > would be: > > void cpp_lib_call(MPI::Comm cpp_comm) // "call by value" > > or > > void cpp_lib_call(const MPI::Comm& cpp_comm) // "const reference" I agree. We'll get it changed to the call by value (though the const reference would also work). ----- {+} Jeff Squyres {+} squyres@cse.nd.edu {+} Perpetual Obsessive Notre Dame Student Craving Utter Madness {+} "I came to ND for 4 years and ended up staying for a decade"