3.6 Interactive mode and debugging

You can use mrun for running PALM in batch mode as well as for running it interactively. For interactive runs, you must (naturally) be logged in on the respective computer. For this computer the subroutines of the model must have been precompiled (see chapter 5.0). Files containing user-defined code must be stored in the directory given by the variable %add_source_path in the mrun-configuration file .mrun.config. All output-files possibly created by the model and requested by the user to be kept after the run are copied to directories on the local host corresponding to the specifications in the configuration file (in this case the file attribute tr does not cause transfer to another computer).

Since model runs usually require large amounts of CPU time, interactive runs may not be feasible, since in interactive mode CPU time is strongly limited on many hosts and runs will be aborted after the time limit has been exceeded. However, an interactive run makes sense if a suitable debugger is available, which may be used for error tracing in the model (here, error tracing in the user-defined software is meant). The preparations neccessary for debugging are described in the following. This description is limited to the IBM Regatta "hanni" and "berni" of the HLRN.

If certain routines of the model are to be debugged for errors, the complete source code of the model, including the user-defined code, must be compiled with special debug compiler options. For this purpose, at least the following three lines must be included in the mrun configuration file:

%compiler_name     mpxlf95_r                                  ibmh parallel debug
%fopts             -g:-C:-qinitauto=FF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:
                   -qarch=pwr4:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide:
                   :invalid::enable:-qsigtrap                 ibmh parallel debug
%lopts             -g:-C:-qinitauto=FF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:
                   -qarch=pwr4:-qnosave:-qnoescape:-qflttrap=overflow::zerodivide:
                   :invalid::enable:-qsigtrap:-lesslsmp       ibmh parallel debug

(Attention: in the configuration file, the compiler and linker options (fopts and lopts) must be written in one line without any blank space before and after the colons!)

Using the compiler options "-g" and "-C", debugable code is created and check of array bounds is switched on during run time. Option "-qinitauto=FF" initializes all automatic variables (unfortunately not the global values of modules) to NaN.The "-qflttrap" and "-qsigtrap" options are needed in order to terminate the run in case of any floating point errors (otherwise the run will not terminate and errors can hardly be detected).

The mrun call for debugging needs an extended argument for the option -K:

mrun ... -K “parallel debug” -s ”*.f90" ... .

The argument of option -s must list all source code files of the default PALM code.

After compiling, the debugger TotalView is automatically called by mrun. With its assistance the user has to start the program execution manually, to set breakpoints, etc.. User manuals of TotalView are available online.

Program crashes caused by errors in the user-defined code should usually be found unassisted. If the termination point lies outside the user code (in the default model code), the PALM group can be asked for assistance, but please do not expect any quick response. It is emphasized again that error tracing and programming of user-defined code requires more or less precise knowledge of the internal structure of PALM (see beginning of chapter 3.5).
 



Last change:  $Id: chapter_3.6.html 83 2007-04-19 16:27:07Z suehring $