Hi Ralf, Ralf Wildenhues wrote:
Some MPI implementations require that the thread that called MPI_Init also calls MPI_Finalize. How can this be ensured in this case?
Well, the front-end only calls (via the wrapper) MPI_Finalize for STOP and at the end of the main program. However, the end of the main program cannot be present if the main program is not in Fortran - and if the main program is written in Fortran, it will be MPI_Init. And in case of STOP, if the program exits, there is no chance to leave invoke MPI_Finalize of the original thread. (STOP is the normal termination, ERROR STOP is the error termination.) Thus, I think the code is OK.
Thanks for scrutinizing at the code. Tobias