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

Signal after IEEE_HANDLER

sphost
Beginner
1,064 Views

Hi,

I use IEEE_HANDLER to handle FPE. When a FPE occurs, the function which was put in the parameter of IEEE_HANDLER is called.
As described in the document at the end of this function, the program terminates.

I try to catch the terminate signal SIGTERM of after thisfunctionbut it's seems that it's not this one...

Do you know which signal is sent ?

Thx in advance.

 

0 Kudos
6 Replies
Kevin_D_Intel
Employee
1,064 Views

After the interrupt handler, it appears termination is done via SIGKILL which can be neither caught nor ignored.

0 Kudos
sphost
Beginner
1,064 Views

I reach to the same conclusion.

SIGNALQQ seems to not work when the Fortran code is called from C++.

I manage to catch the signal in the Fortran Code, using the function PXFSIGACTION.

0 Kudos
Kevin_D_Intel
Employee
1,064 Views
Sphost:

SIGNALQQ seems to not work when the Fortran code is called from C++.

I expect that relates to the Fortran RTLs not being initialized in the absence of a Fortran main.

Sphost:

I manage to catch the signal in the Fortran Code, using the function PXFSIGACTION.

The SIGFPE or SIGKILL?

0 Kudos
sphost
Beginner
1,064 Views
MADkddavis:
Sphost:

SIGNALQQ seems to not work when the Fortran code is called from C++.

I expect that relates to the Fortran RTLs not being initialized in the absence of a Fortran main.

Sphost:

I manage to catch the signal in the Fortran Code, using the function PXFSIGACTION.

The SIGFPE or SIGKILL?



SIGFPE
0 Kudos
sphost
Beginner
1,064 Views

So, I managed to catch the signal FPE in my fortran code, using PXFSIGACTION.

But, when I'm in my handler function how can I know what type of FPE occured ? (Divide by zero or others)

I was having this information when I handled with IEEE_HANDLE, but, as described before, with this type of handler, the program terminates at the end of the handler function with a signal that cannot be caught by my C++ main function

0 Kudos
Kevin_D_Intel
Employee
1,064 Views

Perhaps IEEE_FLAGS with the GET action will do, otherwise with the PXF routines you may have to define a signal set and check for membership via PXFSIGISMEMBER.

0 Kudos
Reply