[mpich2-dev] Fortran, MPI_SEND_INIT, and the Intel test suite
David Gingold
david.gingold at sicortex.com
Mon Jun 9 13:53:41 CDT 2008
MPICH2 folks --
I was chasing a problem in one of the Intel MPI tests, and stumbled
on the following issue. I'm wondering whether it is something that
has come up before.
The test in question (which is fortran/persist_request/functional/
MPI_Send_init_overtake in the Intel test suite) does something like
this:
INTEGER NUMSHORT
PARAMETER (NUMSHORT=20)
INTEGER SHORTB(NUMSHORT)
C
C Send a number of short messages
C
CALL MPI_SEND_INIT(SHORTB(1), 1, MPI_INTEGER, 1, 1,
$ MPI_COMM_WORLD, REQUEST(2), IERR)
DO 200 I=1, NUMSHORT
CALL MPI_START(REQUEST(2), IERR)
CALL MPI_WAIT(REQUEST(2), STAT, IERR)
SHORTB(1) = SHORTB(1) + 1
200 CONTINUE
With the optimizer turned on, our compiler optimizes away the
statement "SHORTB(1) = SHORTB(1) + 1". That causes the test to fail.
Our compiler team tells me that this is a legal optimization for a
Fortran compiler to make. The code has no further references to
SHORTB in this branch, and because MPI_START and MPI_WAIT do not
reference SHORTB, the compiler is allowed to assume that the
statement would have no effect.
If that's correct, then this is an invalid test. But it also
suggests that the Fortran interface for persistent sends is ill-
defined in MPI. The code above is the natural way to use persistent
sends, after all. I think there could also be corresponding trouble
with persistent receives.
-dg
--
David Gingold
Principal Software Engineer
SiCortex
Three Clock Tower Place, Suite 210
Maynard MA 01754
(978) 897-0214 x224
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/mpich2-dev/attachments/20080609/45a26d7f/attachment.htm>
More information about the mpich2-dev
mailing list