Running the deMon Script

By default, a deMon script for an NQS/PBS queuing system is installed in the directory $CREX_ROOT/deMon/bin (Figure 1). This script is used in the research groups at CINVESTAV for working with deMon2k. It is only an example of what can be done and certainly must be modified for other queuing systems and/or environments. However, by using this script as a template, modifications for other systems and environments should be straightforward. As a language reference for bash scripting, we suggest [75]. To run a job with the deMon script just type
deMon your.inp
As in the foregoing example your.inp denotes the input file which must be in the current directory. You are asked to select an execution mode. If you are running NQS/PBS it could look similar to the following (serial, pl16, pl32 and pl12 are batch queues on the rodio mainframe at Cinvestav):
    Select an execution mode.

      1. Interactive job (background)
      2. Interactive job (foreground)
      3. NQS/PBS batch job in queue serial at rodio
      4. NQS/PBS batch job in queue pl16 at rodio
      5. NQS/PBS batch job in queue pl32 at rodio
      6. NQS/PBS batch job in queue pl12 at rodio

    Enter a number:
After you have selected the execution mode, i.e. the queue (and machine) to which the job is submitted, the script checks which deMon2k versions are available. For this purpose the script tries to read first the version number in your home directory in the file $HOME/demon/.default-version. If this file is not available, it will take the version which is specified in the $CREX_ROOT/deMon/ .default-version file. You can then choose between the available executables, e.g.:
    The following program versions are available:

      1. /usr/local/deMon/x.y.z/object.opt/deMon.x.y.z.opt
      2. /usr/local/deMon/x.y.z/object.dbg/deMon.x.y.z.dbg
      3. /usr/local/deMon/x.y.z/object.dpg/deMon.x.y.z.dpg
      4. /usr/local/deMon/x.y.z/
      5. /usr/local/deMon/x.y.z/object.mpi/deMon.x.y.z.mpi
      6. /home/florian/demon/x.y.z/object.opt/deMon.x.y.z.opt
      7. /home/florian/demon/x.y.z/object.dbg/deMon.x.y.z.dbg

    Enter a number:
After choosing the executable, the calculation is started. The output files will be written to $HOME/demon/x.y.z/outputs after the calculation is finished. You must create this directory manually. If this directory doesn't exist, the deMon script will stop the execution with the following error message
    deMon: The directory /home/florian/demon/x.y.z/outputs does not exist

    Abnormal termination of deMon.
You can also specify a different output directory. Type
deMon -h
to get further information on the deMon script.