Job submission into the LHC Grid Job Management
Job submission into the LHC Grid (Job Management + JDL) edited by Gabor Hermann MTA SZTAKI EGEE is funded by the European Union under contract EGEE IST-2003 -508833 Summer School Grid Systems – 3 -8 July 2006 - 1
Acknowledgement • This tutorial is based on the work of many people: • • • Fabrizio Gagliardi, Flavia Donno and Peter Kunszt (CERN) Simone Campana (INFN) the EDG developer team the EDG training team the Ne. SC training team the SZTAKI training team EGEE Summer School Budapest, 3 -8 July 2006
Job Management • The user interacts with Grid via a Workload Management System (WMS) • The Goal of WMS is the distributed scheduling and resource management in a Grid environment. • What does it allow Grid users to do? To submit their jobs • To execute them on the “best resources” • • The WMS tries to optimize the usage of resources To get information about their status • To retrieve their output • EGEE Summer School Budapest, 3 -8 July 2006
WMS Components • WMS is currently composed of the following parts: 1. Workload Manager, which is the core component of the system 2. Match-Maker (also called Resource Broker), whose duty is finding the best resource matching the requirements of a job (matchmaking process). 3. Job Adapter, which prepares the environment for the job and its final description, before passing it to the Job Control Service. 4. Job Control Service (JCS), which finally performs the actual job management operations (job submission, removal. . . ) 5. Logging and Bookkeeping services (LB) : store Job Info available for users to query EGEE Summer School Budapest, 3 -8 July 2006
Job Preparation: Let’s think the way the Grid thinks! • Information to be specified Job characteristics • Requirements and Preferences of the computing system • • including software dependencies • Job Data requirements • Specified using a Job Description Language (JDL) EGEE Summer School Budapest, 3 -8 July 2006
Job Submission RLS UI Network Server RB node Inform. Service Workload Manager Job Contr. Condor. G Computing Element CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
UI: allows users to access the functionalities of the WMS (via command line, GUI, C++ and Java APIs) Job Submission Job Status RLS UI Network Server RB node submitted Inform. Service Workload Manager Job Contr. Condor. G Computing Element CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI Network Server RB node Job Description Language submitted (JDL) to specify job characteristics and Inform. requirements Service SE characts CE characts & status Workload Manager & status edg-job-submit myjob. jdl (glite-job-submit) Myjob. jdl Job. Type = “Normal”; Executable = "$(CMS)/exe/sum. exe"; Contr. Input. Sandbox = {"/home/user/WP 1 test. C", "/home/file*”, "/home/user/DATA/*"}; Output. Sandbox = {“sim. err”, “test. out”, “sim. log"}; Condor. G== “linux" && Requirements = other. Glue. Host. Operating. System. Name other. Glue. CEPolicy. Max. Wall. Clock. Time > 10000; Rank = other. Glue. CEState. Free. CPUs; Computing Element Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission UI NS: network daemon responsible for accepting incoming requests RLS Job submitted Network Server RB node Input Sandbox files Job Status Inform. Service waiting Workload Manager RB storage Computing Element Job Contr. Condor. G CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission UI Network Server WM: responsible to take the appropriate actions RLS to satisfy the request RB node Workload Manager RB storage Computing Element Job Contr. Condor. G Inform. Service CE characts & status Job Status submitted waiting SE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission UI RB node Network Server Workload Manager Where must this job be executed ? Match. Maker/ Broker Job Status RLS submitted Inform. Service waiting RB storage Job Contr. Condor. G Computing Element CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission UI RB node Network Server Workload Manager RB storage Computing Element Job Contr. Condor. G Matchmaker: responsible to find the “best” CE where to submit a job Match. Maker/ Broker Job Status RLS submitted Inform. Service CE characts & status waiting SE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node Network Server submitted Match. Maker/ Broker Inform. Service waiting Workload Manager RB storage Job Contr. Condor. G CE characts & status SE characts & status What is the status of the Grid ? Computing Element Where are (which SEs) the needed data ? Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status UI RB node Network Server Workload Manager RB storage Computing Element Job Contr. Condor. G RLS Match. Maker/ Broker submitted Inform. Service waiting CE choice CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status UI RB node Network Server Inform. Service Workload Manager RB storage Computing Element RLS JA: responsible for the final “touches” to the job before performing submitted submission (e. g. creation of wrapper script, etc. ) Job Contr. Condor. G waiting Job Adapter CE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node Network Server Workload Manager RB storage Job Contr. Condor. G Computing Element submitted Inform. JC: responsible for the Service actual job management operations (done via Condor. G) CE characts & status waiting ready SE characts & status Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node submitted Network Server Inform. Service waiting Workload Manager RB storage Input Sandbox files Computing Element Job Contr. Condor. G ready CE characts & status scheduled SE characts & status Job Storage Element EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node submitted Network Server Inform. Service Workload Manager waiting ready RB storage Job Contr. Condor. G scheduled running “Grid enabled” data transfers/ accesses Computing Element Storage Element Job EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node Network Server Inform. Service Workload Manager RB storage Output Sandbox files Computing Element submitted waiting ready Job Contr. Condor. G scheduled running Storage Element done EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI RB node Network Server Inform. Service Workload Manager RB storage edg-job-get-output <dg-job-id> glite-get-output submitted waiting ready Job Contr. Condor. G scheduled running Computing Element Storage Element done EGEE Summer School Budapest, 3 -8 July 2006
Job Submission Job Status RLS UI Network Server Output Sandbox files Inform. Service Workload Manager RB storage submitted waiting ready RB node Job Contr. Condor. G scheduled running Computing Element Storage Element done cleared EGEE Summer School Budapest, 3 -8 July 2006
edg-job-status <dg-job-id> Job monitoring glite-job-status edg-job-get-logging-info <dg-job-id> glite-job-logging-info UI Job status LB: receives and stores job events; processes corresponding job status. Checkpointing! RB node Network Server Workload Manager Logging & Bookkeeping Job Contr. Condor. G Log Monitor LM: parses Condor. G log file (where Condor. G logs info about jobs) and notifies LB Log of job events Computing Element EGEE Summer School Budapest, 3 -8 July 2006
Possible job states By system By User EGEE Summer School Budapest, 3 -8 July 2006
Job Submission syntax edg-job-submit (glite-job-submit) [–r <res_id>] [-c <config file>] [-vo <VO>] [-o <output file>] <job. jdl> -r the job is submitted directly to the computing element identified by <res_id> -c the configuration file <config file> is pointed by the UI instead of the standard configuration file -vo the Virtual Organisation (if user is not happy with the one specified in the UI configuration file) -o the generated edg_job. Id is written in the <output file> Useful for other commands, e. g. : edg-job-status –i <input file> (or edg_job. Id) -i the status information about edg_job. Id contained in the <input file> are displayed EGEE Summer School Budapest, 3 -8 July 2006
Other (most relevant) UI commands • edg-job-list-match (glite-job-list-match) Lists resources matching a job description • The - - rank option prints the ranking of each resource • Performs the matchmaking without submitting the job • See matchmaking section later • • edg-job-cancel • Cancels a given job • edg-job-status • (glite-job-cancel) (glite-job-status) Displays the status of the job • edg-job-get-output (glite-get-output) • Returns the job-output (the Output. Sandbox files) to the user EGEE Summer School Budapest, 3 -8 July 2006
Other (most relevant) UI commands • edg-job-get-logging-info (glite-job-logging-info) Displays logging information about submitted jobs (all the events “pushed” by the various components of the WMS) • Different levels of verbosity (-v option) : • • Verbosity 1 is the most suitable for debugging • Verbosity 2 is just too much info • About debugging a failed job • • Understanding a job failure is not an easy task Output of edg-job-get-logging-info not always straightforward to interpret • Short failure description • Difficult to distinguish a “grid” failure from a “user job” problem • Same error could be due to different causes (“in-famous” globus 155 …) • More useful info can be found in the logs of the RB • Not easily accessible by the end user • In principle can fetch them using gridftp but … come on … • • User should try to log as much info as possible in the standard error file. User should try to monitor the job/application • RGMA, Grid. Ice for jobs status • RGMA for applications EGEE Summer School Budapest, 3 -8 July 2006
Job Flow Status and Errors • Status queries from the UI machine (static or dynamic): job status queries are addressed to the LB database. • Resource status queries are addressed to the BDII • • If the site where the job is being run falls down, the job will be automatically resent to another CE that is analogue to the previous one, w. r. t. requirements the user asked for. • In the case that this new submission is disabled, the job will be marked as aborted. • Users can get information about what happened by simply questioning the LB service. EGEE Summer School Budapest, 3 -8 July 2006
Job Description Language EGEE Summer School Budapest, 3 -8 July 2006
Job Description Language • The supported attributes are grouped in two categories: • Job Attributes • Define the job itself • Resource expression attributes • Taken into account by the RB for carrying out the matchmaking algorithm (to choose the “best” resource where to submit the job) • Computing Resource – Used to build expressions of Requirements and/or Rank attributes by the user – Have to be prefixed with “other. ” (external) or “self. ” (internal) • Data and Storage resources – Input data to process, – SE where to store output data, – protocols spoken by application when accessing SEs EGEE Summer School Budapest, 3 -8 July 2006
JDL: some relevant attributes • Job. Type • • Normal (simple, sequential job), Interactive, MPICH, Checkpointable Or combination of them • Executable (mandatory) • The command name • Arguments (optional) • Job command line arguments • Std. Input, Std. Output, Std. Error (optional) • Standard input/output/error of the job • Environment (optional) • List of environment settings • Input. Sandbox (optional) • • List of files on the UI local disk needed by the job for running The listed files will automatically staged to the remote resource • Output. Sandbox (optional) • List of files, generated by the job, which have to be retrieved • Virtual. Organisation (optional) • A different way to specify the VO of the user EGEE Summer School Budapest, 3 -8 July 2006
JDL: some relevant attributes II • Input Data (Just a suggestion!) • Data. Access. Protocol file|gridftp|rfio (Together with Input. Data) • Output Data {Output. File= [CE path] [ Storage. Element= SE ] [ Logical. File. Name = lfn: file. Name ] }(Real Data movement) • Output. SE • rank • requirements • My. Proxy. Server • Retry. Count • Node. Number • Job. Steps EGEE Summer School Budapest, 3 -8 July 2006
Example of JDL file [ Job. Type = “Normal”; Executable = "$(CMS)/exe/sum. exe"; Input. Sandbox = {"/home/user/WP 1 test. C", "/home/file*”, "/home/user/DATA/*"}; Output. Sandbox = {“sim. err”, “test. out”, “sim. log"}; Requirements = (other. Glue. Host. Operating. System. Name == “linux") && (other. Glue. CEPolicy. Max. Wall. Clock. Time > 10000); Rank = other. Glue. CEState. Free. CPUs; ] EGEE Summer School Budapest, 3 -8 July 2006
A “real world” JDL file [ job attributes part Job. Type = "normal"; Executable = "lexor_wrap. sh"; Std. Output = "dc 2. 003020. digit. A 8_QCD. _01730. job. log. 3"; Std. Error = {"dc 2. 003020. digit. A 8_QCD. _01730. job. log. 3"; } Output. Sandbox {"metadata. xml", "lexor_wrap. log", "dq_337704_stagein. log", "dq_337704_stageout. log", "dc 2. 003020. digit. A 8_QCD. _01730. job. log. 3" }; Retry. Count = 0; Arguments = "dc 2. 003020. simul. A 8_QCD. _01730. pool. root, dc 2. 003020. digit. A 8_QCD. _01730. pool. root. 3 100 0"; Environment = { "LEXOR_WRAPPER_LOG=lexor_wrap. log", "LEXOR_STAGEOUT_MAXATTEMPT=5", "L EXOR_STAGEOUT_INTERVAL=60", "LEXOR_LCG_GFAL_INFOSYS=atlasbdii. cern. ch: 2170", "LEXOR_T_RELEASE=8. 0. 7", "LEXOR_T_PACKAGE=8. 0. 7. 5/Job. Tran sforms", "LEXOR_T_BASEDIR=Job. Transforms-08 -00 -0705", "LEXOR_TRANSFORMATION=share/dc 2. g 4 digit. trf", "LEXOR_STAGEIN_LOG=dq_3 37704_stagein. log", "LEXOR_STAGEIN_SCRIPT=dq_337704_stagein. sh", "LEXOR_STA GEOUT_LOG=dq_337704_stageout. log", "LEXOR_STAGEOUT_SCRIPT=dq_337704_st ageout. sh" }; My. Proxy. Server = "lxb 0727. cern. ch"; Virtual. Organisation = "atlas"; rank = -other. Glue. CEState. Estimated. Response. Time EGEE Summer School Budapest, 3 -8 July 2006
A “real world” JDL file (cont. ) resource attributes requirements = ( Member("VO-atlas-lcg-release-0. 0. 2", part other. Glue. Host. Application. Software. Run. Time. Environment) && (other. Glue. CEState. Status == "Production“) && !Member("VO-atlas-has-m 1", other. Glue. Host. Application. Software. Run. Time. Environment)) && (other. Glue. CEInfo. Host. Name != "lcgce 02. gridpp. rl. ac. uk" ) && (other. Glue. CEInfo. Host. Name != "lcg-ce. lps. umontreal. ca" ) && (other. Glue. CEInfo. Host. Name != "lcgce 02. triumf. ca" ) && (other. Glue. CEInfo. Host. Name != "ce-a. ccc. ucl. ac. uk" ) && Member("VO-atlas-release-8. 0. 7", other. Glue. Host. Application. Software. Run. Time. Environment)) && ( other. Glue. CEPolicy. Max. CPUTime >= (Member("LCG 2_1_0", other. Glue. Host. Application. Software. Run. Time. Environment) ? ( 36000000 / 60 ) : 36000000 ) / other. Glue. Host. Benchmark. SI 00 ) ) && ( other. Glue. Host. Network. Adapter. Outbound. IP == true ) && (other. Glue. Host. Main. Memory. RAMSize >= 512 ) ); ] EGEE Summer School Budapest, 3 -8 July 2006
Requirements • Job requirements on the resources • Specified using GLUE attributes of resources published in the Information Service • Its value is a boolean expression • Only one requirements can be specified ( one C-like logic expression ) • if there are more than one, only the last one is taken into account • If not specified, default value defined in UI configuration file is considered • Default: other. Glue. CEState. Status == "Production" (the resource has to be able to accept jobs and dispatch them on WNs) EGEE Summer School Budapest, 3 -8 July 2006
Relevant Glue Attributes 1 (State) • State (objectclass Glue. CEState) • Glue. CEState. Running. Jobs: • number of running jobs • Glue. CEState. Waiting. Jobs: • number of jobs not running • Glue. CEState. Total. Jobs: • total number of jobs (running + waiting) • Glue. CEState. Status: • queue status: queueing (jobs are accepted but not run), production (jobs are accepted and run), closed (jobs are neither accepted nor run), draining (jobs are not accepted but those in the queue are run) • Glue. CEState. Worst. Response. Time: • worst possible time between the submission of a job and the start of its execution • Glue. CEState. Estimated. Response. Time: • estimated time between the submission of a job and the start of its execution • Glue. CEState. Free. CPUs: • number of CPUs available to the scheduler EGEE Summer School Budapest, 3 -8 July 2006
Relevant Glue Attributes 2 (Hardware) • Architecture (objectclass Glue. Host. Architecture) • Glue. Host. Architecture. Platform. Type: • platform description • Glue. Host. Architecture. SMPSize: • number of CPUs • Processor (objectclass Glue. Host. Processor) • Glue. Host. Processor. Vendor: • name of the CPU vendor • Glue. Host. Processor. Model: • name of the CPU model • Glue. Host. Processor. Version: • version of the CPU • Glue. Host. Processor. Other. Processor. Description: • other description for the CPU • […] EGEE Summer School Budapest, 3 -8 July 2006
Relevant Glue Attributes 3 (HW & Software) • Application software (objectclass Glue. Host. Application. Software) • Glue. Host. Application. Software. Run. Time. Environment: • list of software installed on this host • Main memory (objectclass Glue. Host. Main. Memory) • Glue. Host. Main. Memory. RAMSize: • physical RAM • Glue. Host. Main. Memory. Virtual. Size: • size of the configured virtual memory • Benchmark (objectclass Glue. Host. Benchmark) • Glue. Host. Benchmark. SI 00: • Spec. Int 2000 benchmark • Glue. Host. Benchmark. SF 00: • Spec. Float 2000 benchmark • Network adapter (objectclass Glue. Host. Network. Adapter) • • […] Glue. Host. Network. Adapter. Outbound. IP: • permission for outbound connectivity • Glue. Host. Network. Adapter. Inbound. IP: • permission for inbound connectivity EGEE Summer School Budapest, 3 -8 July 2006
Exercise: JDL Requirements • other. Glue. CEInfo. LRMSType == “PBS” && other. Glue. CEInfo. Total. CPUs > 1 (the resource has to use PBS as the LRMS and whose WNs have at least two CPUs) • Member(“CMSIM-133”, other. Glue. Host. Application. Software. Run. Time. Environment) (a particular experiment software has to run on the resource and this information is published on the resource environment) – The Member operator tests if its first argument is a member of its second argument. Used in case of multi attribute. • Reg. Exp(“cern. ch”, other. Glue. CEUnique. Id) (the job has to run on the CEs in the domain cern. ch) – Matches the regular expression • (other. Glue. Host. Network. Adapter. Outbound. IP == true) && Member(“VO-alice-Alien”, other. Glue. Host. Application. Software. Run. Time. Environment) && Member(“VO-alice. Alien-v 4 -01 -Rev-01”, other. Glue. Host. Application. Software. Run. Time. Environment) && (other. Glue. CEPolicy. Max. Wall. Clock. Time > 86000) (the resource must have some packages installed VO-alice-Alien and VO-alice-Alien-v 4 -01 -Rev-01 and the job has to run for more than 86000 Wall. Clock time units) EGEE Summer School Budapest, 3 -8 July 2006
Rank • Expresses preference (how to rank resources that have already met the Requirements expression) • It is expressed as a floating-point number • The CE with the highest rank is the one selected (see Matchmaking later on) • If not specified, default value defined in the UI configuration file is considered • Examples: • -other. Glue. CEState. Estimated. Response. Time (the lowest estimated traversal time) • Usually the default • other. Glue. CEState. Free. CPUs (the highest number of free CPUs) • Bad idea: number of free CPU published per QUEUE, not per VO • (other. Glue. CEState. Waiting. Jobs == 0 ? other. Glue. CEState. Free. CPUs : other. Glue. CEState. Waiting. Jobs) (the number of waiting jobs is used if this number is not null and the rank decreases as the number of waiting jobs gets higher; if there are not waiting jobs, the number of free CPUs is used) EGEE Summer School Budapest, 3 -8 July 2006
Relevant Glue Attributes about policy of LRMS • Glue. CEPolicy. Max. Wall. Clock. Time: • maximum wall clock time available to jobs submitted to the CE, in seconds (previously it was in minutes) • Glue. CEPolicy. Max. CPUTime: • maximum CPU time available to jobs submitted to the CE, in seconds (previously it was in minutes) • Glue. CEPolicy. Max. Total. Jobs: • maximum allowed total number of jobs in the queue • Glue. CEPolicy. Max. Running. Jobs: • maximum allowed number of running jobs in the queue • Glue. CEPolicy. Priority: • information about the service priority EGEE Summer School Budapest, 3 -8 July 2006
WMS Matchmaking EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm • The matchmaker has the goal to find the best suitable CE where to execute the job • To accomplish this task, the WMS interacts with the other EGEE/LCG components (File Catalog, and Information Service) • There are three different scenarios to be dealt with separately: Direct job submission • Job submission without data-access requirements • Job submission with data-access requirements • EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: direct job submission CE defined in the JDL • The WMS does not perform any matchmaking algorithm at all • The job is simply submitted to the specified CE CE defined during the edg-job-submit (glue-job-submit) command: • If the CEId is specified then the WMS Does NOT check whether the user is authorised to access the CE • Does NOT interacts with the File Catalog for the resolution of files requirements • Only checks the JDL syntax, while converting the JDL into a Class. Ad • • Syntax: edg-job-submit --resource <ce_id> <nome. jdl> command ce_id = hostaname: port/jobmanager-lsf-grid 01 EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: job submission without data access requirements (I) • The user JDL contains some requirements • Once the JDL has been received by the WMS and converted in Class. Ad, the WMS invokes the matchmaker • The matchmaker has to find if the characteristics and status of Grid resources match the job requirements EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: job submission without data access requirements (II) • There are two phases of evaluation: Requirements check: • The Matchmaker contacts the BDII in order to create a set of suitable CEs compliant with user requirements and where the user is authorized to submit jobs • The Matchmaker creates the set of suitable CEs • Ranking phase: • The Matchmaker contacts the BDII again to obtain the values of those attributes that are in the rank expression (used to contact GRISes) • • The CE with maximum rank value is selected • If 2 or more CE have same rank, Matchmakes selects random one • Can adopt a stochastic selection (enabling fuzzyness) The user has to set the JDL Fuzzy. Rank attribute to true • The rank value = probability to select the CE • The higher the rank value is, the higher the probability is. • EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: job submission with data access requirements (I) • The user can specify in the JDL the following attributes • Input. Data represents the input files • Input. Data = {“lfn: my-file-001"} • lfn=logical file name, see Data Management • Output. SE represents the SE where the output file should be staged • Output. SE = "gilda-se-01. pd. infn. it"; • Output. Data represents the output files Match. Maker/ Broker • Output. File = "dummy. dat"; • Storage. Element = "gilda-se-01. pd. infn. it"; • Logical. File. Name = "lfn: iome_output. Data"; • Data. Access. Protocol represents the protocol spoken by the application to access the file FC IS • Data. Access. Protocol = "gsiftp"; EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: job submission with data access requirements (II) • The Matchmaker finds the most suitable CEs taking into account • the SEs where input data are physically stored • the SE where output data should be staged • Previous to requirements and ranking checks, the broker • Performs a pre-match processing • interacts with File Catalog • Filters CEs satisfying both data access and user authorization requirements EGEE Summer School Budapest, 3 -8 July 2006
The Matchmaking algorithm: job submission with data access requirements(III) Summaray • The Matchmaker interacts with a File Catalogue and the Information Service • The FC is used to resolve the location of data (see Data Management talk for more details ) • The Matchmaker finds most sutable CEs considering SEs where both input data are physically stored • SEs where output data should be staged • • Previous to requirements and ranking checks, the broker Performs a pre-match processing (access the FC) • Filters CEs satisfying both data access and user authorization requirements • EGEE Summer School Budapest, 3 -8 July 2006
Job types in LCG-2 EGEE Summer School Budapest, 3 -8 July 2006
Normal job • We have talked about Normal jobs sequential program • takes input • performs computation • writes output • • The user gets the output after the execution EGEE Summer School Budapest, 3 -8 July 2006
Interactive Job (I) • The Interactive job is a job whose standard streams are forwarded to the submitting client • The user has to set the JDL Job. Type attribute to interactive • When an interactive job is submitted, the edg-job-submit command • starts a Grid console shadow process in the background that listens on a port assigned by the Operating System • The port can be forced through the Listener. Port attribute in the JDL • opens a new window where the incoming job streams are forwarded • The DISPLAY environment variable has to be set correctly, because an X window is open • The user can specify --nogui option, which makes the command provide a simple standard non-graphical interaction with the running job • It is not necessary to specify the Output. Sandbox attribute in the JDL because the output will be sent to the interactive window EGEE Summer School Budapest, 3 -8 July 2006
Interactive jobs (II) • Specified setting Job. Type = “Interactive” in JDL • When an interactive job is executed, a window for the stdin, stdout, stderr streams is opened Possibility to send the stdin to the job • Possibility the have the stderr and stdout of the job when it is running • • Possibility to start a window for the standard streams for a previously submitted interactive job with command edg-job-attach EGEE Summer School Budapest, 3 -8 July 2006
Logical Checkpointing Job • The Checkpointing job is a job that can be decomposed in several steps • In every step the job state can be saved in the LB and retrieved later in case of failures • The job state is a set of pairs <key, value> defined by the user • The job can start running from a previously saved state and not from the beginning again • The user has to set the JDL Job. Type attribute to checkpointable EGEE Summer School Budapest, 3 -8 July 2006
Logical Checkpointing Job • When a checkpointable job is submitted and starts from the beginning, the user run simply the edg-job-submit command • the number of steps, that represents the job phases, can be specified by the Job. Steps attribute • e. g. Job. Steps = 2; • the list of labels, that represents the job phases, can be specified by the Job. Steps attribute • e. g. Job. Steps = {“genuary”, “february”}; • The latest job state can be obtained by using the edg-job-get-chkpt <jobid> command • A specific job state can be obtained by using the edg-job-get-chkpt –cs <state_num> <jobid> command • When a checkpointable job has to start from an intermediate job state, the user run the edg-job-submit command using the –chkpt <state_jdl> option where <state_jdl> is a valid job state file, where the state of a previously submitted job was saved EGEE Summer School Budapest, 3 -8 July 2006
Job checkpointing example int main () { … for (int i=event; i < EVMAX; i++) { < process event i>; }. . . exit(0); } Example of Application (e. g. HEP Monte. Carlo simulation) EGEE Summer School Budapest, 3 -8 July 2006
Job checkpointing example #include "checkpointing. h" int main () { Job. State state(Job. State: : job); event = state. get. Int. Value("first_event"); PFN_of_file_on_SE = state. get. String. Value("filename"); …. var_n = state. get. Bool. Value("var_n"); < copy file_on_SE locally>; … for (int i=event; i < EVMAX; i++) { < process event i>; . . . state. save. Value("first_event", i+1); < save intermediate file on a SE>; state. save. Value("filename", PFN of file_on_SE); . . . state. save. Value("var_n", value_n); state. save. State(); } User code must be easily instrumented in order to exploit the checkpointing framework … EGEE Summer School Budapest, 3 -8 July 2006
Job checkpointing example #include "checkpointing. h" int main () { Job. State state(Job. State: : job); event = state. get. Int. Value("first_event"); PFN_of_file_on_SE = state. get. String. Value("filename"); …. var_n = state. get. Bool. Value("var_n"); < copy file_on_SE locally>; … for (int i=event; i < EVMAX; i++) { < process event i>; . . . state. save. Value("first_event", i+1); < save intermediate file on a SE>; state. save. Value("filename", PFN of file_on_SE); . . . state. save. Value("var_n", value_n); state. save. State(); } • User defines what is a state • Defined as <var, value> pairs • Must be “enough” to restart a computation from a previously saved state EGEE Summer School Budapest, 3 -8 July 2006
Job checkpointing example #include "checkpointing. h" int main () { Job. State state(Job. State: : job); event = state. get. Int. Value("first_event"); PFN_of_file_on_SE = state. get. String. Value("filename"); …. var_n = state. get. Bool. Value("var_n"); < copy file_on_SE locally>; … for (int i=event; i < EVMAX; i++) { < process event i>; . . . state. save. Value("first_event", i+1); < save intermediate file on a SE>; state. save. Value("filename", PFN of file_on_SE); . . . state. save. Value("var_n", value_n); state. save. State(); } User can save from time to time the state of the job EGEE Summer School Budapest, 3 -8 July 2006
Job checkpointing example #include "checkpointing. h" int main () { Job. State state(Job. State: : job); event = state. get. Int. Value("first_event"); PFN_of_file_on_SE = state. get. String. Value("filename"); …. var_n = state. get. Bool. Value("var_n"); < copy file_on_SE locally>; … for (int i=event; i < EVMAX; i++) { < process event i>; . . . state. save. Value("first_event", i+1); < save intermediate file on a SE>; state. save. Value("filename", PFN of file_on_SE); . . . state. save. Value("var_n", value_n); state. save. State(); } Retrieval of the last saved state The job can restart from that point EGEE Summer School Budapest, 3 -8 July 2006
MPI Job • There a lot of libraries supporting parallel jobs, but we decided to support MPICH. • The MPI job is run in parallel on several processors • The user has to set the JDL Job. Type attribute to MPICH and specify the Node. Number attribute that’s the required number of CPUs • When a MPI job is submitted, the UI adds • in the Requirements attribute Member(“Mpi. CH”, other. Glue. Host. Application. Software. Run. Time. Environment) (the MPICH runtime environment must be installed on the CE) other. Glue. CEInfo. Total. CPUs >= Node. Number (a number of CPUs must be at least be equal to the required number of nodes) • In the Rank attribute other. Glue. CEState. Free. CPUs (it is chosen the CE with the largest number of free CPUs) EGEE Summer School Budapest, 3 -8 July 2006
MPI Job [ Job. Type = "MPICH"; Node. Number = 2; Executable = "MPItest. sh"; Argument = "cpi 2"; Input. Sandbox = {"MPItest. sh", "cpi"}; Output. Sandbox = "executable. out"; Requirements = other. Glue. CEInfo. LRMSType == “PBS” || other. Glue. CEInfo. LRMSType == “LSF”; ] • The Node. Number entry is the number of threads of MPI job • The MPItest. sh script only works if PBS or LSF is the local job manager EGEE Summer School Budapest, 3 -8 July 2006
MPI Job • Snapshot of MPItest. sh: # $HOST_NODEFILE contains names of hosts allocated for MPI job for i in `cat $HOST_NODEFILE` ; do echo "Mirroring via SSH to $i" # creates the working directories on all the nodes allocated for parallel execution ssh $i mkdir -p `pwd` # copies the needed files on all the nodes allocated for parallel execution /usr/bin/scp -rp. /* $i: `pwd` # sets the permissions of the files ssh $i chmod 755 `pwd`/$EXE ssh $i ls -al. R `pwd` done # execute the parallel job with mpirun -np $CPU_NEEDED -machinefile $HOST_NODEFILE `pwd`/$EXE > executable. out • Important: you need shared keys between worker nodes • • • Avoids sharing of home directories Enforced in GILDA NOT enforced in LCG 2 … The VO needs to negotiate on a site by site basis EGEE Summer School Budapest, 3 -8 July 2006
What is a DAG • DAG means Directed Acyclic Graph • Each node represents a job Nod e. A • Each edge represents a temporal dependency between two nodes • e. g. Node. C starts only after Node. A has finished Nod e. C Nod e. B Nod e. D • A dependency represents a constraint on the time a node can be executed • Dedendencies are represented as “expression lists” in the Class. Ad language Nod e. E dependencies = { {Node. A, {Node. C, Node. D}}, {Node. B, Node. D}, Node. E} } EGEE Summer School Budapest, 3 -8 July 2006
DAG Job • The DAG job is a Directed Acyclic Graph Job • The sub-jobs are scheduled only when the corresponding DAG node is ready • The user has to set in the JDL Job. Type = „dag”, • nodes ( containing the description of the nodes), and • dependencies attributes • NOTE: A plug-in has been implemented to map an EGEE DAG submission to a Condor DAG submission • Some improvements have been applied to the Class. Ad API to better address WMS need • EGEE Summer School Budapest, 3 -8 July 2006
DAG Job nodes = { cmkin 1 = [ file = “bckg_01. jdl" ; ], cmkin 2 = [ file = “bckg_02. jdl" ; ], …… cmkin. N = [ file = “bckg_0 N. jdl" ; ] }; dependencies = { {cmkin 1, cmkin 2}, {cmkin 2, cmkin 3}, {cmkin 2, cmkin 5}, {{cmkin 4, cmkin 5}, cmkin. N} } cmk in 1 cmk in 2 cmk in 3 cmk in 4 cmk in 5 cmk in. N EGEE Summer School Budapest, 3 -8 July 2006
- Slides: 66