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: 11 Sep 95 09:22:07 GMT
Message-ID: <dbc.810811327@euclid>

In <DELy22.Exz@taurus.cs.nps.navy.mil> george@holmes.cs.nps.navy.mil (Robert George) writes:

>Bryan,
>     Why don't you just do something like:

>class MPI_App {
>// Set as protected if derived classes need the command line
>    int  argc;
>    char *argv[];
>public:
>    MPI_App(int num_args, char *arg_vec[]) : argc(num_arg), argv(arg_vec)
>    {
>	MPI_Init(&argc, &argv);
>    }
>    ~MPI_App()
>    {
>	MPI_Finalize();
>    }
>};

>...and have your user application inherit from MPI_App?

>Granted, you will have to instantiate MPI_App in main(), but so what?

My library is written in C++.  The user's main program is typically
written in Fortran.  There's no *portable* way of getting at argc/argv
from Fortran.

Bryan


