I have a Fortran 90 code which uses the MPI library. At the end of the code, I have the following statements to finish the program:
call MPI_Finalize(ierr)
write(6,*) ierr
stop
The code to MPI_Finalize seems to result in an endless loop and the statements which write the ierr flag(which should be zero for each process), do not produce output and the program keeps on running endlessly. The root process writes a file to disk and this is OK before MPI_Finalize is called. What could be the cause of this problem which, by the way, only happens occasionally with our codes ? There is a thread with a similar issue posted on this forum before.