Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
* Fortran Exception handler for OpenVMS/Alpha needed
@ 1994-04-21 12:54 Michael J. Liebman
  1994-04-22 15:20 ` Steve Lionel
  0 siblings, 1 reply; 2+ messages in thread
From: Michael J. Liebman @ 1994-04-21 12:54 UTC (permalink / raw)



We have the need to trap exceptions on an OpenVMS Alpha.  In
particular, we are trying to trap fortran exceptions such as overflow,
underflow, square root of a negative number, etc.  We'd like handle
the errors in a relatively clean way which allows continuing if
desired.  We have a subroutine (originally from DOE-Morgantown) which
works for VAX/VMS but is not compatible with Alpha.  Does anyone have
an equivalent fortran subroutine for the Alpha?

Please reply via e-mail to mjliebman@amoco.com.  If others are
interested in the replies I can summarize if requested.

Thanks in advance to all VMS/Alpha wizards.  I apologize if this has been
posted multiple times, but Big Brother doesn't seem to want me to post 
outside his concept of "the universe"...

-------------------------------------------------------------------------
Michael J. Liebman               mjliebman@amoco.com
Amoco Chemical Company           Voice: (708)961-7408
Naperville, IL  USA              FAX:   (708)420-4678
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fortran Exception handler for OpenVMS/Alpha needed
  1994-04-21 12:54 Fortran Exception handler for OpenVMS/Alpha needed Michael J. Liebman
@ 1994-04-22 15:20 ` Steve Lionel
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Lionel @ 1994-04-22 15:20 UTC (permalink / raw)



In article <1994Apr21.075434.14408@amoco.com>, zmjl19@NAP.AMOCO.COM 
(Michael J. Liebman) writes:
|>
|>We have the need to trap exceptions on an OpenVMS Alpha.  In
|>particular, we are trying to trap fortran exceptions such as overflow,
|>underflow, square root of a negative number, etc.  We'd like handle
|>the errors in a relatively clean way which allows continuing if
|>desired.  We have a subroutine (originally from DOE-Morgantown) which
|>works for VAX/VMS but is not compatible with Alpha.  Does anyone have
|>an equivalent fortran subroutine for the Alpha?

It's not that simple.  Exception handling for "hardware-detected errors"
is dramatically different on Alpha AXP as compared to VAX.  The most
significant aspect is that, by default, the exception may not get generated
until some number of instructions later and your handler is not given the
precise PC of the instruction at fault.  The architecture does provide
methods for backtracking to find the errant instruction, but this also
requires that the compiler generate different (and slower) code to
accomodate it.

My first suggestion is to modify the program to pre-test input values so as
to avoid overflows, underflows, etc.  If this is not feasible, then isolate
the operations which might get errors into separate functions; have that
function establish a handler which returns a desired result if an error
occurs (the compilers do make sure that any exceptions are raised before
a routine exits.)

If your VAX handler calls routines like LIB$SIM_TRAP and LIB$FIXUP_FLT,
you have to rethink how this is handled on Alpha AXP.

I'm not sure how math library errors are handled - perhaps someone else
can comment.

In OpenVMS V6.1, the C and Fortran compilers can operate in IEEE floating
modes which give you special "NaNs" (Not-a-Numbers) for overflow,
denormalized values for underflow, etc.  Using these extracts a large
performance penalty.
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
SDT Languages Group               WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-04-22 15:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-04-21 12:54 Fortran Exception handler for OpenVMS/Alpha needed Michael J. Liebman
1994-04-22 15:20 ` Steve Lionel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox