If I compile and run
print*, 1/0 end program
with ifort then I get a division by zero error with an exit status of 2 (echo $?), as expected. However, If I compile using ifort -coarray=shared then I still get the error but now the exit status is 0. Is this a compiler bug? Each image seems to produce the correct exit code, but the exit code somehow doesn't propagate through the wrapper executable which launches the MPI processes.
Here's the long version of the problem: http://stackoverflow.com/questions/25912031/ifort-coarray-shared-produces-incorrect-exit-status
I don't consider this a bug. What should happen if image 1 exits with status 3 and image 2 with status 4? What would you expect the executable to return?
I submitted a request to the developers, issue DPD200361211, that at least the ERROR STOP stop code be propagated. I also asked them to see if an exception that triggered termination could also be propagated.
This has been implemented for Windows in a future major release (calendar year 2017). However, we haven't yet found a way to do this reliably on Linux.