Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error stop is not working

Ben3
Beginner
633 Views

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

0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
633 Views
What happens if you use: SYNC ALL(STAT=iStat, ERRMSG=aCharVariableForMessage) Check (and report back) the return values. Jim Dempsey
0 Kudos
Anonymous66
Valued Contributor I
633 Views
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
0 Kudos
Ben3
Beginner
633 Views

jimdempseyatthecove wrote:

  SYNC ALL(STAT=iStat, ERRMSG=aCharVariableForMessage)

Annalee (Intel) wrote:

I have escalated this issue to the developers.

Thanks Jim, Annalee.

I tried your suggestion, replacing the sync and write with

[fortran]

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

[/fortran]

This is what I get:

[plain]

 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

[/plain]

The message is a blank string.

Cheers,

Ben

0 Kudos
jimdempseyatthecove
Honored Contributor III
633 Views
Ben, Also notice that your output is as expected. i.e. The "Shouldn't be printed..." are not printed. Jim Dempsey
0 Kudos
Ben3
Beginner
633 Views
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
0 Kudos
Reply