# href="http://d0-france.in2p3.fr/WORKING_GROUPS/SOFTWARE/mc_prod/D0RUNJOB/css/nemesis.css" />

User documentation

Installation

DØRunjob is currently being run a various environments:

  1. Within SAMGrid for MC and reprocessing production
  2. On isolated farms for special MC production
  3. On clued0 and CAB for testing requests and release tarballs
  4. On clued0 for development of new executables

Most people are only concerned with scenario 3. so using the UPS installation is the easiest option:

$ setup d0runjob <version>
$ python yourmacro.py

Creating a workflow

DØRunjob provides a python API to build, configure, and run jobs. Most DZero workflows have many tasks which make the 'macros' rather complex. Only production macros are included in the release so feel free to contact developers if you need help with writing a specific macro.

Here are a couple of links to specific workflow examples:

Online copy of the README.txt

D0Runjob download and installation instructions
===============================================

D0Runjob webpage: http://www-d0.fnal.gov/computing/d0runjob/


Quick instructions on clued0:

$ setup d0runjob 
$ cp $D0RUNJOB_DIR/macro/d0hello.py .
$ python d0hello.py

Testing macros
--------------

Macros use a python API which provide greater flexibility when configuring
your job. A basic d0hello.py macro is provided in the macros directory and is
executed using python.

$ python d0hello.py

The example macro will create and run a job interactively and serves to test
the installation. Feel free to contact developers if you need help with
writing a more useful macro.


Installing the SAM client software (includes python 2.4)
--------------------------------------------------------

Most DZero workflows interact with SAM so you need the SAM API in your
PYTHONPATH. An easy way to achieve this is by using the sam_client package,
which also provides python 2.4. This provides a solution for non-DZero
machines which don't have UPS/UPD installed.

Example to install sam_client tarball on your local machine:

$ mkdir /some/local/path/samclient
$ cd /some/local/path/samclient
$ wget ftp://fnkits.fnal.gov/ftp/products/sam_client/v2_0_7/NULL/sam_client_v2_0_7_NULL.tar.gz
$ tar xfz sam_client_v2_0_7_NULL.tar.gz
$ tar xfz etc/sam.tgz

The following setup command should be run prior to D0Runjob usage:

$ cd $D0RUNJOB_DIR
$ . etc/d0runjob-setup.sh

$ export LOCALSAMCLIENT=/some/local/path/samclient
$ . $LOCALSAMCLIENT/init_sam.sh $LOCALSAMCLIENT
$ export SAM_CP_CONFIG_FILE=/some/local/path/samclient/sam_cp_config/etc/sam_cp_config.py

where sam_cp_config.py is appropriate for your site/machine
this can be created using this command:

$ cd /some/local/path/samclient
$ ./ups/sam_cp_config_create.py .

You should now have D0Runjob and SAM client setup correctly.