There are two types of asynchoronous operation, one provides a notification
when the operation is done, the other doesn't (meaning you have to poll
periodically or you need to wait for the operation to complete). MPI-1
is in the later catagory, after a non-blocking operation, you need to do
a TEST or WAIT to find out whether the operation has succeeded.
In the case of generalized request, the same should hold true. However,
the GR proposal require that the external system does an asynchronous
notification GR_MARK_COMPLETE when the request is done, so you have to
spin a thread to do the polling or waiting.
So instead of a querry_fn which is invoked only for a request that has
completed, can we have a wait_fn and test_fn callback function which
are invoked when MPI_WAIT and MPI_TEST is called.
Example:
MPI_Iwrite(...)
{
aio_write(..., handle);
extra_state.handle = handle;
MPI_Gr_start(wait_fn, test_fn, free_fn, cancel_fn, extra_state, request);
}
test_fn(extra_state)
{
aio_test(extra_state.handle);
}
wait_fn(extra_state)
{
aio_wait(extra_state.handle);
}
This assumes the asynchronous I/O modules make progress independently of MPI.
This probably had shown up before, but I forgot why this is a bad idea.
The MPI-II implementation need to be careful with MPI_WAIT_ANY and call
the test function periodically.
We could keep the MPI_Gr_mark_complete for people that wants to use it.
I would suggest modifying to take a status argument, so once this function
is called, only the free_fn need to be invoked.
MPI_Gr_mark_complete(MPI_Gr_request request, MPI_Status status)
In the case that the external subsystem has can't make progress of its
own, we either say we don't support this, or you need threads to guarantee
progress.
-- parkson
-- Parkson Wong Address: Numerical Aerodynamic Simulation MRJ, Inc. NASA Ames Research Center M/S 258-6 Supercomputer Applications Segment Moffett Field, CA 94035-1000 e-mail: parkson@nas.nasa.gov Phone: (415)604-3988 Fax: (415)966-8669