Personal tools
You are here: Home User Support User Documentation Globus Job Submission in DEISA 5 Globus job script

5 Globus job script

5.1 RSL schema

For non-trivial jobs, a Globus job script is needed. It is written in RSL (Resource Specification Language), which is a Globus-specific XML schema. The simplest example of RSL script is following three line script. More examples can be found below.

<job>
<executable>/bin/date</executable>
</job>

That script saved in a file myjob.rsl can be submitted with the command

globusrun-ws -submit -S `deisa_service -i -b lrz` -f myjob.rsl 

Commonly used tags are:

  • <job>: every RSL file begins with this tag
  • <executable>: executable with absolute path to be run
  • <directory>: default home directory is by default $GLOBUS_USER_HOME which is usually $HOME
  • <count>: number or processes
  • <maxWallTime>: length of the job in minutes
  • <jobType>: use mpi for MPI jobs
  • <fileStageIn>: Contains one or more <transfer> entries, which contain <sourceUrl> addresses, which needs to be in gsiftp:// address syntax. Target is specified with <destinationUrl>. It can be file:///path/target.txt address i.e. to the directory where the file is needed on that host.
  • <fileStageOut>: contains also <sourceUrl> and <destinationUrl>, but in this direction sourceUrl can be with file:/// syntax and <destinationUrl> with gsiftp:// syntax.
  • To remove files such as input files, it is possible to specify files in <fileCleanup> tags. Each file is surrounded with <file> tag and referred with file:/// syntax.

The only mandatory field inside <job> tags is <executable>, all other fields are optional. A full list of possible tags is available on the Globus web site.


The globusrun-ws switch -f specifies the location and name of the RSL file. Note that -S is needed if the script contains <fileCleanUp> tags. Example job submission command:

globusrun-ws -submit -S `deisa_service -i -b lrz` -f myjob.rsl

You cannot use $DEISA_HOME and other DEISA environmental variables in Globus job script. However, in the executable script you can use the DEISA variables provided that you include module load deisa in it or in
<preamble> as shown in next section.

You have to use absolute paths for the executable. The default directory to copy files and to create output files (stdout and stderr) is user's home directory. It can be referred with ${GLOBUS_USER_HOME}. You can see example usage from next RSL example below.

5.2 Extension tag

DEISA Globus installations support a special extension which, for example, can be used to load a module file or to set environment variables (indeed any UNIX command can be used here). It is a must if you want to use pre-installed parallel programs from the DEISA CPE jobs, as you have to load the respective module file (e.g., cpmd).

 

<extensions>
  <preample>module load deisa cpmd</preample>
</extensions>

 

5.3 Job script with file transfer

It is often the case that a compute job needs input files and produces output files. These files should be transferred automatically to/from the computing resource before and after the job. This can be done with the staging commands using GridFTP.
To find out the names and ports for GridFTP servers, you can call the command line, use deisa_service -i -f <site>.  In the following example there is a file transfer to the execution site (input file) and back to the sending host.  There is also a clean-up step of the files at target site.  The following example transfers text_input.txt from LRZ's GridFTP server to the target system into user's home directory at the target site.
Absolute paths need to be used with gsiftp:// addresses syntax.

 

<job>
  <executable>/bin/cat</executable>
  <directory>${GLOBUS_USER_HOME}</directory>
  <argument>text_input.txt</argument>
  <stdout>test.stdout</stdout>
  <stderr>test.stderr</stderr>
  <fileStageIn>
   <transfer>      
    <sourceUrl>
gsiftp://a01-deisa.hlrb2.lrz-muenchen.de:2813/home/deisa/lrz/lrz00001/lrz04jex/text_input.txt
</sourceUrl>
    <destinationUrl>file:///${GLOBUS_USER_HOME}/text_input.txt</destinationUrl>
   </transfer>
  </fileStageIn>
  <fileStageOut>
   <transfer>
    <sourceUrl>file:///${GLOBUS_USER_HOME}/test.stdout</sourceUrl>
    <destinationUrl>
gsiftp://a01-deisa.hlrb2.lrz-muenchen.de:2813/home/deisa/lrz/lrz00001/lrz04jex/test.stdout
</destinationUrl>
   </transfer>
   <transfer>
    <sourceUrl>file:///${GLOBUS_USER_HOME}/test.stderr</sourceUrl>
    <destinationUrl>
gsiftp://a01-deisa.hlrb2.lrz-muenchen.de:2813/home/deisa/lrz/lrz00001/lrz04jex/test.stderr
</destinationUrl>
   </transfer>
  </fileStageOut>
  <fileCleanUp>
   <deletion>
    <file>file:///${GLOBUS_USER_HOME}/test.stdout</file>
   </deletion>
   <deletion>
    <file>file:///${GLOBUS_USER_HOME}/test.stderr</file>
   </deletion>
  </fileCleanUp>
</job>

 

If the above script is saved to a file called cat.rsl an example job submission command could be:

 

globusrun-ws -submit -F `deisa_service -i -g sara` -S -f cat.rsl

 

5.4 MPI Globus job script

MPI jobs need the <jobType>mpi</jobType> tag. Also, the number of MPI processes has to be defined with the <count> tag.  In the example below, we also specified the maximum amount of wall clock time in minutes.  Because the MPI executable must have been compiled on the target machine before running it, this example assumes that the binary exists in the user's home directory.

<job>
  <executable>mpi_test</executable>
  <stdout>mpitest.stdout</stdout>
  <stderr>mpitest.stderr</stderr>
  <count>4</count>
  <maxWallTime>10</maxWallTime>
  <jobType>mpi</jobType>
  <fileStageOut>
   <transfer>
    <sourceUrl>file:///${GLOBUS_USER_HOME}/mpitest.stdout</sourceUrl>
    <destinationUrl>
gsiftp://a01-deisa.hlrb2.lrz-muenchen.de:2813/home/deisa/lrz/lrz00001/lrz04jex/mpi_test.stdout
</destinationUrl>
   </transfer>
   <transfer>
    <sourceUrl>file:///${GLOBUS_USER_HOME}/mpitest.stderr</sourceUrl>
    <destinationUrl>
gsiftp://a01-deisa.hlrb2.lrz-muenchen.de:2813/home/deisa/lrz/lrz00001/lrz04jex/mpi_test.stderr
</destinationUrl>
   </transfer>
  </fileStageOut>
  <fileCleanUp>
   <deletion>
    <file>file:///${GLOBUS_USER_HOME}/mpitest.stdout</file>
   </deletion>
   <deletion>
    <file>file:///${GLOBUS_USER_HOME}/mpitest.stderr</file>
   </deletion>
  </fileCleanUp>
</job>


Job submission example using fire & forget style:

globusrun-ws -submit -F `deisa_service -i -b lrz` -S -b -o mpijob.epr -f mpi.rsl

Later, one can query the status of the job:

globusrun-ws -status -j mpijob.epr 

or, if there is need to kill it

globusrun-ws -kill -j mpijob.epr
Document Actions