I have two problems with the thread section:
1. I'm sorry, but for me the interface of MPI_THREAD_QUERY/INIT
and "nonstandard mechanism to initialize the thread environment"
looks not very clear.
2. How do we handle the malloc-problem? (On the next mail)
To 1. the interface of MPI_THREAD_QUERY/INIT
--------------------------------------------
It mixes "functionality that is supported by an MPI-implementation"
with "functionality that the application wants to use".
Examples:
a. MPI-impl. supports only that MPI calls are done only from the
main thread;
the application wants to use threads and will call MPI only
from the main thread.
--> The user has to say by the "nonstandard mechanism to
initialize the thread environment" (p.4 l.15ff)
that he/she wants this case
b. same as a., but the application does not want to use threads
--> the user has to say this by using the "nonstandard mechanism
to initialize the thread environment"
c. same as a., but the MPI-impl. is full thread compliant
Two differnt possibilities for the user:
--> same as in a.
--> Saying nothing by the "nonstandard mechanism to
initialize the thread environment" and the MPI-impl.
returns MPI_MULTIPLE_THREADS on a call to MPI_THREAD_QUERY and
the application has to call MPI_THREAD_INIT(MPI_SINGLE_THREAD)
I believe that users do not like "nonstandard mechanisms"!!!!
Other examples:
- 3:29 the meaning of "initialized for a single mpi thread execution"
is not defined, but 4:12 may imply that you mean:
MPI routines must be called only from the main thread (defined 2:17)
- the functionality
"MPI calls are done from each thread but the application
guarantees that never two MPI routines are running in parallel
(e.g. by apprpriate usage of pthread_create and pthread_join)"
cannot be defined as a
"functionality that is supported by an MPI-implementation"
nor as a
"functionality that the application wants to use"
Therefore I propose the following alternative and I hope I can
convince you:
MPI_THREAD_QUERY( OUT supported,
OUT initialized)
MPI_THREAD_INIT ( IN initialize)
with "supported" returns the "functionality that is supported by
the underlying MPI implementation"
and "initialized" returns the value of used in a previous call to
MPI_THREAD_INIT,
or returns MPI_THREADS_NOT_INITIALIZED
and "initialize" gives the "functionality that the application
wants to use"; the value must be less or equal
the value of "supported"
The infokey "thread_support" is defined along with the values below
(as string) to reduce the supported thread functionality to a
smaller functionality while initiating MPI processes with
mpiexec or MPI_SPAWN.
Functionalities are (increasing order!)
MPI_THREADS_NOT_SUPPORTED
MPI_MPI_CALLS_ONLY_FROM_MAIN_THREAD
MPI_MPI_CALLS_ONLY_FROM_ONE_THREAD
MPI_MPI_NOT_CALLED_FROM_PARALLEL_THREADS
MPI_MULTIPLE_THREADS
Application typically are interested in
MPI_THREADS_NOT_SUPPORTED, MPI_MPI_CALLS_ONLY_ON_MAIN_THREAD,
MPI_MPI_CALLS_NOT_IN_PARALLEL_THREADS and MPI_MULTIPLE_THREADS.
But if there is at least one
vendor who supports MPI_MPI_CALLS_ONLY_ON_ONE_THREAD
but does not support MPI_MPI_CALLS_NOT_IN_PARALLEL_THREADS
then we should not eliminate MPI_MPI_CALLS_ONLY_ON_ONE_THREAD
(otherwise we can eliminate it).
Pros:
- not more complicated
- no nonstandardized APIs
- a clear way for implementors and application programmers
- MPI implementations that support only MPI calls from
a single threads or not in parallel, are not discriminated
by this interface
Rolf
Rolf Rabenseifner (Computer Center )
Rechenzentrum Universitaet Stuttgart (University of Stuttgart)
Allmandring 30 Phone: ++49 711 6855530
D-70550 Stuttgart 80 FAX: ++49 711 6787626
Germany rabenseifner@rus.uni-stuttgart.de