Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
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.

Trapping runtime errors

ereisch
New Contributor II
1,263 Views
Is there a way to have the forrtl error handler call a user-generated program after it prints out its stack trace? We have a multi-process environment and when one process crashes due to a forrtl error, we want to be able to signal the other processes that the one has crashed, so they can deal with it appropriately, rather than blocking indefinitely on a process that no longer exists. Even if it did something as simple as raise a signal, we can install a signal handler to trap that and react accordingly.

Thanks
0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,263 Views
Look at the documentation for the SIGNALQQ library routine.
0 Kudos
ereisch
New Contributor II
1,263 Views
Thanks, I saw that, but when forrtl encounters a "generic" severe error, is there a signal raised? If so, which one? An example:

forrtl: File exists
forrtl: severe (10): cannot overwrite existing file, unit 6, file /path/to/somefile.txt


Is there documentation somewhere (similar to http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/lin/compiler_f/bldaps_for/common/bldaps_rterrs.htm) that lists which signals are sent for which errors? In the above link, it says that "to prevent program termination...change the default action of a signal", but isn't clear on which signal we should be trapping. FPEs are understandable, as well as SEGVs, but what about arrays out of bounds?

Thanks again

0 Kudos
Steven_L_Intel1
Employee
1,263 Views
Unfortunately, I/O errors are not signalled and can't be trapped. I have previously filed a feature request asking for that ability - I will add yours to the list.
0 Kudos
Reply