Passing Arguments to the Program

You can pass arguments to the batch program using the --args flag in your submit file. For example, if you change the arguments line in your submit file to something like the following:

Arguments = --no-save --vanilla --args <arguments>

Then the contents of <arguments> will be passed in to the program as command-line arguments. The syntax for passing and handling these arguments differs depending on the statistics program in use.

Passing Arguments to R

To parse command-line arguments in R, use the following command in your R script:

args <- commandArgs(TRUE)

This puts the command-line arguments (the contents of <arguments>) into the variable args.

Script options

The condor_submit_util makes the task of running jobs using the batch servers easier and more intuitive.  condor_submit_util negotiates all job scheduling; it constructs the appropriate submit file for your job, and calls the condor_submit function. To use this utility you need a program to run. The format for using this script is:

condor_submit_util [OPTIONS]

In addition, the script can notify you when your job is done via email so you do not have to check the queue constantly using condor_q. In future releases, the script also will be able to keep usage data so administrators can track overall performance.

The script can be run in two ways, interactively or from the command line. When running interactively, the script prompts you for the values required to run the batch job. If you supply arguments on the command line, these arguments are used in addition to default values for any values you do not supply.

Options

  • -h, --help
    Print help page and exit.
  • -V, --version
    Print version information and exit.
  • -v, --verbose
    Show information about what goes on during script execution.
  • -I, --Interactive
    Enter interactive mode, in which the script prompts you for the required values.
  • -s, --submitfile FILE
    Specify the name of the created submit file (default is <user-name-datetime>.submit).
  • -k, --keep
    Do not delete the created submit file.
  • -N, --Notify
    Receive notification by email when jobs are complete.
  • -x, --executable FILE
    The executable for condor to run (default is /usr/bin/R).
  • -a, --arguments ARGS
    Any arguments you want to pass to the executable (should be quoted, default is "--no-save --vanilla").
  • -i, --input [FILE|PATT]
    Either an explicit file name or base name of input files to the executable (default is in).
  • -o, --output [PATT]
    Base name of output files for the executable (default is out).
  • -e, --error [PATT]
    Base name of error files for the executable (default is error).
  • -l, --log [PATT]
    Base name of log files for the executable (default is log).
  • -n, --iterations NUM
    Number of iterations to submit (default is 10).
  • -f, --force
    Overwrite any existing files.
  • --noinput
    Use no input file for executable.
  • --noargs
    Send no arguments to executable.

Examples

  1. You have a compiled executable (named foo) that takes a data set and does some analysis. You have five different data sets to run against (named data.0, data.1 ... data.4). You want to save the submit file and be notified when the job is done.

    condor_submit_util -x foo -i "data" -k -N
  2. You have an R program that has some random output. You want to run it 10 times to see the results.

    condor_submit_util -i random.R -n 10
  3. You have an R program that will take a long time to complete. You only need to run it once, but you want to be notified when it is done.

    condor_submit_util -i long.R -n 1 -N

Notes: For -o, -e, and -l, these options are considered base names for the implied files. The actual file names are created with a numerical extension tied to its condor process number (0 indexed). This means that if you execute condor_submit_util -o "out" -n 3, three output files named out.0, out.1, and out.2 are created.
Also, for -i, the script first checks to see if the name supplied is an actual file on disk, if not it uses the argument as a base name, similar to -o, -e, and -i.

    Option conventions

    For most condor_submit_util options, there are two conventions that you can use to specify that option on the command line:

    • The -<letter> convention - Use this simple convention as a short cut.

      For example, the simple option to receive email notification when your batch processing is complete is -N.

    • The --<term> convention - Use this lengthy convention to make it easy to determine what option you use.

      For example, the lengthy option to receive email notification when your batch processing is complete is --Notify.

    Both conventions for specifying an option perform the same function. For example, to receive email notification when your batch processing is complete, the options -N and --Notify perform the same function.

    Pattern Arguments

    For file-related options, such as the output file name or the error file name, you can use a pattern-matching argument. For example, if you specify the option -i "run", Condor looks for an input file with the name run. If there is no file named run, Condor looks for a file name that begins with run., such as run.14.

    If there are multiple files with names that begin with the pattern that you specify, then for the first execution within a cluster, Condor uses the file with the name that matches first in alphanumeric order. For successive executions within a cluster, Condor uses the files with names that match successively in alphanumeric order.