Re: new version of threads section

Eric Salo (salo@mrjones.engr.sgi.com)
Fri, 14 Mar 1997 15:35:53 -0800

> Next message will contain postscript for a new version of the thread
> version. I streamlined the initialization part. We now have new
> MPI_THRAD_INIT and MPI_THREAD_INITIALIZED that can be used instead of
> MPI_INIT and MPI_INITIALIZED to initilize MPI, thread environment included.
> This avoids some possible races and is cleaner.

I really like defining the new MPI_THREAD_INIT() routine as an alternative to
MPI_INIT(). Some random thoughts:

- What happens if MPI is unable to provide the requested level of strictness?
Is this an error?

- The names for the different degees of strictness are a bit of a mess; it
would not be immediately obvious to the casual observer that they are related.
So I would propose the following (still imperfect) names instead:

MPI_THREAD_SINGLE
MPI_THREAD_MULTIPLE_MAIN
MPI_THREAD_MULTIPLE_ONE
MPI_THREAD_MULTIPLE_MANY
MPI_THREAD_QUERY (see below)

I think it would also be nice if we specified that these values should
translate to integers with increasing values, so that programmers can just use
a simple greater-than/less-than test instead of a switch/case statement.

- Adding yet another flavor of MPI_INITIALIZED() is ugly, especially since it
breaks the symmetry that we just gave ourselves by adding MPI_FINALIZED().
Instead, I propose that we add a MPI_THREAD_QUERY value, which simply asks
MPI_THREAD_INIT() to return the current level of strictness, or MPI_UNDEFINED
if MPI has not yet been initialized.

- The new MPI_THREAD_MAIN() routine should more properly be named
MPI_THREAD_IS_MAIN()

- Let's do keep the argc/argv arguments out, please!

-- 
Eric Salo    Silicon Graphics Inc.    salo@sgi.com