Received: (from listserv@localhost) by antares.mcs.anl.gov (8.6.10/8.6.10) id IAA14529 for mpi-bind-out; Mon, 23 Nov 1998 08:08:11 -0600 Received: from breeze.cs.wisc.edu (breeze.cs.wisc.edu [128.105.75.36]) by antares.mcs.anl.gov (8.6.10/8.6.10) with ESMTP id IAA14523 for ; Mon, 23 Nov 1998 08:08:01 -0600 Received: (from lederman@localhost) by breeze.cs.wisc.edu (8.8.6/8.8.6) id IAA26217; Mon, 23 Nov 1998 08:07:56 -0600 (CST) Date: Mon, 23 Nov 1998 08:07:56 -0600 (CST) Message-Id: <199811231407.IAA26217@breeze.cs.wisc.edu> From: Steve Huss-Lederman To: mpi-bind@mcs.anl.gov Subject: C++ comments on MPI-2 Sender: owner-mpi-core@mcs.anl.gov Precedence: bulk X-UIDL: 5266a9623dc13804b2d18a94a7868e6c These comments recently came to the official MPI Forum comment address. I wanted to hear what people thought before I responded. Steve ------- Start of forwarded message ------- From: jeremy siek Date: Wed, 18 Nov 1998 15:38:02 -0500 (EST) X-Authentication-Warning: philoctetes.lsc.nd.edu: jsiek set sender to Jeremy Siek using -f MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: mpi-comments@mpi-forum.org CC: mpi2c++@mpi.nd.edu Subject: C++ bindings errata X-Mailer: VM 6.40 under Emacs 19.34.1 Reply-To: Jeremy Siek Sender: owner-mpi-comments@mcs.anl.gov Precedence: bulk Hello, I'm passing along some problems in the C++ bindings discovered by Michael Holzheu. 1. Some constants conflict with common macros such as SEEK_SET, which is only a problem in the C++ bindings because of the way namespace is used. The names of these constants should be changed. 2. p334/p116 The first parameter of MPI::Win::Get(const void * origin_addr, ...); should not be declared const. 3. p253/p341: The return type of "MPI::Datarep_conversion_function()" and "MPI::Datarep_extent_function()" is not specified, it should be void (exceptions are used instead of error codes in the C++ bindings). 4. p204/p337: The first parameter in MPI::Win::Get_attr(const MPI::Win& win, ...); should be removed. 5. p346: MPI::ERRHANDLER_NULL should be declared const. Regards, Jeremy Siek > > Hallo! > > Since we had some trouble with our mail system this week, I am not sure, if you > got my last mail. > So I resend it to be sure. > > Michael > > PS: I have one additional point: > > Is there a reason, why only in the user callback > "MPI::Datatype::Copy_attr_function(..., >>> const <<< void* attrib_val_in , > ...) the > parameter "attrib_val_in" is of type ">>> const <<< void*"? The other two copy > callbacks > - "MPI::Comm::Copy_attr_function()" and > - "MPI::Win::Copy_attr_function" > are declared without "const". ( p341) > > Regards > > Michael > > ----------------------------------------------------------------------------------------------- > > Hallo again! > > I have some more open questions and remarks regarding the C++ bindings. The > page numbers refer to the MPI-2 document: > > 1. Another general problem with C++ MPI constants: > Because the C++ constants do not have the "MPI_" prefix the risk is > quite high that we get conflicts between C++ constants in mpi.h and > macros (with #define) in standard include files. I realized this > problem for the constants SEEK_SET, SEEK_CUR and SEEK_END (MPI-IO) > which are also defined in "stdio.h". If the user includes "stdio.h" > before "mpi.h", e.g. SEEK_SET in "mpi.h" > is replaced with the value of SEEK_SET from "stdio.h" and a compile > error occurs. > Even more seriously the preprocessor replaces "SEEK_SET" in the string > "MPI::SEEK_SET" > with the definition in "stdio.h". So the MPI programmer cannot use > "MPI::SEEK_SET" > together with "stdio.h". > > Example: > > stdio.h: > #define SEEK_SET 0 > > User programm: > MPI::SEEK_SET ---> Preprocessor --> MPI::0 > > When "MPI::" is implemented with real namespaces, the programmer will > not even realize at compile time that > SEEK_SET from "stdio.h" is used, if he uses "SEEK_SET" without the > "MPI::" suffix. > > Is this a known problem? Do you know a solution to bypass it? The only > solution I see at the moment is to #undef SEEK_SET, but > of course this is not a real solution. > > 2. p334/p116: > I think that the first parameter of MPI::Win::Get(const void * > origin_addr, ...) must not be declared as const > > 3. p253/p341: > The return type of "MPI::Datarep_conversion_function()" and > "MPI::Datarep_extent_function()" is not specified: > Probably the return type should be "int". > > 4. p204/p337: > I think that in MPI::Win::Get_attr(const MPI::Win& win, ...) the first > parameter must be removed > > 5. p346: > MPI::ERRHANDLER_NULL is defined as MPI::Errhandler and not as >>> const > <<< MPI::Errhandler. > I see no reason, why MPI::ERRHANDLER_NULL should not be const. Is there > a reason? > > 6. In your implementation you did not declare MPI::REQUEST_NULL as const. It > is declared as const on p346. > > And one really tiny thing: > > 7. p235: > I think better would be to write: "MPI::File::Get_byte_offset(const > Offset >>>> offset <<<<) const" ---> not >>> disp <<< > > > > Regards > > Michael > > ------------------------------------------------------------------------ > OS/390 USS Parallel Environment Development > Phone: +49-7031-16-2360, Fax -4240, Bld 71032-14-126 > Email: holzheu@de.ibm.com > - ------------------------------------------------------------------------ Jeremy Siek Graduate Research Assistant email: jsiek@lsc.nd.edu Dept. Comp. Sci. & Eng. phone: (219) 631-3906 325 Cushing Hall fax: (219) 631-9260 University of Notre Dame www: http://www.lsc.nd.edu/~jsiek/ Notre Dame, IN 46556 - ------------------------------------------------------------------------ ------- End of forwarded message -------