Newsgroups: comp.parallel.mpi
From: dbc@ecs.soton.ac.uk (Bryan Carpenter)
Subject: Re: MPI_Finalize necessary ?
Organization: Electronics and Computer Science, University of Southampton
Date: 8 Sep 95 15:51:35 GMT
Message-ID: <dbc.810575495@euclid>

In <FURNISH.95Sep5132513@dino.ph.utexas.edu> furnish@dino.ph.utexas.edu (Geoffrey Furnish) writes:
>[...]  For example, in C++, you could easily imagine
>an MPI parallel framework class along the lines of:

>class MPI_App {
>...
>public:
>    MPI_App(...) {
>	MPI_Init(...);
>    }
>    ~MPI_App() {
>	MPI_Finalize();
>    }
>};

>(with other methods to suit your model, of course).  In this way, a
>C++ user would not have to know anything about MPI_Finalize either,
>since it is handled automatically in the application destructor.

Oh good.  This gives me another opportunity to whinge about my least
favourite feature in MPI.

Personally I would love to do something along the lines you describe.
*But* `MPI_Init' takes `argc' and `argv' as arguments...  (Arghh...)
So the the constructor for `MPI_App' has to take these as arguments.
So the object of type `MPI_App' would have to be declared in the main
program (and passed about to other routines if they had to apply
methods to it).

What I really want is to have a *static* variable, something like

  MPI_App mpi_app ;

defined somewhere in a library.  Then the constructor and destructor
for this global object initialise and finalise MPI.  But it can't be
done because the constructor wouldn't be able to get at the command
line arguments.

Bryan

_____________________________________________________________________________
HPC Centre                                      Tel: (+44) 01703 593368
University of Southampton                       Fax: (+44) 01703 593045
Southampton, S017 1BJ                           Email: dbc@ecs.soton.ac.uk
England, UK                                 WWW URL: http://hpcc.soton.ac.uk/
_____________________________________________________________________________




