Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

GETEXCEPTIONPTRSQQ returns NULL

irhan__baris
Beginner
163 Views

Dear All,

I implemented an exception handler and registered it with SIGNALQQ. Within this exception handler I want to call TRACEBACKQQ function with EPTR option. Unfortunately GETEXCEPTIONPTRSQQ() function returns NULL. Does anyone of you have an idea why? Thank you for your time in advance.

Best regards,

Baris Irhan,

 

integer(4) function h_fpe (signum,ecode)
!DIR$ ATTRIBUTES C :: h_fpe
!params
integer(2) :: signum
integer(2) :: ecode
!variables
integer(4) :: RTN_STS
integer(KIND=INT_PTR_KIND()) :: EPTRS
include 'FOR_IOSDEF.FOR'

!body

!write(*,'(/,A)') 'in signal handler for sig$fpe'
!write(*,*) 'signum = ', signum
!write(*,*) 'ecode = ', ecode    
!read(*,*)

EPTRS = GETEXCEPTIONPTRSQQ()
call TRACEBACKQQ(USER_EXIT_CODE=-1,STATUS=RTN_STS,EPTR=EPTRS)

if (RTN_STS .EQ. FOR$IOS_SUCCESS) then
write(*,*) 'TRACEBACK WAS SUCCESSFUL'
read(*,*)
end if

h_fpe = 1
end

 

 

0 Kudos
3 Replies
Lorri_M_Intel
Employee
163 Views

I would try adding USE IFCORE to your program so that GetExceptionPtrsQQ is properly defined.

It's possible that the return value is being interpreted as a REAL, being converted to INTEGER before being stored in EPTRS, and weird things are happening.

               I hope this helps --

                                    --Lorri

irhan__baris
Beginner
163 Views

Dear Lorri,

I defined event handler as a module procedure. use IFCORE has already been added at module declaration...

irhan__baris
Beginner
163 Views

Dear Colleques,

I am still NOT able to figure out why GETEXCEPTIONPTRSQQ function returns NULL when it is called within exception handler. Why I am not able to use this nice feature...

 

Reply