Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
공지
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

error stop

Chris_G_2
초급자
2,077 조회수

This is a query about error stop.

As I understand it, it can be called anywhere in the Fortran code and will immediately close all threads and stop.

Is this correct or is there more to it than this? I ask because this is not the behaviour I am seeing.

0 포인트
16 응답
TimP
명예로운 기여자 III
2,077 조회수
Could you be more specific? Do you mean Fortran 2008 ERROR STOP, presumably in an environment where you expect co-array images to be implemented as threads? If this is what you mean, it wouldn't surprise me if improvements in quality of implementation might be desired. I don't think there's any specification of what ERROR STOP should do under OpenMP, which is what comes to mind first when you talk about threading. No Fortran compiler claims to be a full implementation of Fortran 2008. Filing feature requests might help prioritize introduction of F2008 facilities.
0 포인트
Chris_G_2
초급자
2,077 조회수
Apologies - that really was a rather vague posting from me. I am using coarrays in Fortran using the latest version of the Intel XE Composer. Calling error stop almost always does not kill all the threads which is quite frustrating.
0 포인트
Steven_L_Intel1
2,077 조회수
Which exact compiler version are you using? I'm not aware of a current problem with ERROR STOP. Can you show a simple example?
0 포인트
Chris_G_2
초급자
2,077 조회수
I am using the latest compiler. When I construct a simple example to demonstrate the problem, it works fine!
0 포인트
Chris_G_2
초급자
2,077 조회수
I'm back with problems with 'error stop' in Fortran using the latest compiler. The following code doesn't behave as I expect: if (this_image() == 1) then . . error stop ' Error stop called' . . endif Gives the output line 'Error stop called' on the Commad Prompt window, but kills no threads not even thread 1. Is there a workaround? All I want to do is stop all the threads and quit. A simple example doesn't do this. Has anyone else found this problem? It's hard to reproduce
0 포인트
Chris_G_2
초급자
2,077 조회수
I have managed to create a simple example. This program is a running test program, but on line 28 I have put an 'error stop' command. The program continues to use all available processors but hangs at this point.
0 포인트
Steven_L_Intel1
2,077 조회수
Thanks - I can reproduce this and will pass it on to the developers. Issue ID is DPD200239636.
0 포인트
Chris_G_2
초급자
2,077 조회수
Thanks Steve. Is there a work-around using OPenMP or something else that you know of? Chris
0 포인트
Steven_L_Intel1
2,077 조회수
If you want to completely rewrite the program to use OpenMP, you can, but that seems somewhat drastic. does your program call ERROR STOP in its normal course of operation? I've tried some alternatives and can't get them to do anything. Very strange. If I learn of a workaround I will let you know.
0 포인트
Chris_G_2
초급자
2,077 조회수
The program I am working on is a commercial product (PolySNAP) which is used for data processing and classification. Because it's a commercial product, lots of testing and checking of both user choices and the correct functioning of the software are made. Problems and errors are flgged and the program stops if the errors are severe, so I need 'error stop' in a lot of places in the program.
0 포인트
jimdempseyatthecove
명예로운 기여자 III
2,077 조회수
>>Is there a work-around using Create an coarray error status integer :: ErrorStatus
  • ! near top ErrorStatus[this_image()] = 0 ... Then any image on error can set ErrorStatus .AND. ErrorStatus[1] In appropriate places you can test ErrorStatus[1], if not 0, exit loop (appropriately), exit subroutine/function (appropriately) Then in main level, should you (each thread) notice ErrorStatus[1] not 0, then it can issue STOP You can conditionalize this code such that when the "exit stop 'msg'" is fixed, that you can easily change the conditional compile variable to use exit stop (leave alternate code in until you are certain exit stop is fixed +additional compiler version). Jim Dempsey
  • 0 포인트
    Steven_L_Intel1
    2,077 조회수
    It turns out that this bug was already fixed in our code, but the fix was not put into the 13.0 stream because it was considered too risky. I will ask the developers to reconsider.
    0 포인트
    Chris_G_2
    초급자
    2,077 조회수
    This would be invaluable; without an easy way of stopping all threads and quitting, I have serious problems in delivering my code on time as per contract! What would be the timescale? Jim Dempseys's work-round; can this be put into a simple subroutine that will emulate error stop? I need to think about it. (Most of the time I have just one image running; it's only in a very compute intensive portion of the code that I switch to multiple images, and this part does not need error stop.)
    0 포인트
    Steven_L_Intel1
    2,077 조회수
    I tested the following and it works. Just call this instead of using ERROR STOP. [fortran] subroutine my_error_stop use kernel32 use, intrinsic :: iso_c_binding INTEGER MPI_COMM_WORLD PARAMETER (MPI_COMM_WORLD=1140850688) abstract interface subroutine mpi_abort_int (comm, status) bind(C) integer, value :: comm, status end subroutine mpi_abort_int end interface procedure(mpi_abort_int), pointer :: mpi_abort call c_f_procpointer( & transfer( & GetProcAddress( & GetModuleHandle("impimt"//C_NULL_CHAR), & "MPI_Abort"//C_NULL_CHAR & ), & C_NULL_FUNPTR & ), & mpi_abort) if (.not. associated(mpi_abort)) error stop ("Can't find MPI_Abort - must CTRLC program") call mpi_abort (MPI_COMM_WORLD, 0) end subroutine my_error_stop [/fortran]
    0 포인트
    Chris_G_2
    초급자
    2,077 조회수
    It works! I'm very grateful for this, thanks. Chris
    0 포인트
    Steven_L_Intel1
    2,077 조회수
    Glad to hear it! For reference, the original issue ID is DPD200233617. This will be the ID mentioned in bug fix lists.
    0 포인트
    응답