This web mail archive is frozen.
This page is part of a frozen web archive of this mailing list.
You can still navigate around this archive, but know that no new mails
have been added to it since July of 2016.
Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.
On Fri, May 17, 2013 at 11:00:36AM +0200, Peter van Hoof wrote:
> Dear users,
> I have been banging my head against the wall for some time to find a
> reliable and portable way to determine if a call to
> MPI::File::Open() was successful or not.
Sorry for the long delay in responding
In C, we do it like this:
static void handle_error(int errcode, char *str)
MPI_Error_string(errcode, msg, &resultlen);
fprintf(stderr, "%s: %s\n", str, msg);
errcode = MPI_File_open(MPI_COMM_SELF, filename,
MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL,
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_FILE_OPEN");
With the C++ bindings... ugh what a mess. I had to crack open the
yellow book to find out the answer. But on page 18 it's pretty
Quoting: C++ functions do not return error codes [...]
More Quoting: Advice to Users: C++ programmers that want to handle MPI
errors on their own should use th MPI::ERRORS_THROW_EXCEPTIONS error
handler, rather than MPI::ERROR_RETURN, which is used for that purpose
It's important to note that MPI-IO routines *do* use ERROR_RETURN as
the error handler, so you will have to take the additional step of
Mathematics and Computer Science Division
Argonne National Lab, IL USA