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). Furthermore, the working directory (~/palm/current_version/SOURCE) must contain all default source code files of the model (*.f90), the mrun configuration file (.mrun.config) the Makefile (Makefile) and the files which contain the user-defined code (the default user-interface file user_interface.f90 have to be removed from the directory). 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 are usually not 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:
                   :invalid::enable:-qsigtrap                 ibmh parallel debug

%lopts             -g:-C:-qinitauto=FF:-qrealsize=8:-Q:-q64:-qmaxmem=-1:-qtune=pwr4:
                   :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:

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

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 developer group had possibly be asked for assistance. 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:  15/04/05 (SR)