I have a very basic Fortran program to try to learn MPI. I'm compiling this script using Visual Studio 2019, MPICH2 and the Intel oneAPI Toolkit. The program is the following
program hello
implicit none
include 'mpif.h'
integer :: rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print *, "node", rank, "says Hello World!"
call MPI_BARRIER(MPI_COMM_WORLD, ierror)
call MPI_FINALIZE(ierror)
! here
end program hello
This program compiles and runs as expected, producing the output
PS C:\Users\gf715\Documents\VS_testing\test\Debug> mpiexec -n 4 test.exe
node 1 says Hello World
node 2 says Hello World
node 3 says Hello World
node 0 says Hello World
However, if I add a stop
statement before ending the program (where I have written the "here" comment), the code will still compile, but now produces no output when I run it:
PS C:\Users\gf715\Documents\VS_testing\test\Debug> mpiexec -n 4 test.exe
PS C:\Users\gf715\Documents\VS_testing\test\Debug>
I don't remember having this problem before I used the Intel oneAPI toolkit (I used to use the same setup, but with Parallel Studio XE Cluster Edition, I was forced to change when my license expired).
Why does the stop
prevent any output?