Error trapping for multiprocessor systems: A primer
last update: 04/11/2003

Simple Fortran run script that produces an overflow

You may use this example to experiment with the trace methods described in this primer.

Fortran code that produces overflow FPEs

After being compiled, this Fortran program causes overflow FPEs when it is executed.

#! /bin/csh
cat << -eof- > it.f
   program main
   real x, y, z
   data x / 1.0E+30 /
   data y / 1.0E+00 /
   do i=1,8
      x = x*10.0
      y = y/10.0
      print*, x, y, div(x,y)
   end do
   stop
   end
   real function div(x,y)
   div = x/y
   return
   end
-eof-
xlf90_r -g -qflttrap=OV:EN -qsigtrap=xl_trcedump -oit it.f
./it
/usr/local/bin/totalview it core
rm it*

Output sent to stdout

When executed, this Fortran program generates the following at stdout:

0.9999999848E+31 0.1000000015 0.9999999365E+32
0.1000000033E+33 0.9999999776E-02 0.1000000041E+35
0.1000000072E+34 0.9999999311E-03 0.1000000120E+37
0.1000000041E+35 0.9999999020E-04 0.1000000171E+39

  Signal received: SIGTRAP - Trace trap
0.1000000041E+36 0.9999998838E-05 Signal generated for floating-point exception:
    FP overflow

  Instruction that generated the exception:
frsp fr01,fr01

  Traceback:
Offset 0x00000038 in procedure div, near line 13 in file it.f
Offset 0x0000012c in procedure main, near line 8 in file it.f
--- End of call chain ---

Breakpoint (core dumped)

Output displayed by TotalView

This is how TotalView displays this Fortran program:

TotalView display of overflow FPEs

Next page | Table of contents - TotalView primer

If you have questions about this document, please contact SCD Customer Support. You can also reach us by telephone 24 hours a day, seven days a week at 303-497-1278. Additional contact methods: consult1@ucar.edu and during business hours in NCAR Mesa Lab Suite 39.

© Copyright 2003. University Corporation for Atmospheric Research (UCAR). All Rights Reserved.

Address of this page: http://www.scd.ucar.edu/docs/trap.error/frun1.html