- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
링크가 복사됨
16 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Which exact compiler version are you using? I'm not aware of a current problem with ERROR STOP. Can you show a simple example?
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks - I can reproduce this and will pass it on to the developers. Issue ID is DPD200239636.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
>>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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.)
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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]
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Glad to hear it! For reference, the original issue ID is DPD200233617. This will be the ID mentioned in bug fix lists.
