Submission Interface - Usage
Overview
The general procedure for using the Submission Interface is as
follows:
1. Modify your script/tool to call xgSubmit.exe and (optionally) xgWait.exe so that processes whose execution we wish
to distribute are queued in the Grid Engine queue.
2. Run the script/tool with xgConsole.exe.
An Example
Let's say we are trying to distributed execution of a script called
"Utest.bat", which runs a simple automated QA procedure consisting
of the following steps:
1. Run the application "Utest.exe" 5 times, each time with
different input data. Each run creates an output file with the
execution results.
2. When done, run "UReport.exe" which checks the script results and
displays a summary report.
Our original script looks like this:
Rem UTest.bat
Rem =========
UTest.exe /in=Input1.dat /out="Results\"
UTest.exe /in=Input2.dat /out="Results\"
UTest.exe /in=Input3.dat /out="Results\"
UTest.exe /in=Input4.dat /out="Results\"
UTest.exe /in=Input5.dat /out="Results\"
UReport.exe /in="Results\" /ShowReport
:end
If we could get the script to execute the different "Utest.exe"
runs in parallel (utilizing local and remote CPUs) we would achieve
a substantial speed-up. Here is the modified version of the .bat
file which achieves this using the Submission Interface:
Rem UTest.bat - Distributed Version
Rem ===============================
xgSubmit.exe /group=UTest /command UTest.exe /in=Input1.dat
/out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input2.dat
/out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input3.dat
/out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input4.dat
/out="Results\"
xgSubmit.exe /group=UTest /command UTest.exe /in=Input5.dat
/out="Results\"
xgWait.exe /group=UTest
UReport.exe /in="Results\" /ShowReport
:end
Explanation
- xgSubmit.exe replaces calls to
UTest.exe, replacing the standard execution with execution through
XGE. Note that the original command line is given as input
following the "/command" option, which should always be the last
specified option. In this example, all "UTest.exe" calls are
assigned the same group name - "UTest".
- xgWait.exe is called before "UReport.exe"
is run in order to pause execution of the script until all tasks in
the group "UTest" have completed (this is required since
"UReport.exe" reads output data created by the "UTest.exe" tool).
This makes it possible to define dependencies between different
execution parts in scripts.
Running the script using xgConsole.exe
Once our script has been properly modified, the following command
line can be used to run it using IncrediBuild:
xgConsole.exe UTest.bat
For a comprehensive overview of the xgConsole.exe command line
options see this section.
The xgSubmit.exe tool is used to submit tasks to the
IncrediBuild Grid Engine . Submitted tasks are queued for execution
and executed on either a remote or local CPU as soon as one becomes
available. Each submitted task can be assigned a group identifier
using the /group argument. xgWait.exe can
then be used throughout the script to pause execution until all
tasks with a given group identifier have completed. Note that the
purpose of the group identifier is only to group a set of submitted
tasks - it is NOT related in any way to Coordinator Build Groups.
xgSubmit.exe can be used to submit a single
task or a set of tasks specified in a
command file (for better performance when submitting a large
group of tasks):
Use this syntax to submit a single task to the Grid Engine queue.
The usage syntax is:
xgSubmit [Arguments] /command <Tool
Command Line>
Note that the "/command" argument should always be specified
last, followed by the command line to be submitted for
execution.
Arguments:
- /group - The Group Identifier. If no group identified is given
the submitted task will belong to a default group name.
- /wait - when specified, xgSubmit will only return control to
the script when the submitted command has completed execution.
- /allowremote=[on|off] - when specified with "off", the
submitted task will always run on the machine that initiated the
build and will never be distributed to a remote Agent.
- /caption - when used, the specified caption will appear as the
caption for the submitted tasks's progress bar in the Build Monitor
Progress page.
Use this syntax for better performance when submitting a large set
of tasks belonging to the same task group. A command file
containing the command lines to be submitted separated by a newline
character is given as input. xgSubmit.exe then reads and submits
the commands specified in the command file. The usage syntax is:
xgSubmit [/group=<Group Identifier>]
/commandfile <Path to Command File>
Note that the "/commandfile" argument should always be specified
last, followed by the path to the file containing the commands to
be submitted.
Arguments:
- /group - The Group Identifier. If no group identified is given
the submitted task will belong to a default group name.
- /wait - when specified, xgSubmit will only return control to
the script when the submitted command has completed execution.
- /allowremote=[on|off] - when specified with "off", the
submitted task will always run on the machine that initiated the
build and will never be distributed to a remote Agent.
Important note: Commands specified in the command file
are executed independently, and not necessarily in the specified
order. In order to create dependencies, use the /group argument in
conjunction with xgWait.exe in your script.
The xgWait.exe tool can be used to pause execution until all
tasks with a given group identifier have completed. This allows
creating dependencies between different execution parts in the
script.
The usage syntax is:
xgWait
/group=<group[,group2,group3,...]>
[/exitcode=<#|highest|lowest>] [/silent] [/all]
Switches:
- /group - The Group Identifier(s) to wait for.
- /exitcode - Exit code for xgWait.exe to return once all tasks
have completed. Specify "highest" or "lowest" in order to return
respectively the highest or lowest exit code of all codes returned
by the task processes, or specify a fixed numeric value.
- /silent - prevents xgWait.exe from writing to the standard
output.
- /all - instead of using /group, /all can be used to wait until
all tasks have completed.
Notes
- "xgWait.exe /all" is implicitly called at the end of the
script/application's execution, in order to allow all tasks
submitted with "xgSubmit.exe" to complete before returning
control.
Copyright (C) 2001-2011 Xoreax Software Ltd. All rights
reserved.