Error stop is not working

Error stop is not working

Hi,

Sorry if this is a duplicate post, I haven't worked out how to search on the new forum layout.

It appears that the "error stop" statement only affects the image on which it was called, and doesn't cause the termination of other images. Consider this code:

program test
  if (this_image() == 1) write(*, *) num_images()
  if (this_image() == 1) error stop
  write(*, *) this_image(), "Might be printed..."
  sync all
  write(*, *) "Shouldn't be printed..."
end program test

I would expect it to only print the number of images once, and maybe print the maybe line on some of the images, and then terminate (the error stop would interrupt the sync all). Instead, I get this output:

 8
 2 Might be printed...
 4 Might be printed...
 8 Might be printed...
 6 Might be printed...
 7 Might be printed...
 5 Might be printed...
 3 Might be printed...
 Shouldn't be printed...
 Shouldn't be printed...
 Shouldn't be printed...
 Shouldn't be printed...
 Shouldn't be printed...
 Shouldn't be printed...
 Shouldn't be printed...

at which point it hangs until I ctrl+c it. I'm not sure what's going on. It happend in both Debug and Release mode builds (with/without optimisation). Here's my compiler version:

Compiling with Intel(R) Visual Fortran Compiler XE 12.1.5.344 [Intel(R) 64]...

Thanks,

Ben

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

What happens if you use:

SYNC ALL(STAT=iStat, ERRMSG=aCharVariableForMessage)

Check (and report back) the return values.

Jim Dempsey

www.quickthreadprogramming.com

Hi Ben,
I have escalated this issue to the developers. The issue number is DPD200237069. I will post any updates I receive to this thread.

Regards,
Annalee
Intel Developer Support

Quote:

jimdempseyatthecove wrote:

  SYNC ALL(STAT=iStat, ERRMSG=aCharVariableForMessage)

Quote:

Annalee (Intel) wrote:

I have escalated this issue to the developers.

Thanks Jim, Annalee.

I tried your suggestion, replacing the sync and write with

sync all (stat=istat, errmsg=imsg)
write(*, *) this_image(), istat, imsg

This is what I get:

 6 Might be printed...
 7 Might be printed...
 3 Might be printed...
 8 Might be printed...
 2 Might be printed...
 4 Might be printed...
 8
 2 0
 6 0
 5 Might be printed...
 3 0
 7 0
 5 0
 8 0
 4 0

The message is a blank string.

Cheers,

Ben

Ben,
Also notice that your output is as expected.
i.e. The "Shouldn't be printed..." are not printed.
Jim Dempsey

www.quickthreadprogramming.com

Hi Jim,
Sorry, I should have said that I replaced that write statement with the one printing the status from the sync all. So that line shouldn't have been printed either, because it's after the sync all. It's not printed by the first image, though, the one with the error stop statement (which is expected).
Ben

Leave a Comment

Please sign in to add a comment. Not a member? Join today