r7 - 28 Oct 2010 - 14:43:48 - CarlosEscobarYou are here: TWiki >  ECiencia Web  >  PracticeSessions > SolutionExercises

Practices: Solutions

Solutions

Remember to initialize your credentials in your VO (i.e. login on the Grid):

voms-proxy-init -voms vo.formacion.es-ngi.eu

Exercise 1: Simple JDL

  1. The JDL file is really simple:
       Executable = "/bin/hostname";
       StdOutput = "stdout.log";
       StdError = "stderr.log";
       
    and the gLite commands that you should used (one by one) are:
       voms-proxy-init -voms vo.formacion.es-ngi.eu
       glite-wms-job-delegate-proxy -d $USER
       glite-wms-job-list-match -d $USER hostname.jdl
       glite-wms-job-submit -d $USER hostname.jdl
       
    During the job submittion, a job identifier (_JobId_) will be generated. This indentifier is unique you each job.
       glite-wms-job-status _JobId_
       glite-wms-job-output _JobId_
       
  2. Testing the cancel command:
       glite-wms-job-submit -d $USER hostname.jdl
       glite-wms-job-cancel _JobId_
       
  3. The "-o jobidfile" option is extremely usefulness since it stores all the job identifiers from all the job submissions and allows an easy status checking and job retrieval:
       glite-wms-job-submit -d $USER -o jobId hostname.jdl
       glite-wms-job-status -i jobId
       glite-wms-job-output -i jobId
      

Exercise 2: JDL with input/output sandbox

  1. The simple bash script (called testsandbox.sh) is as follows:
       #!/bin/sh
       hostname
       echo $USER
       lcg-infosites --vo vo.formacion.es-ngi.eu ce
       
  2. Now, you can test it in your UI session:
       /bin/sh testsandbox.sh
       
    or:
       chmod u+x testsandbox.sh
       ./testsandbox.sh
       
  3. The JDL file can be:
       Executable = "testsandbox.sh";
       StdOutput = "stdout.log";
       StdError = "stderr.log";
       InputSandbox = "testsandbox.sh";
       OutputSandbox = {"stdout.log","stderr.log"};
       
    or:
       Executable = "/bin/sh";
       Arguments = "testsandbox.sh";
       StdOutput = "stdout.log";
       StdError = "stderr.log";
       InputSandbox = "testsandbox.sh";
       OutputSandbox = {"stdout.log","stderr.log"};
       
    and the gLite commands that you should used (one by one) are:
       glite-wms-job-submit -d $USER -o jobId testsandbox.jdl
       glite-wms-job-status -i jobId
       glite-wms-job-output -i jobId
       

Exercise 2b: Running you own programs (InputSandbox properties)

The bash script should look like this:

  1. The simple bash script (called testsandbox.sh) is as follows:
       #!/bin/sh
       hostname
       echo $USER
       lcg-infosites --vo vo.formacion.es-ngi.eu ce
       ./myprogram
       
    and the JDL file as follows:
       Executable = "testsandbox.sh";
       StdOutput = "stdout.log";
       StdError = "stderr.log";
       InputSandbox = {"testsandbox.sh","myprogram"};
       OutputSandbox = {"stdout.log","stderr.log"};
       

Exercise 3: JDL with requirements

To check which are the available CEs, you have to use:

glite-wms-job-list-match -d $USER hostname.jdl
Once you have selected the CE, you should write the proper line to required this CE. Remember that to do it, you have to use the GLUE Schema, in particular GlueCEUniqueID, for this case. You can list the attributes with the command:
lcg-info --vo vo.formacion.es_ngi.eu --list-attrs
  1. Now, in order to specify a CE, you have to add the following lines to the JDL file of exercise 1 (selecting one of the CE given by the previous command):
       Requirements = other.GlueCEUniqueID == "ce-iber.bifi.unizar.es:2119/jobmanager-lcgpbs-formangi"; 
       
    Then, send and retrieve the jobs as in exercise 1.
  2. For the next sub-exercise, you should remember that to specify several requirements you can use the operator AND (&&) and OR (||). Then, you should add the following lines to the JDL file:
       Requirements = other.GlueCEInfoLRMSType == "torque" && other.GlueCEInfoTotalCPUs > 10;
       
    Remember that to retrieve the list of CEs together with their queue managers, you should use the command:
       lcg-info --list-ce --vo vo.formacion.es-ngi.eu --attrs 'LRMS'
       
    where LRMS can be found using lcg-info --vo vo.formacion.es_ngi.eu --list-attrs | grep RMS.
  3. The line that you should include to the JDL file is just
       Member(“OPENMPI”, other.GlueHostApplicationSoftwareRunTimeEnvironment) 
       
    The CEs which fulfill this requirement can be display just using:
       lcg-info --list-ce --vo vo.formacion.es-ngi.eu --query 'Tag=OPENMPI'
       
    or to even obtain more information:
       lcg-info --list-ce --vo vo.formacion.es-ngi.eu --query 'Tag=OPENMPI' --attrs 'Tag'
       
    And all the software packages which are available on each CE can be listed as follows:
       lcg-info --list-ce --vo vo.formacion.es-ngi.eu --attrs 'Tag'
       

Exercise 4: JDL to deal with problems

To force the WMS to ignore ce3.egee.cesga.es:2119/jobmanager-lcgsge-GRID_ngifor, you should add the following line to the JDL:

   Requirements = !(RegExp("ce3.egee.cesga.es", other.GlueCEInfoHostName));
   

Exercise 5: JDL with rank

To display all the attributes together with their corresponding GLUE attribute names

lcg-info --vo vo.formacion.es_ngi.eu --list-attrs
To display the list of the CEs just with the attribute TotalCPUs you should use:
lcg-info --list-ce --vo vo.formacion.es-ngi.eu --attrs 'TotalCPUs'
The GLUE attribute name is GlueCEInfoTotalCPUs.

Therefore, the line that you should add to the JDL file is simply:

   Rank = other.GlueCEInfoTotalCPUs;
   

-- CarlosEscobar - 18 Jun 2010

Edit | WYSIWYG | Attach | PDF | Raw View | Backlinks: Web, All Webs | History: r7 < r6 < r5 < r4 < r3 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback