No, we do not need to force the compiler to store back all
from the registers to the memory, because all variables,
that are used in the argument list of a subroutine call,
are written back to the memory before the subroutine is called.
Therefore, the problem arises very seldom.
> If this is not so, then blocking and nonblocvking send and
> receives will not work as well.
In blocking operations there is no problem.
In nonblocking send the application writes automatically all
data to the memory because the buffer is part of the
argument list.
But you are right, in nonblocking receives we have the same
problem. This is the case where we made our experience in
the DFN-RPC project.
The sentence MPI 1.1 page 40 lines 47-48
"The receiver should not access any part of the receive buffer
after a nonblocking receive operation is called, until the
receive completes."
should be changed into (see Annex)
"The receiver must not ..."
Kind regards
Rolf
---------------------------------------------------
Annex
awsws6 39% uname -a
ULTRIX awsws6.rus.uni-stuttgart.de 4.3 0 RISC
awsws6 40% cat ircv_test_main.f
program volatest
integer buffer2
volatile volabuffer
integer volabuffer
integer new_volabuffer
integer buffer
integer new_buffer
volabuffer = 11
write (*,*) 'volabuffer=',volabuffer
call mpi_ircv(volabuffer)
C - here the programmer wants to test in some way if
C there is already a new value in the buffer
buffer2 = volabuffer
call mpi_wait
new_volabuffer = volabuffer
write (*,*) 'new_volabuffer=',new_volabuffer
write (*,*) 'buffer2 =',buffer2
buffer = 44
write (*,*) 'buffer=',buffer
call mpi_ircv(buffer)
C - here the programmer wants to test in some way if
C there is already a new value in the buffer
buffer2 = buffer
call mpi_wait
new_buffer = buffer
write (*,*) 'new_buffer=',new_buffer
write (*,*) 'buffer2 =',buffer2
stop
end
awsws6 41% f77 -c ircv_test_main.f
awsws6 42% cat ircv_test_sub.f
subroutine mpi_ircv(buf)
integer buf_addr
common /bbb/ buf_addr
buf_addr = loc(buf)
return
end
subroutine mpi_wait
integer buf_addr
common /bbb/ buf_addr
integer mem(1), mem_addr
mem_addr = loc(mem)
write(*,*) ' mpi_wait old value=',mem(1+(buf_addr-mem_addr)/4)
mem(1+(buf_addr-mem_addr)/4) = 9000
write(*,*) ' mpi_wait new value=',mem(1+(buf_addr-mem_addr)/4)
return
end
awsws6 43% f77 -c ircv_test_sub.f
awsws6 44% f77 -o ircv_test ircv_test_main.o ircv_test_sub.o
awsws6 45% ircv_test
volabuffer= 11
mpi_wait old value= 11
mpi_wait new value= 9000
new_volabuffer= 9000
buffer2 = 11
buffer= 44
mpi_wait old value= 44
mpi_wait new value= 9000
new_buffer= 44 ! here one expects 9000 !!!
buffer2 = 44
awsws6 46%
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