|
||||||||||||
|
Job Description Language (JDL)How to write a JDL fileIn gLite, job description files (.jdl files) are used to describe jobs for execution on Grid. These files are written using the Job Description Language (JDL). The JDL adopted within gLite is based on the Classified Advertisement (ClassAd) language created by the Condor Project, which deals with the management of distributed computing environments, and whose central construct is the ClassAd, a record-like structure composed of a finite number of distinct attribute names mapped to expressions. A ClassAd is a highly flexible and extensible data model that can be used to represent arbitrary services and constraints on their allocation. The JDL is used in gLite to specify the desired job characteristics and constraints, which are used by the match-making process to select the resources that the job will use. The fundamentals of the JDL are given in this section. The JDL syntax consists of statements ending with a semicolon, like:
Literal strings (for values) are enclosed in double quotes. If a string itself contains double quotes, they must be escaped with a backslash:
For special characters, such as &, the shell on the WN will itself expect the escaped form: \&, and therefore both the slash and the ampersand will have to be escaped inside the JDL file, resulting in:
In general, special characters such as &, |, >, <
are only allowed if specified inside a quoted string or preceded by
triple \. The character `` ` '' cannot be specified in the JDL. The JDL is sensitive to blank characters and tabs. No blank characters or tabs should follow the semicolon at the end of a line. In a job description file, some attributes are mandatory,
while some others are optional.
Standard output, standard error, and stardard input are
redirected to the files std.out, std.err and std.in, respectively,
which are then transferred back to the User Interface after the job has
finished, as they are in the Output Sandbox.
Then, the files to be transferred between the UI and the WN before (Input Sandbox) and after (Output Sandbox) the job execution can be specified:
In this example, the executable test.sh is
also transferred. This would not be necessary if that file was already
in the Worker Node (or, for example, it was a common Unix command, such
as /bin/hostname). Note: The executable flag is not preserved
for the files included in the Input Sandbox when transferred to the WN.
The environment of the job can be modified using the
Environment attribute.
Some JDL attributes allow the user to specify requirements. Specifying requirements on the CE:
where the other. is a prefix used to indicate that the GlueCEUniqueID attribute refers to the GlueSchema CE characteristics. If the job must run on a CE where a particular experiment software is installed and this information is published by the CE, something like the following must be written:
The choice of the CE where to execute the job, among all the
ones satisfying the requirements, is based on the rank of the CE;
but more complex expression are possible.
gLite Job Management CommandsTo submit a job to the gLite Grid, the user must have a valid proxy certificate in the User Interface machine (as described in Security Concept) and use the following command:
where jdlfile is a file containing the job description with
extension .jdl.
The useful -o <file_path> option
allows users to specify a file to which the jobId of the submitted job
will be appended. This file can be given to other job management
commands to perform operations on more than one job with a single
command.
After a job is submitted, it is possible to inspect its status, along with the time when that status was reached, and the reason for being in that state. The option -i _file path_ can be used to specify a file with a list of job identifiers (saved previously with the -o option of glite-job-submit). In this case, the command asks the user interactively the status of which job(s) should be printed. Subsets of jobs can be selected (e.g. 1-2,4). The command to use is:
In the following examples, the first command retrieves all jobs of the user that are in the state DONE or RUNNING, and the second retrieves all jobs that were submitted before the 17:35 of the current day, and that were not in the CLEARED state.
After the job has finished (it reaches the DONE status), its output can be copied to the UI with the following command, which takes a list of jobs as argument.
By default, the output is stored under /tmp, but it is possible to specify in which directory to save the output using the - -dir <path_name_ option>.
A job can be canceled before it ends using the following
command that requires as arguments one or more job identifiers.
How to list the suitable
CEs for a Job It is possible to see which CEs satisfy your job's requirements using the following command:
ExercisesThis exercise allows user to submit a simple job. This job run an hostname command and print the hostname of worknode that ran the job. Be sure to have a valid proxy with VOMS extensions before to start the exercise (use voms-proxy-init --voms gilda to achieve that) Step 1: Create a file named hostname.jdl with this content:
Step 2: Submit the job with the glite-job-submit command:
Step 3: Monitor the job until its status is DONE using the glite-job-status command:
Step 4: Retrieve the job output with the glite-job-output command:
Step 5: Take a look at the job output:
With this exercise, you will gain
some
experience with submitting a real Java program similar to the one that
you'll use for the gLite integrating exercise next Thursday
(assuming you choose the gLite path).
The application is a very simple one. Imagine a three-dimensional
surface or topographical map. You can discover the features of this
map with an application that samples the surface at different points,
and then you can visualize the data that it provides. The process to
examine the data and create the map is very fast, but it's similar in
operation to a real application, which would usually be much slower.
Step 1: download the IntroExercise.tar archive and extract all its content:
Step 2: create a script file named explorer.sh:
This script is used to lauch the RegularExplorer class once the job reaches the WN. -Xms and -Xmx flags are used to increment the heap size allocated to java apps in case you want to sample a pretty big surface.
Step 3: write the following explorer.jdl file:
Step 4: Submit the job explorer.jdl using the gLite commands illustrated above. $ glite-job-submit -o jodid.txt explorer.jdl If you don't remember commands for job handling (submission, monitoring status, retrieve output when the job is done) please refer to gLite Job Management Commands Step 5: Take a look to the file out.dat returned by the job using gnuplot to visualize the tridimensional surface. > > gnuplot It should pop up an image like this:
Probably you will not see any amazing part of the surface in (0,0)-(10,10)! In the next exercise, you will learn how to submit a bunch of RegularExplorer jobs giving as input several arguments in such a way to find out the simple objects spread along the surface. |
|||||||||||
|
||||||||||||
|