Working with jdl filesIntroduction In the previous section you submitted the job "hostname.jdl" to gilda. If you now look at the source you will see the following:
As you can see the jdl file is basically a list of parameters and the associated values where the value can actually be a single value, a list of values or a complex expression. For the purposes of this tutorial all of these parameters (except Arguments) must be present in each jdl file and have appropriate values set. There are cases where not all of these parameters are needed, but this tutorial will not be looking at these cases.
Modify "hostname.jdl" so that instead of calling /bin/hostname it calls the script "start.sh" instead. This file (as with all files used in this tutorial) already exists in your account and looks like the following:
You will need to change the executable to /bin/sh and the argument to start.sh. You will also need to use the new parameter InputSandbox. The InputSandbox is a list of all the files that need to be sent (in EGEE terminology 'staged') to the CE. For this example you need to send start.sh . A typical usage of bash scripts in the grid is to set environmental variables the actual executable needs and to run a combination of different programs consecutively on the same CE. Once you have made these edits run this job and check your output to see if your job was successful. As stated previously a successful job will have an empty "hostaname.err" whilst "hostname.out" will contain the name of the CE the job ran on. You are now looking at GridIce, a system for monitoring the state of the grid, in particular the usage of different parts of the grid. This version is just monitoring gilda. Explore gilda by clicking on the names of the different sites and then the names of the grid elements at each site. As well as bash scripts you can write your own programs in C. Modify your jdl file to run the executable "myhostname". The source for myhostname can be found in "myhostname.c" and is:
Note that this time you do not need the Arguments parameter. After making the changes run this job and check for success (this should be done after every exercise). In exercise 2 we saw how a C program could be run as a grid job by sending the program as part of the input sandbox. In many cases however this is not a practical solution, for example the executable itself is very large and requires many files in many folders, or alternately you do not have access to the same compiler and environment as is used on the CE (as is the case in this tutorial). The solution then is to compile your program on the CE itself. The easiest way to do this is by using a bash script to run the compiler and then run the executable. Modify your jdl file so that the script "buildandrun.sh" is run with the parameter "myhostname". You will need to ensure that both "buildandrun.sh" and "myhostname.c" are staged to the CE. The script "buildandrun.sh" is simply:
In all of the previous examples you have been working with programs that had no dependencies on software other than the software installed on all WN's. It is normally not a realistic option to send all of this dependant software with the jdl, and in many cases the software installed already on some of the WN's. Similarly there has been no question raised as to what hardware the WN has (e.g. number of CPU's or amount of memory). The jdl file is able to handle these job requirements by the use of the GLUE Schema. All CE's advertise what software their WN's have installed and what their hardware/operating system is to a database on the Information Service. When deciding where to send a job the Resource Broker matches the requirements you have specified against all of the CE's in your VO to see which (if any) can run your job. Consider the following example (the file "demtools.jdl" in your account):
The final line in this file states that the job requires the CE to either support DEMTOOLS or DEMTOOLS-1.0. If you wish to run this example then when you have the output you should open in your browser either "mount_sainte_helens_WA.wrl" or "grand_canyon_AZ.wrl" other.GlueCEUniqueID == "grid010.ct.infn.it:2119/jobmanager-lcgpbs-short"; When you submit the job and reach the point where you usually let the RB choose where to run the job, have a look at the other options in the drop down menu, you should not be surprised at what the other options are.
|
Latest News2nd EchoGRID Strategic Workshop, 29-30 October 2007, Beijing, China: Towards a Shared EU & Chinese Vision for Grid Research Perspectives ... Read moreTechnical sitesTry the GRIDBecome a User
Want to become a user of the EGEE Grid? Click here
Related Projects
If your project is related to EGEE, please register it
Information Sheets
Click here for all the EGEE Information Sheets.
Contact EGEE
Get in touch with the EGEE Project Office at . If you have questions about the Website contact: . |
||||||||||||||||||||||||
EGEE in Other Countries: | | | | | | | | | | | | | | | | | | | EGEE-II is a project funded by the European Union under contract number INFSO-RI-031688 |