next up previous contents
Next: wait Up: FBSNG Command Line Interface Previous: FBSNG Command Line Interface   Contents


submit

The format of the submit command is:

  fbs submit [-w [-t <timeout>]][-o <override_string>]...
             [<jdf_file> [<jdf_args> ...]]
If the job is successfully submitted, the command will return a status of 0 and write the farm job id to stdout. This id can be used by other FBSNG commands to control and monitor the job. The jobid refers to all user processes associated with this JDF. The following example submits the JDF file sleep_well:
fbs submit sleep_well
Farm Job < 6505 > has been submitted ...
The -w argument cause submit to block until the job finishes. If the -t option is supplied, then the command will wait at most timeout minutes. submit returns with the following codes if the wait option is specified:

There are 2 ways to override fields in the JDF file. One is using override string. The override string is composed of at least one keyword=value pairs. Valid keywords are:
SECTION
EXEC
QUEUE
NUMPROC
DEPEND
STDOUT
STDERR
NEED
MAILTO
NICE
LEADER_ONLY
SECT_STDOUT
PROC_RESOURCES
SECT_RESOURCES
PROC_TYPE
HOLD_TIME

If value has whitespace characters in it, then it must be enclosed in single quotes. If SECTION is omitted, then the override will be applied to all sections of the job. For example, if a user submitted test.jdf, which was composed of two sections one and two, the following would cause both sections to execute 10 copies of the executable:
-o ``NUMPROC=10''
If the JDF file is not supplied as an argument to the submit command, then the values supplied with the -o flag will be used to construct the users job. When a JDF file is not supplied, a SECTION must be given in the override string.

The following are some examples of using the override string.
Example 1 - Override the EXEC field for step main
fbs submit -o `` SECTION=main EXEC='my.exe arg1 arg2''' my.jdf
Double quotes surround the entire string, single quotes surround the EXEC string.

Example 2 - Override the NUMPROC field of section one and override
the EXEC field of section two.
fbs submit -o `` SECTION=one NUMPROC=5'' -o
``SECTION=two EXEC='my.exe arg1 arg2'''
Again, double quotes are used to surround the entire override strings, single quotes are used to surround substrings within the override string (in this example, my.exe arg1 arg2). Notice on the second example that two override flags were given to the submit command. Both overrides will be applied, provided that the section names are unique. If the section names are the same, then the last override string will be processed and the preceding override strings ignored.

Using the override flag, one can also specify all information needed by FBSNG, eliminating the need to specify a JDF file on the submit command.

The other way to override information specified in existing JDF file is to use JDF file arguments as arguments following JDF file specification in fbs submit command. When reading JDF, fbs submit command will replace $(1), $(2),$(3), etc. with first, second, third, etc. arguments following JDF specification.

For example, if JDF looks like this


    SECTION A
    QUEUE=$(1)
    EXEC=$(2) $(3) $(4)

and the user issues command


    fbs submit my.jdf TEST /home/me/bin/run.sh slow 300

placeholders in the JDF will be replaced with arguments from the fbs submit command, and as the result the following job will be submitted:


    SECTION A
    QUEUE=TEST
    EXEC=/home/me/bin/run.sh slow 300
This is similar to using positional arguments when calling a shell script. This method can not be used to specify extra JDF fields or change section names. For example, the following is invalid JDF:


    SECTION $(1)    # to be defined at job submission time
    QUEUE=$(2)
    EXEC=$(3)
    $(4)            # to be replaced with extra fields
    $(5)


next up previous contents
Next: wait Up: FBSNG Command Line Interface Previous: FBSNG Command Line Interface   Contents
FBSNG Home