Subject: Re: MPI_INIT; environment information

From: Tony Skjellum <[email-masked]>
Date: Mon, 8 Mar 93 22:56:45 CST

Guys,

What about using envp?  That would provide the Unix-compatible, open-ended
approach to passing information on the environment?  Info could be added etc,
as was suggested as a need.  This is a layerable-friendly approach.

ie, main(argc,argv,envp)
    int argc;
    char **argv;
    char **envp;

1) For Fortran, the getenv_() (or equivalent) call provides the interface.   
   C could use the direct interface to envp, or the getenv() call.  We could
   have mpi_getenv() to avoid conflicts with general system support, if 
   absolutely needed to avoid POSIX interactions.

2) Handling of argc/argv
  A) argc, argv is made accessible to C through standard access.  Made accessible
     to Fortran through accessor functions (eg, mpi_argc(), mpi_argv(i,string,maxlen)).

  B) argc, argv could be obliterated for both models (ie, left empty for C,
     inaccessible to Fortran).  All info through mpi_getenv().

May I throw in a comment about main precursors (niam() in the BBN parlance)?
This is great if supported by the linker, and a pain if not supported by the linker.
If niam() is absent, then the default niam() is added, which just calls main().
If niam() is present, then the user model can choose.  However, what if different
programs presume the abilility to use niam().  They would not stack up...

Without niam(), has to assume preprocessor substitution, or macro
substitution.  This requires that user uses an MPI-compatible make
procedure, or compiler pseudonym, other than naked cc/f**.  This turns
out to be a thorny problem to handle transparently.

Also, the execution model of the CM-5, for instance, does not [did not] require
main to exist at all.  Execution of arbitrary functions (not only main) is supported
by CMMD 2.0, specifically.  I don't know what CMMD 3.0 chooses to do, but you
get the idea.  main/program main access is an assumption true most everywhere,
but not everywhere.

- Tony