Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Unexpected compile error setting FILE_NULL Errhandler using C++ Bindings
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-03-25 20:07:34


This whole issue came up recently in the MPI Forum (the const-ness [or
not] of the MPI C++ objects). I am a fervent believer that all the
predefined C++ MPI objects should be const and that any MPI function
that allows predefined handles as an argument should be a const
argument.

This got deferred to MPI 2.2, however, meaning that there won't be
resolution in the near future. :-\

FWIW, I have File::Set_errhandler "fixed" in the OMPI SVN trunk (for
the upcoming v1.3 series) to allow MPI::FILE_NULL, in anticipation of
the Forum agreeing to make everything sane. :-)

On Mar 20, 2008, at 12:54 PM, Eidson, Eric D wrote:
> Hello,
>
> OpenMPI 1.2.5 and earlier do not let you set the Errhandler for
> MPI::FILE_NULL using the C++ bindings.
>
> [You would want to do so because, on error, MPI::File::Open() and
> MPI::File::Delete() call the Errhandler associated with FILE_NULL.]
>
> With the C++ bindings, MPI::FILE_NULL is a const object, and
> Set_errhandler
> is apparently a non-const function -- so compiling fails.
>
> Eric
>
> --
>
> #include <mpi.h>
>
> int
> main()
> {
> MPI::Init();
>
> MPI::Errhandler oldeh = MPI::FILE_NULL.Get_errhandler();
> MPI::FILE_NULL.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS);
> MPI::FILE_NULL.Set_errhandler(oldeh);
>
> MPI::Finalize();
> }
>
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
Cisco Systems