E-154 Offline Analysis on Unix

M. Daoudi, 10-Dec-93 Last update: 11-Apr-95

This note describes how to link and run E-154 offline analysis executables on Unix at SLAC. It is similar to E143, but is project based.

  1. In your .login add the following line to select the development version of code:

    source /afs/slac/g/esa/e154ola/com/setdev

  2. Create a directory where you work. Keep your source code (i.e. Fortran and C files), include files (typically common blocks) etc in it.

  3. To make the executable, move to this directory, then type:

    $E154_COM/e154mak or
    $E154_COM/e154mak debug
    (if you want the debug version).

    You will be prompted for an (optional) input file in which you have specified your own compiling/linking options (see below for the available user options and required syntax). You will most likely want to specify the name of the subroutine(s) you want to test. If you don't want to provide your own options, just hit <CR> at the prompt and the program will link with preset defaults.
    Alternatively you can supply the name of the options file as an argument to the link command, for example:

    $E154_COM/e154mak debug mye154.opt

    An executable called e154anl.exe (or e154anl_dbg.exe if debug) will be created in the current directory

    Building Options:

    You can supply the following (optional) parameters in an input file (e.g. mye154.opt):
    EXE:
    Alternate name (and directory) for the executable
    FFLAGS:
    Compilation options for the xlf90 Fortran compiler
    LFLAGS:
    Linking options for xlf90
    OPTFLG:
    Optimization flag for compiling and linking of code
    MYCODE:
    Private source code (fortran or c) to compile and link
    MYOBJS:
    Private object files to be linked only
    MYLIBS:
    Private libraries
    SRCDIR:
    Alternate directory for source (.f) files
    MYINC:
    Redefine directory where INCLUDE files are to be found
    Note: The object files specified in the option MYOBJS will be linked only, without looking at any dependency. The source files specified in MYCODE will be probed to know if they need to be recompiled (changes, new include file ...). (There are other parameters that can be modified that I will not mention here, for instance you can use a different version of the CERN library by just modifying the parameter CERN in your options files.)

    Here is an example of a user options file:

    MYCODE='use_spill.f beam.c'
    MYOBJS='use_endrun.o use_init.o'
    SRCDIR=/u/ea/daoudi/other/sources
    FFLAGS='-D'
    EXE=/u/ea/daoudi/e154/work/testit.exe
    MYLIBS=mycalclib.a
    LFLAGS='-C'
    OPTFLG='-O'
    MYINC=/u/ea/daoudi/e154/test/inc/
    
    Comments:

    Optimization:

    For faster execution of the code, use the following option: OPTFLG='-O2'

    Zen's C Libraries:

    The production (prod) versions of ALIB and CLIB are normally used. This is governed by the environment variables $ALIB and $CLIB, which are set in the setprod and setdev scripts. It is crucial that the same version of ALIB be specified in the file anal-sdb.dat. Otherwise, the program will very likely crash.

  4. To run the executable, login to one of the machines morgan01, morgan02, or morgan03, define the environment variable DISPLAY to the workstation (or X-term) you are using (also don't forget to type "xhost +" on the local machine). Make sure you have the appropriate anal-sdb.dat and anal-setup.dat files, then type:

    $E154_COM/e154run or
    $E154_COM/e154run xldb
    (to run the debug version).

    You will then be prompted for the name of the executable. If you hit <CR> the executable e154anl.exe will be run. By default, this is the name that is used when creating a new executable; you can modify it with the linking option EXE as explained above.

    When the execution of the program starts, some information will scroll on your window and a "Run-Control" window will open up if you had specified it in your file anal-setup.dat .
    In debug mode you will enter the debugger: after having set some breakpoints (use man pages or ask an expert), then click on "continue" to start the execution of the program.

    Private constants:

    When using e154run, the program will try to look at constant files in the current directory first, if not there, it will take them in $E154CON. This allows to have a private constant file in current directory and all the others in group directory. This can be changed by changing the environment variable CONPATH.

    Cleaning up:

    Occasionally your jobs will not end gracefully, and as a result some processes may still be active after they are done. In order to clean up these left over processes type:

    $E154_COM/e154cleanup

    You are encouraged to issue this command at the end of each run. However, be careful when issuing this command for it may delete another job you are running on the same machine from a different window, for example.

    Miscellaneous:

Have lots of fun!

{Mourad Daoudi}