Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] printing text fixes a problem?
From: abc def (cannonjunk_at_[hidden])
Date: 2011-02-01 02:40:19


I'm having trouble with some MPI programming in Fortran, using openmpi.
It seems that my program doesn't work unless I print some unrelated text to the screen. For example, if I have this situation:

*** hundreds of lines cut ***
IF (irank .eq. 0) THEN
    CALL print_results1(variable)
    CALL print_results2(more_variable)
print *, "done", irank
END PROGRAM calculation

The results are not printed unless I include this "print done irank" penultimate line.
Also, despite seeing that all ranks reach the print statement, the program hangs, as if they have not all reached MPI_FINALIZE.

Can anyone help me? Why does it do this?

I also had many times where the program would crash if I didn't include a print statement in a loop. I've been doing Fortran programming for a while, and this is my nightmare debugging scenario since I've never been able to figure out why the simple printing of statements magically fixes the program, and I usually end up having to go back to a serial solution, which is really slow.

If anyone might be able to help me, I would be really really grateful!!

Thank you.