1 Using Condor An Introduction Condor Week 2009
2 The Condor Project (Established ‘85) Distributed High Throughput Computing research performed by a team of ~35 faculty, full time staff and students who: face software engineering challenges in a distributed UNIX/Linux/NT environment are involved in national and international grid collaborations, actively interact with academic and commercial entities and users, maintain and support large distributed production environments, and educate and train students.
3 The Condor Project
4 Some free software produced by the Condor Project › Condor System › VDT › Metronome › ClassAd Library › DAGMan › Hawkeye › GCB & CCB › MW › NeST / LotMan › And others… all as open source
5 Full featured system › Flexible scheduling policy engine via ClassAds Preemption, suspension, requirements, preferences, groups, quotas, settable fair-share, system hold… › Facilities to manage BOTH dedicated CPUs (clusters) and non-dedicated resources (desktops) › Transparent Checkpoint/Migration for many types of serial jobs › No shared file-system required › Federate clusters w/ a wide array of Grid Middleware
6 Full featured system › Workflow management (inter-dependencies) › Support for many job types – serial, parallel, etc. › Fault-tolerant: can survive crashes, network outages, no single point of failure. › Development APIs: via SOAP / web services, DRMAA (C), Perl package, GAHP, flexible command- line tools, MW › Platforms: Linux i386/IA64, Windows 2k/XP/Vista, MacOS, FreeBSD, Solaris, IRIX, HP-UX, Compaq Tru64, … lots. IRIX and Tru64 are no longer supported by current releases of Condor
7 The Problem. Our esteemed scientist needs to run a “small” simulation.
8 The Simulation Run a simulation of the evolution of the cosmos with various properties
9 The Simulation Details Varying values for the value of: G (the gravitational constant): 100 values R μν (the cosmological constant): 100 values c (the speed of light): 100 values 100 × 100 × 100 = 1,000,000 jobs
10 Running the Simulation Each simulation: Requires up to 4GB of RAM Requires 20MB of input Requires 2 – 500 hours of computing time Produces up to 10GB of output Estimated total: 15,000,000 hours!
11 NSF won’t fund the Blue Gene that I requested.
12 While sharing a beverage with some colleagues, Carl asks “Have you tried Condor? It’s free, already installed for you, and you can use our pool.”
13 Are my Jobs Safe? › No worries… Condor will take care of your jobs for you Jobs are queued in a safe way More details later Condor will make sure that your jobs run, return output, etc. You can specify what defines “OK”
14 Condor will... › Keep an eye on your jobs and will keep you posted on their progress › Implement your policy on the execution order of the jobs › Keep a log of your job activities › Add fault tolerance to your jobs › Implement your policy on when the jobs can run on your workstation
15 Condor Doesn’t Play Dice with My Jobs!
16 Definitions › Job The Condor representation of your work › Machine The Condor representation of computers and that can perform the work › Match Making Matching a job with a machine “Resource” › Central Manager Central repository for the whole pool Performs job / machine matching, etc.
17 Job Jobs state their requirements and preferences: I require a Linux/x86 platform I prefer the machine with the most memory I prefer a machine in the chemistry department
18 Machine Machines state their requirements and preferences: Require that jobs run only when there is no keyboard activity I prefer to run Albert’s jobs I am a machine in the physics department Never run jobs belonging to Dr. Heisenberg
19 The Magic of Matchmaking › Jobs and machines state their requirements and preferences › Condor matches jobs with machines Based on requirements And preferences “Rank”
20 Getting Started: Submitting Jobs to Condor › Overview: Choose a “Universe” for your job Make your job “batch-ready” Create a submit description file Run condor_submit to put your job in the queue
Choose the “Universe” Todd’s Universe › Controls how Condor handles jobs › Choices include: Vanilla Standard Grid Java Parallel VM
22 Using the Vanilla Universe The Vanilla Universe: – Allows running almost any “serial” job – Provides automatic file transfer, etc. – Like vanilla ice cream Can be used in just about any situation
Make your job batch- ready Must be able to run in the background No interactive input No GUI/window clicks – Who needs ‘em anyway? No music ;^)
24 Make your job batch-ready (details)… Job can still use STDIN, STDOUT, and STDERR (the keyboard and the screen), but files are used for these instead of the actual devices Similar to UNIX shell: $./myprogram output.txt
Create a Submit Description File › A plain ASCII text file › Condor does not care about file extensions › Tells Condor about your job: Which executable, universe, input, output and error files to use, command-line arguments, environment variables, any special requirements or preferences (more on this later) › Can describe many jobs at once (a “cluster”), each with different input, arguments, output, etc.
26 Simple Submit Description File # Simple condor_submit input file # (Lines beginning with # are comments) # NOTE: the words on the left side are not # case sensitive, but filenames are! Universe = vanilla Executable = cosmos Output = cosmos.out Queue
Run condor_submit › You give condor_submit the name of the submit file you have created: condor_submit cosmos.submit › condor_submit: Parses the submit file, checks for errors Creates a “ClassAd” that describes your job(s) Puts job(s) in the Job Queue
28 ClassAd ? › Condor’s internal data representation Similar to classified ads (as the name implies) Represent an object & its attributes Usually many attributes Can also describe what an object matches with
29 ClassAd Details › ClassAds can contain a lot of details The job’s executable is “ cosmos” The machine’s load average is 5.6 › ClassAds can specify requirements I require a machine with Linux › ClassAds can specify preferences This machine prefers to run jobs from the physics group
30 ClassAd Details (continued) › ClassAds are: semi-structured user-extensible schema-free Attribute = Expression
31 Example: MyType = "Job" TargetType = "Machine" ClusterId = 1377 Owner = “einstein" Cmd = “cosmos" Requirements = ( (Arch == "INTEL") && (OpSys == "LINUX") && (Disk >= DiskUsage) && ( (Memory * 1024)>=ImageSize ) ) … ClassAd Example String Number Boolean
32 The Dog ClassAd Type = “Dog” Color = “Brown” Price = 12 ClassAd for the “Job”... Requirements = (type == “Dog”) && (color == “Brown”) && (price <= 15)...
33 The Job Queue › condor_submit sends your job’s ClassAd(s) to the schedd › The schedd (more details later): Manages the local job queue Stores the job in the job queue Atomic operation, two-phase commit “Like money in the bank” › View the queue with condor_q
34 Example condor_submit and condor_q % condor_submit cosmos.submit Submitting job(s). 1 job(s) submitted to cluster 1. % condor_q -- Submitter: perdita.cs.wisc.edu : : ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD 1.0 einstein 4/15 06: :00:00 I cosmos 1 jobs; 1 idle, 0 running, 0 held %
35 about your job Condor sends about job events to the submitting user Specify “notification” in your submit file to control which events: Notification= complete Notification= never Notification= error Notification= always Default
36 Input, output & error files › Controlled by submit file settings › You can define the job’s standard input, standard output and standard error: Read job’s standard input from “input_file”: Input= input_file Shell equivalent: program <input_file Write job’s standard ouput to “output_file”: Output= output_file Shell equivalent: program >output_file Write job’s standard error to “error_file”: Error= error_file Shell equivalent: program 2>error_file
37 Feedback on your job › Create a log of job events › Add to submit description file: log = cosmos.log › Becomes the Life Story of a Job Shows all events in the life of a job Always have a log file
38 Sample Condor User Log 000 ( ) 05/25 19:10:03 Job submitted from host: ( ) 05/25 19:12:17 Job executing on host: ( ) 05/25 19:13:06 Job terminated. (1) Normal termination (return value 0)...
39 Example Submit Description File With Logging # Example condor_submit input file # (Lines beginning with # are comments) # NOTE: the words on the left side are not # case sensitive, but filenames are! Universe = vanilla Executable = /home/einstein/condor/cosmos.condor Log = cosmos.log ·Job log (from Condor) Input = cosmos.in ·Program’s standard input Output = cosmos.out ·Program’s standard output Error = cosmos.err ·Program’s standard error Arguments = -c= –G= e-112 ·Command line arguments InitialDir = /home/einstein/cosmos/run Queue
40 “Clusters” and “Processes” › If your submit file describes multiple jobs, we call this a “cluster” › Each cluster has a unique “cluster number” › Each job in a cluster is called a “process” Process numbers always start at zero › A Condor “Job ID” is the cluster number, a period, and the process number (i.e. 2.1) A cluster can have a single process Job ID = 20.0 ·Cluster 20, process 0 Or, a cluster can have more than one process Job ID: 21.0, 21.1, 21.2·Cluster 21, process 0, 1, 2
41 Submit File for a Cluster # Example submit file for a cluster of 2 jobs # with separate input, output, error and log files Universe = vanilla Executable = cosmos Arguments = -f cosmos_0.dat log = cosmos_0.log Input = cosmos_0.in Output = cosmos_0.out Error = cosmos_0.err Queue ·Job 2.0 (cluster 2, process 0) Arguments = -f cosmos_1.dat log = cosmos_1.log Input = cosmos_1.in Output = cosmos_1.out Error = cosmos_1.err Queue ·Job 2.1 (cluster 2, process 1)
42 % condor_submit cosmos.submit-file Submitting job(s). 2 job(s) submitted to cluster 2. % condor_q -- Submitter: perdita.cs.wisc.edu : : ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD 1.0 einstein 4/15 06: :02:11 R cosmos -c= einstein 4/15 06: :00:00 I cosmos –f cosmos_0.dat 2.1 einstein 4/15 06: :00:00 I cosmos –f cosmos_1.dat 3 jobs; 2 idle, 1 running, 0 held % Submitting The Job
43 Back to our 1,000,000 jobs… › We could put all input, output, error & log files in the one directory One of each type for each job That’d be 4,000,000 files (4 files × 1,000,000 jobs) Difficult (at best) to sort through › Better: Create a subdirectory for each run
44 Organize your files and directories for big runs › Create subdirectories for each “run” run_0, run_1, … run_ › Create input files in each of these run_0/(cosmos.in,cosmos.dat) run_1/(cosmos.in,cosmos.dat) … run_999999/(cosmos.in,cosmos.dat) › The output, error & log files for each job will be created by Condor from your job’s output
45 Einstein’s simulation directory cosmos.exe cosmos.sub run_ cosmos.in cosmos.dat cosmos.out cosmos.err cosmos.log run_0 User creates these files Condor creates these files for you cosmos.in cosmos.dat cosmos.out cosmos.err cosmos.log
46 Submit Description File for 1,000,000 Jobs # Cluster of 1,000,000 jobs with different directories Universe = vanilla Executable = cosmos Log = cosmos.log Output = cosmos.out Input = cosmos.in Arguments = –f cosmos.dat... InitialDir = run_0 ·Log, input, output & error files -> run_0 Queue ·Job 3.0 (Cluster 3, Process 0) InitialDir = run_1 ·Log, input, output & error files -> run_1 Queue ·Job 3.1 (Cluster 3, Process 1) ·Do this 3,999,998 more times…………
47 Submit File for a Big Cluster of Jobs › We just submitted 1 cluster with 1,000,000 processes › All the input/output files will be in different directories › The submit file is pretty unwieldy (over 5,000,000 lines!) › Isn’t there a better way?
48 Submit File for a Big Cluster of Jobs (the better way) › We can queue all 1,000,000 in 1 “Queue” command Queue › Condor provides $(Process) and $(Cluster) $(Process) will be expanded to the process number for each job in the cluster 0, 1, … $(Cluster) will be expanded to the cluster number Will be 4 for all jobs in this cluster
49 $(Process) › The initial directory for each job can be specified using $(Process) InitialDir = run_$(Process) Condor will expand these to: “ run_0 ”, “ run_1 ”, … “ run_ ” directories › Similarly, arguments can be variable Arguments = -n $(Process) Condor will expand these to: “-n 0”, “-n 1”, … “-n ”
50 Better Submit File for 1,000,000 Jobs # Example condor_submit input file that defines # a cluster of jobs with different directories Universe = vanilla Executable = cosmos Log = cosmos.log Input = cosmos.in Output = cosmos.out Error = cosmos.err Arguments = –f cosmos.dat ·All share arguments InitialDir = run_$(Process) ·run_0 … run_ Queue ·Jobs 4.0 …
51 Now, we submit it… $ condor_submit cosmos.submit Submitting job(s) Logging submit event(s) job(s) submitted to cluster 4.
52 And, Check the Queue $ condor_q -- Submitter: x.cs.wisc.edu : : x.cs.wisc.edu ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD 4.0 einstein 4/20 12: :00:05 R cosmos –f cosmos.dat 4.1 einstein 4/20 12: :00:03 I cosmos –f cosmos.dat 4.2 einstein 4/20 12: :00:01 I cosmos –f cosmos.dat 4.3 einstein 4/20 12: :00:00 I cosmos –f cosmos.dat einstein 4/20 12: :00:00 I cosmos –f cosmos.dat einstein 4/20 12: :00:00 I cosmos –f cosmos.dat jobs; idle, 1 running, 0 held
53 1,000,000 Condor jobs Job Queue Condor Pool Condor Schedd Einstein’s workstation Physics Department Condor Pool Einstein and the other scientists can use the compute resources of each other’s machines
54 My Biggest Blunder Ever › Albert removes R μν (Cosmological Constant) from his equations, and needs to remove his running jobs › We’ll just ignore that modern cosmologists may have re-introduced R μν (so called “dark energy”)
55 Removing Jobs › If you want to remove a job from the Condor queue, you use condor_rm › You can only remove jobs that you own › Privileged user can remove any jobs “root” on UNIX “administrator” on Windows
56 Removing jobs (continued) › Remove an entire cluster: condor_rm 4 ·Removes the whole cluster › Remove a specific job from a cluster: condor_rm 4.0 ·Removes a single job › Or, remove all of your jobs with “-a” condor_rm -a ·Removes all jobs / clusters
57 condor_status % condor_status Name OpSys Arch State Activ LoadAv Mem ActvtyTime antipholus.cs LINUX INTEL Unclaimed Idle :28:42 coral.cs.wisc LINUX INTEL Claimed Busy :27:21 doc.cs.wisc.e LINUX INTEL Unclaimed Idle :20:04 dsonokwa.cs.w LINUX INTEL Claimed Busy :01:45 ferdinand.cs. LINUX INTEL Claimed Suspe :00:55 LINUX INTEL Unclaimed Idle :03:28 LINUX INTEL Unclaimed Idle :03:29
58 How can my jobs access their data files?
59 Access to Data in Condor › Use shared filesystem if available › No shared filesystem? Condor can transfer files Can automatically send back changed files Atomic transfer of multiple files Can be encrypted over the wire Remote I/O Socket (parrot) Standard Universe can use remote system calls (more on this later)
60 Condor File Transfer › Transfer_Input_Files List of files that you want Condor to transfer to the execute machine › Transfer_Output_Files List of files that you want Condor to transfer from the execute machine If not specified, Condor will transfer back all “new” files in the execute directory › ShouldTransferFiles YES: Always transfer files to execution site NO: Always rely on a shared filesystem IF_NEEDED: Condor will automatically transfer the files if the submit and execute machine are not in the same FileSystemDomain ( Use shared file system if available)
61 Condor File Transfer Example # Example submit file using file transfer Universe = vanilla Executable = cosmos Log = cosmos.log ShouldTransferFiles = IF_NEEDED Transfer_input_files = dataset.$(Process), cosmos.dat Transfer_output_files = TheAnswer.dat Queue
62 We Always Want More Condor is managing and running our jobs, but: Our CPU requirements are greater than our resources Jobs are preempted more often than we like
63 Happy Day! The Physics Department purchased a dedicated cluster! The administrator installs Condor on all these new dedicated cluster nodes
64 Adding nodes › Einstein installs Condor on the desktop machines, and configures them with his machine as the central manager The central manager: Central repository for the whole pool Performs job / machine matching, etc. › These are “non-dedicated” nodes, meaning that they can't always run Condor jobs
65 1,000,000 Condor jobs Job Queue Workstations Condor Schedd Einstein’s workstation Physics Department Condor Pool Central Manager Dedicated Cluster With the additional resources, Albert and his colleagues can get their jobs completed faster.
66 Some Good Questions… What are all of these Condor Daemons running on my machine? What do they do?
67 Condor Daemon Layout Personal Condor / Central Manager Master collector negotiator startd = Process Spawned schedd
68 condor_master › Starts up all other Condor daemons › Runs on all Condor hosts › If there are any problems and a daemon exits, it restarts the daemon and sends to the administrator › Acts as the server for many Condor remote administration commands: condor_reconfig, condor_restart condor_off, condor_on condor_config_val etc.
69 Central Manager: condor_collector › Central manager: central repository and match maker for whole pool › Collects information from all other Condor daemons in the pool “Directory Service” / Database for a Condor pool Each daemon sends a periodic update ClassAd to the collector › Services queries for information: Queries from other Condor daemons Queries from users (condor_status) › Only on the Central Manager(s) › At least one collector per pool
70 Condor Pool Layout: Collector = ClassAd Communication Pathway = Process Spawned Central Manager Master Collector negotiator
71 Central Manager: condor_negotiator › Performs “matchmaking” in Condor › Each “Negotiation Cycle” (typically 5 minutes): Gets information from the collector about all available machines and all idle jobs Tries to match jobs with machines that will serve them Both the job and the machine must satisfy each other’s requirements › Only one Negotiator per pool Ignoring HAD › Only on the Central Manager(s)
72 Condor Pool Layout: Negotiator = ClassAd Communication Pathway = Process Spawned Central Manager Master Collector negotiator
73 Execute Hosts: condor_startd › Execute host: machines that run user jobs › Represents a machine to the Condor system › Responsible for starting, suspending, and stopping jobs › Enforces the wishes of the machine owner (the owner’s “policy”… more on this in the administrator’s tutorial) › Creates a “starter” for each running job › One startd runs on each execute node
74 Condor Pool Layout: startd = ClassAd Communication Pathway = Process Spawned Central Manager Master Collector schedd negotiator Cluster Node Master startd Cluster Node Master startd Workstation Master startd schedd Workstation Master startd schedd
75 Submit Hosts: condor_schedd › Submit hosts: machines that users can submit jobs on › Maintains the persistent queue of jobs › Responsible for contacting available machines and sending them jobs › Services user commands which manipulate the job queue: condor_submit, condor_rm, condor_q, condor_hold, condor_release, condor_prio, … › Creates a “shadow” for each running job › One schedd runs on each submit host
76 Condor Pool Layout: schedd = ClassAd Communication Pathway = Process Spawned Cluster Node Master startd Cluster Node Master startd Central Manager Master Collector schedd negotiator Workstation Master startd schedd Workstation Master startd schedd
77 Condor Pool Layout: master = ClassAd Communication Pathway = Process Spawned Central Manager Master Collector schedd negotiator Cluster Node Master startd Cluster Node Master startd Cluster Node Master startd schedd Cluster Node Master startd schedd
78 What about these “condor_shadow” processes? › The Shadow processes are Condor’s local representation of your running job One is started for each job › Similarly, on the “execute” machine, a condor_starter is run for each job
79 Condor Pool Layout: running a job = Communication Pathway = Process Spawned Submit Host Master schedd shadow Execute Host Master startd starter Job Execute Host Master startd starter Job shadow
80 Now what? › Some of the machines in the pool can’t run my jobs Not enough RAM Not enough scratch disk space Required software not installed Etc.
81 Specify Requirements › An expression (syntax similar to C or Java) › Must evaluate to True for a match to be made Universe = vanilla Executable = cosmos Log = cosmos.log InitialDir = run_$(Process) Requirements = Memory >= 4096 && Disk > Queue
82 Advanced Requirements › Requirements can match custom attributes in your Machine Ad Can be added by hand to each machine Or, automatically using the “Hawkeye” mechanism Universe = vanilla Executable = cosmos Log = cosmos.log InitialDir = run_$(Process) Requirements =(CosmosData =!= UNDEFINED) Queue
83 CosmosData =!= UNDEFINED ??? › What’s this “ =!= ” and “ UNDEFINED” business ? Is this like the state of Schrödinger’s Cat? › Introducing ClassAd Meta Operators: Allow you to test if a attribute is in a ClassAd Is identical to operator: “ =?= ” Is not identical to operator: “ =!= ” Behave similar to == and !=, but are not strict Somewhat like “ is NONE ” and “ is not NONE ” in Python Without these, ANY expression with an UNDEFINED in it will always evaluate to UNDEFINED
84 Meta Operator Examples › 10 == UNDEFINED evaluates to UNDEFINED › UNDEFINED == UNDEFINED evaluates to UNDEFINED › 10 =?= UNDEFINED evaluates to FALSE › UNDEFINED =?= UNDEFINED evaluates to TRUE › UNDEFINED =!= UNDEFINED evaluates to FALSE
85 More Meta Operator Examples › Value == 10: Evaluates to TRUE if Value is in the ad and is equal to 10 Evaluates to FALSE if Value is in the ad and is not equal to 10 Evaluates to UNDEFINED if Value is not in the ad › Value =!= UNDEFINED: Evaluates to FALSE if Value is in the ad Evaluates to TRUE if Value is not in the ad
86 Final Meta Operator Examples › ( (Value =!= UNDEFINED) && (Value == 10) ) Evaluates to TRUE if Value is in the ad and is equal to 10 Evaluates to FALSE if Value is in the ad and is not equal to 10 Evaluates to FALSE if Value is not in the ad › ( (Value =?= UNDEFINED) || (Value != 10) ) Evaluates to FALSE if Value is in the ad and is equal to 10 Evaluates to TRUE if Value is in the ad and is not equal to 10 Evaluates to TRUE if Value is not in the ad
87 Using Attributes from the Machine Ad › You can use attributes from the matched Machine Ad in your job submit file $$(Name) will be replaced by the value of the specified attribute in the Machine Ad › Example: Matching Machine Ad has: CosmosData = “/local/cosmos/data” Submit file has: Executable = cosmos Requirements = (CosmosData =!= UNDEFINED) Arguments = -d $$(CosmosData) Resulting command line: cosmos –d /local/cosmos/data
88 And, Specify Rank › All matches which meet the requirements can be sorted by preference with a Rank expression. › Higher the Rank, the better the match Universe = vanilla Executable = cosmos Log = cosmos.log Arguments = -arg1 –arg2 InitialDir = run_$(Process) Requirements = Memory >= 4096 && Disk > Rank = (KFLOPS*10000) + Memory Queue
89 My jobs aren’t running!!
90 Check the queue › Check the queue with condor_q: bash-2.05a$ condor_q -- Submitter: x.cs.wisc.edu : :x.cs.wisc.edu ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD 5.0 einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 12: :00:00 I cosmos -arg1 –n einstein 4/20 13: :00:00 H cosmos -arg1 –arg2 8 jobs; 8 idle, 0 running, 1 held
91 Look at jobs on hold % condor_q –hold -- Submiter: x.cs.wisc.edu : :x.cs.wisc.edu ID OWNER HELD_SINCE HOLD_REASON 6.0 einstein 4/20 13:23 Error from starter on skywalker.cs.wisc.edu 9 jobs; 8 idle, 0 running, 1 held Or, See full details for a job % condor_q –l 6.0
92 Check machine status › Verify that there are idle machines with condor_status: bash-2.05a$ condor_status Name OpSys Arch State Activity LoadAv Mem ActvtyTime LINUX INTEL Claimed Busy :00:20 LINUX INTEL Claimed Busy :00:19 LINUX INTEL Claimed Busy :00:17 LINUX INTEL Claimed Busy :00:05 Total Owner Claimed Unclaimed Matched Preempting INTEL/LINUX Total
93 Look in Job Log › Look in your job log for clues: bash-2.05a$ cat cosmos.log 000 ( ) 04/20 14:47:31 Job submitted from host: ( ) 04/20 15:02:00 Shadow exception! Error from starter on gig06.stat.wisc.edu: Failed to open '/scratch.1/einstein/workspace/v67/condor- test/test3/run_0/cosmos.in' as standard input: No such file or directory (errno 2) 0 - Run Bytes Sent By Job 0 - Run Bytes Received By Job...
94 Still not running? Exercise a little patience › On a busy pool, it can take a while to match and start your jobs › Wait at least a negotiation cycle or two (typically a few minutes)
95 Look to condor_q for help: condor_q -analyze bash-2.05a$ condor_q -ana : Run analysis summary. Of 1243 machines, 1243 are rejected by your job's requirements 0 are available to run your job WARNING: Be advised: No resources matched request's constraints Check the Requirements expression below: Requirements = ((Memory > 8192)) && (Arch == "INTEL") && (OpSys == "LINUX") && (Disk >= DiskUsage) && (TARGET.FileSystemDomain == MY.FileSystemDomain)
96 Better analysis: condor_q –better-analyze bash-2.05a$ condor_q -better-ana 29 The Requirements expression for your job is: ( ( target.Memory > 8192 ) ) && ( target.Arch == "INTEL" ) && ( target.OpSys == "LINUX" ) && ( target.Disk >= DiskUsage ) && ( TARGET.FileSystemDomain == MY.FileSystemDomain ) Condition Machines Matched Suggestion ( ( target.Memory > 8192 ) ) 0 MODIFY TO ( TARGET.FileSystemDomain == "cs.wisc.edu" )584 3 ( target.Arch == "INTEL" ) ( target.OpSys == "LINUX" ) ( target.Disk >= 13 ) 1243
97 Learn about available resources: bash-2.05a$ condor_status –const 'Memory > 8192' (no output means no matches) bash-2.05a$ condor_status -const 'Memory > 4096' Name OpSys Arch State Activ LoadAv Mem ActvtyTime LINUX X86_64 Unclaimed Idle :35:05 LINUX X86_64 Unclaimed Idle :37:03 LINUX X86_64 Unclaimed Idle :00:05 LINUX X86_64 Unclaimed Idle :03:47 Total Owner Claimed Unclaimed Matched Preempting X86_64/LINUX Total
98 Job Policy Expressions › User can supply job policy expressions in the submit file. › Can be used to describe a successful run. on_exit_remove = on_exit_hold = periodic_remove = periodic_hold =
99 Job Policy Examples › Do not remove if exits with a signal: on_exit_remove = ExitBySignal == False › Place on hold if exits with nonzero status or ran for less than an hour: on_exit_hold = ( (ExitBySignal==False) && (ExitSignal != 0) ) || ( (ServerStartTime - JobStartDate) < 3600) › Place on hold if job has spent more than 50% of its time suspended: periodic_hold = CumulativeSuspensionTime > (RemoteWallClockTime / 2.0)
100 Insert ClassAd attributes › Special purpose usage › In the submit description file, introduce an attribute for the job +Department = “physics” causes the ClassAd to contain Department = “physics”
101 We’ve seen how Condor can: › Keep an eye on your jobs Keep you posted on their progress › Implement your policy on the execution order of the jobs › Keep a log of your job activities
102 Getting Condor › Available as a free download from › Download Condor for your operating system Available for most UNIX (including Linux and Apple’s OS/X) platforms Also for Windows XP / 2003 / Vista
103 Condor Releases › Stable / Developer Releases Version numbering scheme similar to that of the (pre 2.6) Linux kernels … › Major.minor.release Minor is even (a.b.c): Stable Examples: 7.0.5, –7.2.2 just released Very stable, mostly bug fixes Minor is odd (a.b.c): Developer New features, may have some bugs Examples: 7.1.5, –7.3.1 “real soon now”
104 Albert installs a “Personal Condor” on his laptop… › What do we mean by a “Personal” Condor? Condor on your own workstation No root / administrator access required No system administrator intervention needed › His Personal Condor can joins the local Condor pool He can now access to the pool’s resources (machines) › Can also be “Stand Alone” Can still run his own jobs, maintain job queue, etc. Can even access grid resources if needed!
105 Multiple Universes
106 Einstein submits some MPI jobs # Example condor_submit input file that for MPI # jobs universe = parallel executable = mp1script arguments = my_mpich_linked_executable arg1 arg2 machine_count = 4 should_transfer_files = yes when_to_transfer_output = on_exit transfer_input_files = my_mpich_linked_executable queue
107 My new jobs can run for 20 days… What happens when a job is forced off it’s CPU? – Preempted by higher priority user or job – Vacated because of user activity How can I add fault tolerance to my jobs?
108 Condor’s Standard Universe to the rescue! › Support for transparent process checkpoint and restart › Remote system calls (remote I/O) Your job can read / write files as if they were local
109 Remote System Calls in the Standard Universe › I/O system calls are trapped and sent back to the submit machine Examples: open a file, write to a file › No source code changes typically required › Programming language independent
110 Process Checkpointing in the Standard Universe › Condor’s process checkpointing provides a mechanism to automatically save the state of a job › The process can then be restarted from right where it was checkpointed After preemption, crash, etc.
111 Checkpointing: Process Starts checkpoint: the entire state of a program, saved in a file CPU registers, memory image, I/O time
112 Checkpointing: Process Checkpointed time 123
113 Checkpointing: Process Killed time 3 3 Killed!
114 Checkpointing: Process Resumed time 3 3 goodputbadput goodput
115 When will Condor checkpoint your job? › Periodically, if desired For fault tolerance › When your job is preempted by a higher priority job › When your job is vacated because the execution machine becomes busy › When you explicitly run condor_checkpoint, condor_vacate, condor_off or condor_restart command
116 Making the Standard Universe Work › The job must be relinked with Condor’s standard universe support library › To relink, place condor_compile in front of the command used to link the job: % condor_compile gcc -o myjob myjob.c - OR - % condor_compile f77 -o myjob filea.f fileb.f - OR - % condor_compile make –f MyMakefile
117 Limitations of the Standard Universe › Condor’s checkpointing is not at the kernel level. Standard Universe the job may not: Fork() Use kernel threads Use some forms of IPC, such as pipes and shared memory › Must have access to source code to relink › Many typical scientific jobs are OK
118 Death of the Standard Universe
119 DMTCP & Parrot › DMTCP (Checkpointing) “Distributed MultiThreaded Checkpointing” Developed at Northeastern University See Pete’s talk 11:40 › Parrot (Remote I/O) “Parrot is a tool for attaching existing programs to remote I/O system” Developed by Doug Thain (now at Notre Dame)
120 Connecting Condors Albert knows people with their own Condor pools, and gets permission to use their computing resources… How can Condor help him do this?
121 Connect Condors with Flocking › Flocking is a Condor-specific technology flock › Albert configures his Condor schedd to “flock” to his friend’s pool.
122 Condor Pool 1,000,000 Condor jobs Einstein’s Condor Pool Friendly Condor Pool
123 Albert meets The Grid › Albert also has access to grid resources he wants to use He has certificates and access to Globus or other resources at remote institutions › But Albert wants Condor’s queue management features for his jobs! › He installs Condor so he can submit “Grid Universe” jobs to Condor
124 “Grid” Universe › All handled in your submit file › Supports a number of “back end” types: Globus: GT2, GT4 NorduGrid UNICORE Condor PBS LSF EC2 NQS
125 Grid Universe & Globus 2 › Used for a Globus GT2 back-end “Condor-G” › Format: Grid_Resource = gt2 Head-Node Globus_rsl = › Example: Universe = grid Grid_Resource = gt2 beak.cs.wisc.edu/jobmanager Globus_rsl = (queue=long)(project=atom-smasher)
126 Grid Universe & Globus 4 › Used for a Globus GT4 back-end › Format: Grid_Resource = gt4 Globus_XML = › Example: Universe = grid Grid_Resource = gt4 beak.cs.wisc.edu Condor Globus_xml = long atom- smasher
127 Grid Universe & Condor › Used for a Condor back-end “Condor-C” › Format: Grid_Resource = condor Remote_ = “Remote_” part is stripped off › Example: Universe = grid Grid_Resource = condor beak condor.cs.wisc.edu Remote_Universe = standard
128 Grid Universe & NorduGrid › Used for a NorduGrid back-end Grid_Resource = nordugrid › Example: Universe = grid Grid_Resource = nordugrid ngrid.cs.wisc.edu
129 Grid Universe & UNICORE › Used for a UNICORE back-end › Format: Grid_Resource = unicore › Example: Universe = grid Grid_Resource = unicore uhost.cs.wisc.edu vhost
130 Grid Universe & PBS › Used for a PBS back-end › Format: Grid_Resource = pbs › Example: Universe = grid Grid_Resource = pbs
131 Grid Universe & LSF › Used for a LSF back-end › Format: Grid_Resource = lsf › Example: Universe = grid Grid_Resource = lsf
132 Credential Management › Condor will do The Right Thing™ with your X509 certificate and proxy › Override default proxy: X509UserProxy = /home/einstein/other/proxy › Proxy may expire before jobs finish executing Condor can use MyProxy to renew your proxy When a new proxy is available, Condor will forward the renewed proxy to the job This works for non-grid jobs, too
133 Condor Universes: Scheduler and Local › Scheduler Universe Plug in a meta-scheduler Similar to Globus’s fork job manager Developed for DAGMan (next slide) › Local Very similar to vanilla, but jobs run on the local host Has more control over jobs than scheduler universe
134 My jobs have have dependencies… Can Condor help solve my dependency problems?
135 Einstein learns DAGMan › Directed Acyclic Graph Manager › DAGMan allows you to specify the dependencies between your Condor jobs, so it can manage them automatically for you. E.G.: “Don’t run job ‘B’ until job ‘A’ has completed successfully.”
136 What is a DAG? › A DAG is the data structure used by DAGMan to represent these dependencies. › Each job is a “node” in the DAG. › Each node can have any number of “parent” or “children” nodes – as long as there are no loops! Job D Job A Job B Job C
137 DAGs large and small › DAGMan can scale up to huge DAGs LIGO runs 500,000 node DAGs › DAGMan is useful even in the small cases! What about a simple 2 job DAG? Run database query Process output Can all be run on one machine--no Condor pool necessary › DAGMan can be used as a Condor job throttle Lots of nodes with no dependencies
138 Defining a DAG › A DAG is defined by a.dag file, listing each of its nodes and their dependencies: # diamond.dag Job A a.sub Job B b.sub Job C c.sub Job D d.sub Parent A Child B C Parent B C Child D › each node will run the Condor job specified by its accompanying Condor submit file Job D Job A Job B Job C
139 Submitting a DAG › To start your DAG, just run condor_submit_dag with your.dag file Condor will start a personal DAGMan daemon which to begin running your jobs: % condor_submit_dag diamond.dag › condor_dagman is then run by the schedd Thus, DAGMan daemon itself is “watched” by Condor, so you don’t have to
140 DAGMan DAG Running: A › DAGMan acts as a “meta-scheduler”, managing the submission of your jobs to Condor based on the DAG dependencies. Condor Job Queue.dag File B A C D A
141 DAGMan DAG Running: B & C › DAGMan holds & submits jobs to the Condor queue at the appropriate times. Condor Job Queue BC D A B C
142 DAG Running: C failed › In case of a job failure, DAGMan continues until it can no longer make progress, and then creates a “rescue” file with the current state of the DAG. Condor Job Queue DAGMan Rescue File A BC D
143 DAG Recovery: C › Once the failed job is ready to be re-run, the rescue file can be used to restore the prior state of the DAG. Condor Job Queue Rescue File DAGMan A BC DC
144 DAG Recovery: D › Once that job completes, DAGMan will continue the DAG as if the failure never happened. Condor Job Queue DAGMan A BC DD
145 DAG Complete › Once the DAG is complete, the DAGMan job itself is finished, and exits. Condor Job Queue DAGMan A BC D
146 Additional DAGMan Features › Provides other handy features for job management… Nodes can have PRE & POST scripts Failed nodes can be automatically re- tried a configurable number of times Job submission can be “throttled”
147 Want more from DAGMan? › What if: You want to define workflows that can flexibly take advantage of different grid resources? You want to register data products in a way that makes them available to others? You want to use the grid without a full Condor installation?
148 Introducing Pegasus WMS (Workflow Management System) › A higher level on top of DAGMan › User creates an abstract workflow › Pegasus maps abstract workflow to executable workflow › DAGMan runs executable workflow › Doesn’t need full Condor (schedd only)
149 Pegasus Features › Workflow has inter-job dependencies (similar to DAGMan) › Pegasus can map jobs to grid sites › Pegasus handles discovery and registration of data products › Pegasus handles data transfer to/from grid sites
150 *The full moon is 0.5 deg. sq. when viewed form Earth, Full Sky is ~ 400,000 deg. sq. Generating mosaics of the sky (Bruce Berriman, Caltech) Size of the mosaic in degrees square* Number of jobs Number of input data files Number of intermediate files Total data footprint Approx. execution time (20 procs) GB40 mins 21, ,9065.5GB49 mins 44, ,06120GB1hr 46 mins 68,5861,44422,85038GB2 hrs. 14 mins 1020,6523,72254,43497GB6 hours
151 Abstract Workflow (DAX) › Pegasus workflow description—DAX In XML Java API to generate XML for you Workflow “high-level language” Devoid of resource descriptions Devoid of data locations Refers to codes as logical transformations Refers to data as logical files Specifies dependencies Akin to a high-level DAG file
152 Basic Workflow Mapping › Mapping is Translating abstract DAX into an executable DAG › Select where to run the computations Change task nodes into nodes with executable descriptions › Select which data to access Add stage-in and stage-out nodes to move data › Add nodes that register the newly-created data products › Add nodes to create an execution directory on a remote site › Write out the workflow in a form understandable by a workflow engine Include provenance capture steps
153 Pegasus Workflow Mapping Original workflow: 15 compute nodes devoid of resource assignment Resulting workflow mapped onto 3 Grid sites: 11 compute nodes (4 reduced based on available intermediate data) 13 data stage-in nodes 8 inter-site data transfers 14 data stage-out nodes to long-term storage 14 data registration nodes (data cataloging)
154 Pegasus WMS Pegasus Workflow Mapper Condor DAGMan TeraGrid Open Science Grid Campus resources Local machine Transformation Catalog Site Catalog Workflow Description in XML (DAX) Condor Schedd Submit Host Replica Catalog Pegasus WMS restructures and optimizes the workflow, provides reliability Properties
155 Mapping & Running a Workflow › To map a workflow, run pegasus-plan: % pegasus-plan -Dpegasus.user.properties=pegasus- wms/config/properties --dir dags --sites viz -- output local --force --nocleanup --dax pegasus- wms/dax/montage.dax Creates executable workflow › To run a workflow, run pegasus-run: % pegasus-run -Dpegasus.user.properties=pegasus- wms/dags/train01/pegasus/montage/run0001/pegasus properties pegasus- wms/dags/train01/pegasus/montage/run0001 Runs condor_submit_dag and other tools
156 There’s much more… › We’ve only scratched the surface of Pegasus’s capabilities › Resources: Pegasus home page: pegasus.isi.edupegasus.isi.edu Tutorial materials available at: Questions: Also, talk to Kent Wenger (Condor Team)
157 General User Commands › condor_status View Pool Status › condor_qView Job Queue › condor_submitSubmit new Jobs › condor_rmRemove Jobs › condor_prioIntra-User Prios › condor_historyCompleted Job Info › condor_submit_dagSubmit new DAG › condor_checkpointForce a checkpoint › condor_compileLink Condor library
158 Condor Job Universes Vanilla Universe Standard Universe Grid Universe Scheduler Universe Local Universe Virtual Machine Universe Java Universe Parallel Universe MPICH-1 MPICH-2 LAM …
159 Why have a special Universe for Java jobs? › Java Universe provides more than just inserting “java” at the start of the execute line of a vanilla job: Knows which machines have a JVM installed Knows the location, version, and performance of JVM on each machine Knows about jar files, etc. Provides more information about Java job completion than just JVM exit code Program runs in a Java wrapper, allowing Condor to report Java exceptions, etc.
160 Universe Java Job # Example Java Universe Submit file Universe = java Executable = Main.class jar_files = MyLibrary.jar Input = infile Output = outfile Arguments = Main Queue
161 Java support, cont. bash-2.05a$ condor_status –java Name JavaVendor Ver State Actv LoadAv Mem abulafia.cs Sun Microsy 1.5.0_ Claimed Busy acme.cs.wis Sun Microsy 1.5.0_ Unclaimed Idle adelie01.cs Sun Microsy 1.5.0_ Claimed Busy adelie02.cs Sun Microsy 1.5.0_ Claimed Busy … Total Owner Claimed Unclaimed Matched Preempting INTEL/LINUX INTEL/WINNT SUN4u/SOLARIS X86_64/LINUX Total
162 Albert wants Condor features on remote resources › He wants to run standard universe jobs on Grid-managed resources For matchmaking and dynamic scheduling of jobs For job checkpointing and migration For remote system calls
163 Condor GlideIn › Albert can use the Grid Universe to run Condor daemons on Grid resources › When the resources run these GlideIn jobs, they will temporarily join his Condor Pool › He can then submit Standard, Vanilla, PVM, or MPI Universe jobs and they will be matched and run on the remote resources › Currently only supports Globus GT2 We hope to fix this limitation
164 your workstation Friendly Condor Pool personal Condor 600 Condor jobs Globus Grid PBS LSF Condor Condor Pool glide-in jobs
165 How It Works Manager LSF User Job Startd Personal CondorRemote Resource Condor jobs GlideIn jobs Starter ScheddCollector & Negotiator Grid Manager Shadow Master
166 GlideIn Concerns › What if the remote resource kills my GlideIn job? That resource will disappear from your pool and your jobs will be rescheduled on other machines Standard universe jobs will resume from their last checkpoint like usual › What if all my jobs are completed before a GlideIn job runs? If a GlideIn Condor daemon is not matched with a job in 10 minutes, it terminates, freeing the resource
167 In Review With Condor’s help, Albert can: Manage his compute job workload Access local machines Access remote Condor Pools via flocking Access remote compute resources on the Grid via “Grid Universe” jobs Carve out his own personal Condor Pool from the Grid with GlideIn technology
168 Administrator Commands › condor_vacateLeave a machine now › condor_onStart Condor › condor_offStop Condor › condor_reconfigReconfig on-the-fly › condor_config_valView/set config › condor_userprioUser Priorities › condor_statsView detailed usage accounting stats
169 My boss wants to watch what Condor is doing
170 Use CondorView! › Provides visual graphs of current and past utilization › Data is derived from Condor's own accounting statistics › Interactive Java applet › Quickly and easily view: How much Condor is being used How many cycles are being delivered Who is using them Utilization by machine platform or by user
171 CondorView Usage Graph
172 I could also talk lots about… › GCB: Living with firewalls & private networks › Federated Grids/Clusters › APIs and Portals › MW › Database Support (Quill) › High Availability Fail-over › Compute On-Demand (COD) › Dynamic Pool Creation (“Glide-in”) › Role-based prioritization and accounting › Strong security, incl privilege separation › Data movement scheduling in workflows › …
173 Thank you! Check us out on the Web: