Date: Mon, 3 Apr 2000 19:04:37 -0500 (EST) From: Jeff Squyres To: mpi-core@XXXXXXXXXXX Subject: MPI_Info / MPI_Win / MPI_File MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-mpi-core@XXXXXXXXXXX Precedence: bulk Greetings. I think that I found an inconsistency in the C++ bindings. Nothing is *wrong*, but I think two C++ bindings are inconsistent with each other. I notice the following prototype: static MPI::Info MPI::Info::Create(...); This is different than the similar binding for MPI_OP_CREATE: void MPI::Op::Init(...); Note that the C/Fortran name is MPI_OP_CREATE, but the C++ binding is MPI::Op::Init. i.e., you're *initializing* an MPI::Op that already exists (and is most likely MPI_OP_NULL). I think that changing the verb was part of the Bindings Police -- use meaningful verbs. You can see the difference a little easier in the usage: -------- // It's easy for MPI::Op MPI::Op myop; myop.Init(...); // For Info, it's uglier MPI::Info myinfo = MPI::Info::Create(...); // Why didn't we do info.Init()? -------- And we say in the standard that the default constructor for MPI::Info (and all MPI:: objects) effectively makes the corresponding MPI_*_NULL object -- so I don't see what we were trying to prevent by having the static Info::Create() function return a copy of a newly initialized object. There is a similar issue for MPI::File::Open and MPI::Win::Create, which are also both static functions. But I think that they were made static so that the Win and File classes wouldn't have to depend on the Intracomm class (the logical choice for the location of the MPI_FILE_OPEN and MPI_WIN_CREATE functions, since windows and files are created from intracommunicators). So potentially independant implementors could write their own implementations while keeping the layering clean and not having to worry about mucking about in the underlying implementation's Intracomm class (e.g., ROMIO). However, there is no such argument for Info. The sample code shown above is both non-intuitive and awkward. A simple "myinfo.Init()" would be much nicer. Comments? BTW, how do we get something into the MPI-2 erratta? {+} Jeff Squyres {+} squyres@XXXXXXXXXX {+} Perpetual Obsessive Notre Dame Student Craving Utter Madness {+} "I came to ND for 4 years and ended up staying for a decade"