HP Fortran Programmer Guide (766160-001, March 2014)
LPATH environment variable.................................................................................................65
MP_NUMBER_OF_THREADS environment variable.................................................................65
Floating installation.................................................................................................................65
Setting up floating installation..............................................................................................66
3 Controlling data storage............................................................................67
Disabling implicit typing..........................................................................................................67
Automatic and static variables..................................................................................................67
Increasing the precision of constants.........................................................................................69
Increasing default data sizes....................................................................................................70
Increasing default data sizes...............................................................................................70
Sharing data among programs.................................................................................................72
Modules vs. common blocks.....................................................................................................74
4 Debugging..............................................................................................76
Using the HP WDB debugger..................................................................................................76
Stripping debugging information..............................................................................................76
Handling runtime exceptions....................................................................................................77
Bus error exception............................................................................................................78
Floating-point exceptions.....................................................................................................78
Illegal instruction exception.................................................................................................79
Segmentation violation exception.........................................................................................79
Bad argument exception.....................................................................................................80
Using debugging lines............................................................................................................80
5 Using the ON statement............................................................................81
Exceptions handled by the ON statement..................................................................................81
Actions specified by ON.........................................................................................................82
Terminating program execution............................................................................................83
Ignoring errors...................................................................................................................83
Calling a trap procedure....................................................................................................84
Trapping floating-point exceptions...................................................................................84
Trapping integer overflow exceptions...............................................................................84
Trapping +Ctrl-C trap interrupts................................................................................................85
Allowing core dumps..............................................................................................................85
6 Performance and optimization ...................................................................87
Using profilers........................................................................................................................87
HP Caliper........................................................................................................................87
Invoking HP Caliper with the compiler to optimize your program.........................................88
Comparing Program Performance....................................................................................88
Using Options to Control Data Collection.........................................................................89
Specifying PBO file names and locations..........................................................................89
gprof................................................................................................................................89
prof.................................................................................................................................90
Using options to control optimization.........................................................................................90
Using +O to set optimization levels......................................................................................90
Using the optimization options.............................................................................................91
Conservative vs. aggressive optimization...................................................................................99
Parallelizing HP Fortran programs...........................................................................................100
Compiling for parallel execution........................................................................................100
Performance and parallelization.........................................................................................101
Profiling parallelized programs..........................................................................................101
Conditions inhibiting loop parallelization............................................................................101
Calling routines with side effects parallellization .............................................................101
Indeterminate iteration counts.......................................................................................102
Data dependences......................................................................................................102
4 Contents