Boost logo

Boost-MPI :

Subject: Re: [Boost-mpi] Thread API
From: Alain O Miniussi (alain.miniussi_at_[hidden])
Date: 2012-11-29 06:42:47


On Thu, 2012-11-29 at 12:30 +0100, Matthias Troyer wrote:
> On Nov 29, 2012, at 12:06 PM, Alain O Miniussi <alain.miniussi_at_oca.eu> wrote:
>
> > On Wed, 2012-11-28 at 14:22 -0600, Hal Finkel wrote:
> >>> So, to summarize, we have 3 issues:
> >>> 1) syntax: lower vs upper case and mt->threading.
> >>> 2) throw an exception if the requested level is not available
> >>> 3) macro to control availability of MPI[1|2|3] features
> >
> > In the attached patch:
> > 1 -> done
> > 3 -> not done, I think those macro should be introduced separately, not
> > in the same commit.
> > 2 -> done, but more precisely:
> > The ctors that took one level requirement now takes a preferred and a
> > required level. If the required level could not be provided, an
> > exception is thrown from the ctor *after* MPI_Finalize is call.
> > This seems necessary since otherwise, MPI_Abort would get called in the
> > dtor and the application would quit without MPI_Finalize getting called.
> > Also, that behavior introduces an error that does not mirror an MPI
> > error (in the MPI standard). Seems to be the first one, which explain
> > that I modified the exception hierarchy: We now have a base generalist
> > exception class (which only take a message) and an derived api_exception
> > that correspond to the previous exception class (and that contains all
> > the info related with the MPI standard error). Since the code often ask
> > a corresponding MPI error code, I choose to bind it to MPI_SUCCESS by
> > default (indicating that as far as the MPI standard is concerned, there
> > is no problem) api_exception systematically overrides that code.
> >
> > I also added a istream>>level operator, is nothing else, it will enable
> > lexical_cast.
> >
> > Thanks for reading !
>
>
> Hi Alain,
>
> What's the motivation for the hierarchy of exception classes? Where do you need it?

Right now, there is only one class which is tailored to match an MPI
standard error. It provide the MPI routine name, error code and the
message is extracted from MPI error related function.
But here we have an error which does not match and MPI error (requested
threading support is not provided), and have nothing to provide for
those MPI standard error related values. So basically it appears that
the existing exception class matches MPI standard error, but not
BOOST.MPI error (which could be more general).

So here for exemple, I cannot throw an mpi::exception as it is.

So I introduce a general mpi::exception (which does not not provided
much more than an error message) and put most of the existing exception
class in the mpi::api_exception (which matches closely an MPI standard
error).

Alain

> Matthias
>
>
>

-- 
Alain Miniussi
Responsable Tech. Centre de Calcul Haute Performance
Obs. de la Côte d'Azur |Mont Gros: +33 4 92 00 30 09
BP 4229                |Sophia :   +33 4 83 61 85 44
06304 Nice Cedex 4     |https://crimson.oca.eu

Boost-Commit list run by troyer at boostpro.com