>Right now MPI_Init involves all the processes.
This is still true, but the number of processes started is one
AND (and this is the big AND) the process was not started with
any hints for what to use for nprocs.
>If arbitrary numbers of processes can call
>MPI_Init, how does it know the number involved?
Think about what happens presently. When a task calls
MPI_INIT it first checks (in some implementation dependent way)
for the value of nprocs (the eventual size of COMM_WORLD)
This value can be 1, in which case the process forms a
COMM_WORLD = COMM_SELF and proceeds on its merry way.
If the value is > 1, then the task waits in some collective
operation to sync up with the specified number of other tasks.
(Note that if one of these tasks fails before reaching its MPI_INIT
all the remaining tasks will deadlock in the MPI_INIT --
ouch! just thought of that)
What I want to do is define the behavior of MPI_INIT
when the task calls it and finds nproc undefined.
All existing implementations define nproc so my proposal
doesn't affect any MPI programs that presently work.
I propose that the behavior of MPI_INIT
if it finds nproc undefined, to be to set nproc=1
Seems simple enough, but this simple addition gives
programmers the powerful ability to turn an ordinary process
into an MPI process. In MPI-1 this would have been nearly useless.
But in MPI-2 where a task can SPAWN other tasks
this ability opens up lots of possibilites.
Does this make it any clearer?
ps. I applogize if someone or sometwenty have already answered.