Submitting Jobs Using the DAG Environment
A combination of Perl scripts and
carefully placed files and directories specific to the job
permit the submission of an HTCondor job which is represented as a DAG,
in order to provide nice-to-have features for executing jobs.
Following the ordered set of directions given here
results in the submission of an HTCondor job,
such that it can run on available resources,
whether those resources are here at UW Madison or elsewhere in the
world and managed by OSG.
This ordered set of steps prepares a job for submission as a DAG,
using HTCondor DAGMan.
Make a directory on your submit machine,
which will hold everything for this project's submission of jobs.
Change into this directory.
As an example carried through this documentation,
assume that this directory is called
- Download the ChtcRun package:
Unpack the ChtcRun package.
This will create a
tar xzf ChtcRun.tar.gz
After unpacking the package,
ChtcRun directory will be:
data1/ [directory], and its contents
The operations of downloading and unpacking
may be repeated to
obtain updated versions of the scripts and supporting files.
Doing so will overwrite existing, but updated material,
without harming other files and directories already in place.
Stage files specific to the job into correctly-named directories
Make a directory
to house the project's input files and executables.
For purposes of this example, assume that the directory has been named
The name of this directory may not be
as an example MATLAB job is distributed with the scripts,
and its directory is called
proj1data, create one directory
for each job to be run.
Within each of these run-specific directories,
place the input files used for that specific job.
If the work does not require any per-job input files,
then nothing will be in these directories.
The files might include input files and parameter files.
These directories can be given any name,
but the file names may not contain whitespace characters, notably spaces,
in their name.
And, the file name
shared is already
used for the files shared among job submissions.
Each of these directories will create an individual job within
the single DAG.
When the job starts,
its current working directory on the machine where the job executes
will contain copies of all files placed in the run-specific directory
on the submit machine,
as well as copies of all files placed in the
shared directory on the submit machine.
Input files, shared libraries, and all executables shared by
all jobs go into a directory with the name
Create the directory
Place the executable and any input files common to the
set of jobs that will be submitted into directory
shared directory will not become an individual job.
For example, you might want to run several jobs on data you have for
several midwestern states, where there is one job per state.
Each state has its own input data file,
There is also a shared input data file of US-wide averages for comparison,
as well as a single executable (program).
For each job submission, assume this program
will compare contents of
Given this, a portion of the directory hierarchy might look like this:
With a current working directory of
with a job-specific set of command line arguments.
The output from from running
will be a directory to hold eventual output from running
the project's job(s),
as well as control files:
a DAG input file for describing the DAG
and an HTCondor job submit description files for each of the node jobs within
One of the command line arguments to
will specify the name of this directory.
The command line arguments to
This required argument identifies which file within the
directory should be executed.
It should be only the base name of the file
do not include directory information.
This required argument identifies the relative path to and
name of the directory that contains the
The path is specified as relative to the directory containing the
The string used instead of
for this presented example would be
This required argument identifies where the output from your
jobs will be placed.
This is the relative path to and
specifies a name for the directory within
that will be created, and within which the directories and files
produced by the
mkdag script will go.
Do not create this directory before running
The directory will be created by
and it will contain one subdirectory for each of the jobs within the DAG.
This required argument helps identify if a job ran successfully.
For a variety of reasons,
we cannot necessarily trust the return code from MATLAB or R
to tell us if the job was successful.
This argument defines a substring of a file's name that will
be created as output from the execution of each HTCondor job within the DAG.
We determine if a job was successful by checking if at least one
file name matching
was created for each HTCondor job submitted.
This check is identical to
and seeing that at least one file is returned.
This optional argument identifies a command line argument that
is to be passed to each invocation (as an HTCondor job) of the executable.
This argument will be listed multiple times to define more than one
command line argument.
--type argument is required,
and must be set to one of 3 values.
For MATLAB jobs.
It ensures that necessary MATLAB supporting libraries are made
available to the job.
For R jobs.
It ensures that the R runtime environment is made available to the job.
For jobs that are neither MATLAB or R.
Jobs of type
Other do not have any libraries or runtime
environment automatically provided.
An optional argument that identifies the job as one which is only to run
on CHTC resources.
Matlab and R jobs will run in OSG and CHTC resources by default.
This optional argument indicates that job with
--type=Other should run on OSG and CHTC resources.
Such jobs default to only using CHTC resources.
This argument is required for R jobs.
It specifies the version of R needed.
Possible values are the same as they were for building R:
(version R-2.10.1 on Scientific Linux 5)
(version R-2.13.1 on Scientific Linux 5)
(version R-2.14.1 on Scientific Linux 5)
(version R-2.15.1 on Scientific Linux 5)
(version R-2.15.2 on Scientific Linux 5)
(version R-2.15.3 on Scientific Linux 5)
An optional argument that identifies how much memory each job
within the DAG should be allocated in order to usefully run
(its resident set size).
Specify the value in integer units of Mbytes.
When this optional argument is not given,
a default of 1 Gbyte of memory is requested for each job.
For example, assume that the
is a compiled MATLAB program that takes two arguments:
the files to compare.
It produces a file called
The command line for
./mkdag --cmdtorun=compare-states --data=proj1data \
--dagdir=proj1output --pattern=output.dat --parg=us.dat \
(The backslashes above are used to break a long command across three lines. You can omit the backslashes and enter your command as a single line.)
From the directory defined and then created by the
command line argument and output,
This submits and runs the job(s).
Output from the DAG's node jobs will also be placed within this