condor users tutorial national e-science centre edinburgh, scotland october 2003

189
Condor Project Computer Sciences Department University of Wisconsin-Madison [email protected] http://www.cs.wisc.edu/condor Condor Users Tutorial National e-Science Centre Edinburgh, Scotland October 2003

Upload: trina

Post on 15-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

Condor Users Tutorial National e-Science Centre Edinburgh, Scotland October 2003. The Condor Project (Established ‘85). Distributed High Throughput Computing research performed by a team of ~35 faculty, full time staff and students. The Condor Project (Established ‘85). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

Condor ProjectComputer Sciences DepartmentUniversity of Wisconsin-Madison

[email protected]://www.cs.wisc.edu/condor

Condor Users Tutorial

National e-Science Centre

Edinburgh, ScotlandOctober 2003

Page 2: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

2http://www.cs.wisc.edu/condor

The Condor Project (Established ‘85)

Distributed High Throughput Computing research performed by a team of ~35 faculty, full time staff and students.

Page 3: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

3http://www.cs.wisc.edu/condor

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 users, maintain and support large distributed production

environments, and educate and train students.

Funding – US Govt. (DoD, DoE, NASA, NSF, NIH),AT&T, IBM, INTEL, Microsoft, UW-Madison, …

Page 4: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

4http://www.cs.wisc.edu/condor

A Multifaceted Project › Harnessing the power of clusters - opportunistic and/or

dedicated (Condor)

› Job management services for Grid applications (Condor-G, Stork)

› Fabric management services for Grid resources (Condor, GlideIns, NeST)

› Distributed I/O technology (Parrot, Kangaroo, NeST)

› Job-flow management (DAGMan, Condor, Hawk)

› Distributed monitoring and management (HawkEye)

› Technology for Distributed Systems (ClassAD, MW)

› Packaging and Integration (NMI, VDT)

Page 5: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

5http://www.cs.wisc.edu/condor

Some software produced by the Condor Project

› Condor System› ClassAd Library

› DAGMan

› Fault Tolerant Shell (FTSH)

› Hawkeye

› MW

› NeST

› Stork

› Parrot

› Condor-G› And others… all as

open source

Page 6: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

6http://www.cs.wisc.edu/condor

Fault Tolerant Shell (FTSH)

› The Grid is a hard environment.› FTSH

The ease of scripting with very precise error semantics.

Exception-like structure allows scripts to be both succinct and safe.

A focus on timed repetition simplifies the most common form of recovery in a distributed system.

A carefully-vetted set of language features limits the "surprises" that haunt system programmers.

Page 7: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

7http://www.cs.wisc.edu/condor

Simple Bourne script…

#!/bin/sh

cd /work/foo

rm –rf data

cp -r /fresh/data .

What if ‘/work/foo’ is unavailable??

Page 8: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

8http://www.cs.wisc.edu/condor

Getting Grid Ready…#!/bin/sh for attempt in 1 2 3

cd /work/foo if [ ! $? ] then

echo "cd failed, trying again..." sleep 5

else break

fi done

if [ ! $? ] then

echo "couldn't cd, giving up..." return 1

fi

Page 9: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

9http://www.cs.wisc.edu/condor

Or with FTSH

#!/usr/bin/ftsh

try 5 times

cd /work/foo

rm -rf bar

cp -r /fresh/data .

end

Page 10: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

10http://www.cs.wisc.edu/condor

Or with FTSH

#!/usr/bin/ftsh

try for 3 days or 100 times

cd /work/foo

rm -rf bar

cp -r /fresh/data .

end

Page 11: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

11http://www.cs.wisc.edu/condor

Or with FTSH

#!/usr/bin/ftsh

try for 3 days every 1 hour

cd /work/foo

rm -rf bar

cp -r /fresh/data .

end

Page 12: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

12http://www.cs.wisc.edu/condor

Another quick example…

hosts="mirror1.wisc.edu mirror2.wisc.edu mirror3.wisc.edu"

forany h in ${hosts} echo "Attempting host ${h}" wget http://${h}/some-file

end

echo "Got file from ${h}"

Page 13: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

13http://www.cs.wisc.edu/condor

FTSH› All the usual constructs

Redirection, loops, conditionals, functions, expressions, nesting, …

› And more Logging Timeouts Process Cancellation Complete parsing at startup File cleanup

› Used on Linux, Solaris, Irix, Cygwin, …› Simplify your life!

Page 14: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

14http://www.cs.wisc.edu/condor

› HawkEye A monitoring tool

› MW Framework to create a master-worker style

application in a opportunistic environment› NeST

Flexible Network Storage appliance “Lots” : reserved space

› Stork A scheduler for grid data placement activities Treat data movement as a “first class

citizen”

More Software…

Page 15: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

15http://www.cs.wisc.edu/condor

More Software, cont.

› Parrot Useful in distributed

batch systems where one has access to many CPUs, but no consistent distributed filesystem (BYOFS!).

Works with any program

% gv /gsiftp/www.cs.wisc.edu/condor/doc/usenix_1.92.ps % grep Yahoo /http/www.yahoo.com

Page 16: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

16http://www.cs.wisc.edu/condor

What is Condor?› Condor converts collections of distributively

owned workstations and dedicated clusters into a distributed high-throughput computing (HTC) facility.

› Condor manages both resources (machines) and resource requests (jobs)

› Condor has several unique mechanisms such as : ClassAd Matchmaking Process checkpoint/ restart / migration Remote System Calls Grid Awareness

Page 17: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

17http://www.cs.wisc.edu/condor

Condor can manage a large number of jobs

› Managing a large number of jobs You specify the jobs in a file and submit

them to Condor, which runs them all and keeps you notified on their progress

Mechanisms to help you manage huge numbers of jobs (1000’s), all the data, etc.

Condor can handle inter-job dependencies (DAGMan)

Condor users can set job priorities Condor administrators can set user priorities

Page 18: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

18http://www.cs.wisc.edu/condor

Condor can manage Dedicated Resources…

› Dedicated Resources Compute Clusters

› Manage Node monitoring,

scheduling Job launch,

monitor & cleanup

Page 19: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

19http://www.cs.wisc.edu/condor

…and Condor can manage non-dedicated

resources› Non-dedicated resources examples:

Desktop workstations in offices Workstations in student labs

› Non-dedicated resources are often idle --- ~70% of the time!

› Condor can effectively harness the otherwise wasted compute cycles from non-dedicated resources

Page 20: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

20http://www.cs.wisc.edu/condor

Mechanisms in Condor used to harness non-

dedicated workstations

› Transparent Process Checkpoint / Restart

› Transparent Process Migration

› Transparent Redirection of I/O (Condor’s Remote System Calls)

Page 21: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

21http://www.cs.wisc.edu/condor

What else is Condor Good For?

› Robustness Checkpointing allows guaranteed forward

progress of your jobs, even jobs that run for weeks before completion

If an execute machine crashes, you only lose work done since the last checkpoint

Condor maintains a persistent job queue - if the submit machine crashes, Condor will recover

Page 22: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

22http://www.cs.wisc.edu/condor

What else is Condor Good For? (cont’d)

› Giving you access to more computing resources Dedicated compute cluster workstations Non-dedicated workstations Resources at other institutions

• Remote Condor Pools via Condor Flocking• Remote resources via Globus Grid protocols

Page 23: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

23http://www.cs.wisc.edu/condor

What is ClassAd Matchmaking?

› Condor uses ClassAd Matchmaking to make sure that work gets done within the constraints of both users and owners.

› Users (jobs) have constraints: “I need an Alpha with 256 MB RAM”

› Owners (machines) have constraints: “Only run jobs when I am away from my desk

and never run jobs owned by Bob.”› Semi-structured data --- no fixed schema

Page 24: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

24http://www.cs.wisc.edu/condor

Some HTC Challenges

› Condor does whatever it takes to run your jobs, even if some machines… Crash (or are disconnected) Run out of disk space Don’t have your software installed Are frequently needed by others Are far away & managed by someone

else

Page 25: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

25http://www.cs.wisc.edu/condor

The Condor System› Unix and NT

› Operational since 1986› More than 400 pools installed, managing

more than 17000 CPUs worldwide.› More than 1800 CPUs in 10 pools on our

campus

› Software available free on the web Open license

› Adopted by the “real world” (Galileo, Maxtor, Micron, Oracle, Tigr, CORE… )

Page 26: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

26http://www.cs.wisc.edu/condor

Page 27: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

28http://www.cs.wisc.edu/condor

Globus Toolkit

› The Globus Toolkit is an open source implementation of Grid-related protocols & middleware services designed by the Globus Project and collaborators Remote job execution, security

infrastructure, directory services, data transfer, …

Page 28: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

29http://www.cs.wisc.edu/condor

The Condor Project and the Grid …

› Close collaboration and coordination with the Globus Project – joint development, adoption of common protocols, technology exchange, …

› Partner in major national Grid R&D2 (Research, Development and Deployment) efforts (GriPhyN, iVDGL, IPG, TeraGrid)

› Close collaboration with Grid projects in Europe (EDG, GridLab, e-Science)

Page 29: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

30http://www.cs.wisc.edu/condor

Remote Resource Access: Globus

“globusrun myjob …”

Globus GRAM ProtocolGlobus

JobManager

fork()

Organization A Organization B

Page 30: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

31http://www.cs.wisc.edu/condor

Remote Resource Access: GlobusGlobus GRAM Protocol

Globus JobManager

fork()

Organization A Organization B

“globusrun myjob …”

Page 31: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

32http://www.cs.wisc.edu/condor

Remote Resource Access: Globus +

CondorGlobus GRAM Protocol Globus

JobManager

Submit to Condor

Condor Pool

Organization A Organization B

“globusrun myjob …”

Page 32: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

33http://www.cs.wisc.edu/condor

Remote Resource Access: Globus +

Condor

“globusrun …”

Globus GRAM Protocol Globus JobManager

Submit to Condor

Condor Pool

Organization A Organization B

Page 33: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

34http://www.cs.wisc.edu/condor

Condor-GA Grid-enabled version of Condor that provides robust job management for Globus clients.

Robust replacement for globusrun Provides extensive fault-tolerance Can provide scheduling across

multiple Globus sites Brings Condor’s job management

features to Globus jobs

Page 34: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

35http://www.cs.wisc.edu/condor

Remote Resource Access: Condor-G + Globus +

CondorGlobus GRAM Protocol Globus

JobManager

Submit to Condor

Condor Pool

Organization A Organization B

Condor-GCondor-G

myjob1myjob2myjob3myjob4myjob5…

Page 35: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

36http://www.cs.wisc.edu/condor

User/Application

Fabric (processing, storage, communication)

Grid

Page 36: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

37http://www.cs.wisc.edu/condor

User/Application

Fabric (processing, storage, communication)

GridCondor

Globus Toolkit

Condor

Page 37: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

38http://www.cs.wisc.edu/condor

User/Application

Fabric (processing, storage, communication)

GridCondor Pool

Globus Toolkit

Condor-G

Page 38: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

39http://www.cs.wisc.edu/condor

The Idea

Computing power

is everywhere, we try to make it usable

by anyone.

Page 39: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

40http://www.cs.wisc.edu/condor

Meet Frieda.

She is a scientist.

But she has a big

problem.

Page 40: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

41http://www.cs.wisc.edu/condor

Frieda’s Application …Simulate the behavior of F(x,y,z) for 20 values of x, 10 values of y and 3 values of z (20*10*3 = 600 combinations) F takes on the average 3 hours to compute

on a “typical” workstation (total = 1800 hours)

F requires a “moderate” (128MB) amount of memory

F performs “moderate” I/O - (x,y,z) is 5 MB and F(x,y,z) is 50 MB

Page 41: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

42http://www.cs.wisc.edu/condor

I have 600simulations to run.

Where can I get help?

Page 42: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

43http://www.cs.wisc.edu/condor

Install a Personal Condor!

Page 43: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

44http://www.cs.wisc.edu/condor

Installing Condor› Download Condor for your operating

system

› Available as a free download fromhttp://www.cs.wisc.edu/condor

› Stable –vs- Developer Releases Naming scheme similar to the Linux Kernel…

› Available for most Unix platforms and Windows NT

Page 44: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

45http://www.cs.wisc.edu/condor

So Frieda Installs Personal Condor on her

machine…› What do we mean by a “Personal”

Condor? Condor on your own workstation, no

root access required, no system administrator intervention needed

› So after installation, Frieda submits her jobs to her Personal Condor…

Page 45: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

46http://www.cs.wisc.edu/condor

yourworkstation

personalCondor

600 Condorjobs

Page 46: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

47http://www.cs.wisc.edu/condor

Personal Condor?!

What’s the benefit of a Condor “Pool” with just

one user and one machine?

Page 47: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

48http://www.cs.wisc.edu/condor

Your Personal 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

Page 48: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

49http://www.cs.wisc.edu/condor

Getting Started: Submitting Jobs to

Condor› Choosing a “Universe” for your job

Just use VANILLA for now

› Make your job “batch-ready”

› Creating a submit description file

› Run condor_submit on your submit description file

Page 49: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

50http://www.cs.wisc.edu/condor

Making your job ready› Must be able to run in the

background: no interactive input, windows, GUI, etc.

› Can still use STDIN, STDOUT, and STDERR (the keyboard and the screen), but files are used for these instead of the actual devices

› Organize data files

Page 50: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

51http://www.cs.wisc.edu/condor

Creating a Submit Description File

› A plain ASCII text file

› 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.

Page 51: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

52http://www.cs.wisc.edu/condor

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 = vanillaExecutable = my_jobQueue

Page 52: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

53http://www.cs.wisc.edu/condor

Running condor_submit

› You give condor_submit the name of the submit file you have created

› condor_submit parses the file, checks for errors, and creates a “ClassAd” that describes your job(s)

› Sends your job’s ClassAd(s) and executable to the condor_schedd, which stores the job in its queue Atomic operation, two-phase commit

› View the queue with condor_q

Page 53: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

54http://www.cs.wisc.edu/condor

Running condor_submit

% condor_submit my_job.submit-fileSubmitting job(s).1 job(s) submitted to cluster 1.

% condor_q

-- Submitter: perdita.cs.wisc.edu : <128.105.165.34:1027> : ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD

1.0 frieda 6/16 06:52 0+00:00:00 I 0 0.0 my_job

1 jobs; 1 idle, 0 running, 0 held

%

Page 54: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

55http://www.cs.wisc.edu/condor

Another Submit Description File

# 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 = vanillaExecutable = /home/wright/condor/my_job.condorInput = my_job.stdinOutput = my_job.stdoutError = my_job.stderrArguments = -arg1 -arg2InitialDir = /home/wright/condor/run_1Queue

Page 55: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

56http://www.cs.wisc.edu/condor

“Clusters” and “Processes”

› If your submit file describes multiple jobs, we call this a “cluster”

› Each job within a cluster is called a “process” or “proc”

› If you only specify one job, you still get a cluster, but it has only one process

› A Condor “Job ID” is the cluster number, a period, and the process number (“23.5”)

› Process numbers always start at 0

Page 56: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

57http://www.cs.wisc.edu/condor

Example Submit Description File for a

Cluster# Example condor_submit input file that defines# a cluster of two jobs with different iwdUniverse = vanillaExecutable = my_jobArguments = -arg1 -arg2

InitialDir = run_0 Queue Becomes job 2.0

InitialDir = run_1

Queue Becomes job 2.1

Page 57: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

58http://www.cs.wisc.edu/condor

% condor_submit my_job.submit-file

Submitting job(s).

2 job(s) submitted to cluster 2.

% condor_q

-- Submitter: perdita.cs.wisc.edu : <128.105.165.34:1027> :

ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD

1.0 frieda 6/16 06:52 0+00:02:11 R 0 0.0 my_job

2.0 frieda 6/16 06:56 0+00:00:00 I 0 0.0 my_job

2.1 frieda 6/16 06:56 0+00:00:00 I 0 0.0 my_job

3 jobs; 2 idle, 1 running, 0 held

%

Page 58: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

59http://www.cs.wisc.edu/condor

Submit Description File for a BIG Cluster of Jobs

› The initial directory for each job is specified with the $(Process) macro, and instead of submitting a single job, we use “Queue 600” to submit 600 jobs at once

› $(Process) will be expanded to the process number for each job in the cluster (from 0 up to 599 in this case), so we’ll have “run_0”, “run_1”, … “run_599” directories

› All the input/output files will be in different directories!

Page 59: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

60http://www.cs.wisc.edu/condor

Submit Description File for a BIG Cluster of Jobs

# Example condor_submit input file that defines# a cluster of 600 jobs with different iwdUniverse = vanillaExecutable = my_jobArguments = -arg1 –arg2InitialDir = run_$(Process)Queue 600

Page 60: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

61http://www.cs.wisc.edu/condor

Using condor_rm

› If you want to remove a job from the Condor queue, you use condor_rm

› You can only remove jobs that you own (you can’t run condor_rm on someone else’s jobs unless you are root)

› You can give specific job ID’s (cluster or cluster.proc), or you can remove all of your jobs with the “-a” option.

Page 61: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

62http://www.cs.wisc.edu/condor

Temporarily halt a Job› Use condor_hold to place a job on

hold Kills job if currently running Will not attempt to restart job until

released

› Use condor_release to remove a hold and permit job to be scheduled again

Page 62: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

63http://www.cs.wisc.edu/condor

Using condor_history

› Once your job completes, it will no longer show up in condor_q

› You can use condor_history to view information about a completed job

› The status field (“ST”) will have either a “C” for “completed”, or an “X” if the job was removed with condor_rm

Page 63: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

64http://www.cs.wisc.edu/condor

Getting Email from Condor

› By default, Condor will send you email when your jobs completes With lots of information about the run

› If you don’t want this email, put this in your submit file:

notification = never

› If you want email every time something happens to your job (preempt, exit, etc), use this:

notification = always

Page 64: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

65http://www.cs.wisc.edu/condor

Getting Email from Condor (cont’d)

› If you only want email in case of errors, use this:

notification = error

› By default, the email is sent to your account on the host you submitted from. If you want the email to go to a different address, use this:

notify_user = [email protected]

Page 65: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

66http://www.cs.wisc.edu/condor

A Job’s life story: The “User Log” file

› A UserLog must be specified in your submit file: Log = filename

› You get a log entry for everything that happens to your job: When it was submitted, when it starts

executing, preempted, restarted, completes, if there are any problems, etc.

› Very useful! Highly recommended!

Page 66: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

67http://www.cs.wisc.edu/condor

Sample Condor User Log

000 (8135.000.000) 05/25 19:10:03 Job submitted from host: <128.105.146.14:1816>

...

001 (8135.000.000) 05/25 19:12:17 Job executing on host: <128.105.165.131:1026>

...

005 (8135.000.000) 05/25 19:13:06 Job terminated.

(1) Normal termination (return value 0)

Usr 0 00:00:37, Sys 0 00:00:00 - Run Remote Usage

Usr 0 00:00:00, Sys 0 00:00:05 - Run Local Usage

Usr 0 00:00:37, Sys 0 00:00:00 - Total Remote Usage

Usr 0 00:00:00, Sys 0 00:00:05 - Total Local Usage

9624 - Run Bytes Sent By Job

7146159 - Run Bytes Received By Job

9624 - Total Bytes Sent By Job

7146159 - Total Bytes Received By Job

...

Page 67: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

68http://www.cs.wisc.edu/condor

Uses for the User Log› Easily read by human or machine

C++ library and Perl Module for parsing UserLogs is available

log_xml=True – XML formatted

› Event triggers for meta-schedulers Like DagMan…

› Visualizations of job progress Condor JobMonitor Viewer

Page 68: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

Condor JobMonito

rScreensh

ot

Page 69: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

70http://www.cs.wisc.edu/condor

Job Priorities w/ condor_prio

› condor_prio allows you to specify the order in which your jobs are started

› Higher the prio #, the earlier the job will start% condor_q

-- Submitter: perdita.cs.wisc.edu : <128.105.165.34:1027> :

ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD

1.0 frieda 6/16 06:52 0+00:02:11 R 0 0.0 my_job

% condor_prio +5 1.0

% condor_q

-- Submitter: perdita.cs.wisc.edu : <128.105.165.34:1027> :

ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD

1.0 frieda 6/16 06:52 0+00:02:13 R 5 0.0 my_job

Page 70: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

71http://www.cs.wisc.edu/condor

Want other Scheduling possibilities?

Use the Scheduler Universe› In addition to VANILLA, another job

universe is the Scheduler Universe.

› Scheduler Universe jobs run on the submitting machine and serve as a meta-scheduler.

› DAGMan meta-scheduler included

Page 71: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

72http://www.cs.wisc.edu/condor

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.”)

Page 72: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

73http://www.cs.wisc.edu/condor

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 A

Job B Job C

Job D

Page 73: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

74http://www.cs.wisc.edu/condor

› A DAG is defined by a .dag file, listing each of its nodes and their dependencies:# diamond.dagJob A a.subJob B b.subJob C c.subJob D d.subParent A Child B CParent B C Child D

› each node will run the Condor job specified by its accompanying Condor submit file

Defining a DAG

Job A

Job B Job C

Job D

Page 74: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

75http://www.cs.wisc.edu/condor

Submitting a DAG

› To start your DAG, just run condor_submit_dag with your .dag file, and Condor will start a personal DAGMan daemon which to begin running your jobs:

% condor_submit_dag diamond.dag

› condor_submit_dag submits a Scheduler Universe Job with DAGMan as the executable.

› Thus the DAGMan daemon itself runs as a Condor job, so you don’t have to baby-sit it.

Page 75: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

76http://www.cs.wisc.edu/condor

DAGMan

Running a DAG

› DAGMan acts as a “meta-scheduler”, managing the submission of your jobs to Condor based on the DAG dependencies.

CondorJobQueue

C

D

A

A

B.dagFile

Page 76: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

77http://www.cs.wisc.edu/condor

DAGMan

Running a DAG (cont’d)

› DAGMan holds & submits jobs to the Condor queue at the appropriate times.

CondorJobQueue

C

D

B

C

B

A

Page 77: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

78http://www.cs.wisc.edu/condor

DAGMan

Running a DAG (cont’d)

› 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.

CondorJobQueue

X

D

A

BRescue

File

Page 78: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

79http://www.cs.wisc.edu/condor

DAGMan

Recovering a DAG

› Once the failed job is ready to be re-run, the rescue file can be used to restore the prior state of the DAG.

CondorJobQueue

C

D

A

BRescue

File

C

Page 79: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

80http://www.cs.wisc.edu/condor

DAGMan

Recovering a DAG (cont’d)

› Once that job completes, DAGMan will continue the DAG as if the failure never happened.

CondorJobQueue

C

D

A

B

D

Page 80: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

81http://www.cs.wisc.edu/condor

DAGMan

Finishing a DAG

› Once the DAG is complete, the DAGMan job itself is finished, and exits.

CondorJobQueue

C

D

A

B

Page 81: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

82http://www.cs.wisc.edu/condor

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”

Page 82: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

83http://www.cs.wisc.edu/condor

Another sample DAGMan submit file

# Filename: diamond.dagJob A A.condorJob B B.condorJob C C.condorJob D D.condorScript PRE A top_pre.cshScript PRE B mid_pre.perl $JOBScript POST B mid_post.perl $JOB $RETURNScript PRE C mid_pre.perl $JOBScript POST C mid_post.perl $JOB $RETURNScript PRE D bot_pre.cshPARENT A CHILD B CPARENT B C CHILD DRetry C 3

Job A

Job B Job C

Job D

Page 83: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

84http://www.cs.wisc.edu/condor

DAGMan, cont.

› DAGMan can help w/ visualization of the DAG Can create input files for AT&T’s

graphviz package (dot input).

› Why not just use make?

› In the works: dynamic DAGs.

Page 84: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

85http://www.cs.wisc.edu/condor

We’ve seen how 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 ?

Page 85: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

86http://www.cs.wisc.edu/condor

What if each job needed to run for

20 days?

What if I wanted to interrupt a job with

a higher priority job?

Page 86: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

87http://www.cs.wisc.edu/condor

Condor’s Standard Universe to the rescue!

› Condor can support various combinations of features/environments in different “Universes”

› Different Universes provide different functionality for your job: Vanilla – Run any Serial Job Scheduler – Plug in a meta-scheduler Standard – Support for transparent

process checkpoint and restart

Page 87: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

88http://www.cs.wisc.edu/condor

Process Checkpointing› Condor’s Process Checkpointing

mechanism saves all the state of a process into a checkpoint file Memory, CPU, I/O, etc.

› The process can then be restarted from right where it left off

› Typically no changes to your job’s source code needed – however, your job must be relinked with Condor’s Standard Universe support library

Page 88: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

89http://www.cs.wisc.edu/condor

Relinking Your Job for submission to the Standard Universe

To do this, just place “condor_compile” in front of the command you normally use to link your job:condor_compile gcc -o myjob myjob.c

OR

condor_compile f77 -o myjob filea.f fileb.f

OR

condor_compile make –f MyMakefile

Page 89: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

90http://www.cs.wisc.edu/condor

Limitations in the Standard Universe

› Condor’s checkpointing is not at the kernel level. Thus in the Standard Universe the job may not Fork() Use kernel threads Use some forms of IPC, such as pipes

and shared memory

› Many typical scientific jobs are OK

Page 90: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

91http://www.cs.wisc.edu/condor

When will Condor checkpoint your job?

› Periodically, if desired For fault tolerance

› To free the machine to do a higher priority task (higher priority job, or a job from a user with higher priority) Preemptive-resume scheduling

› When you explicitly run condor_checkpoint, condor_vacate, condor_off or condor_restart command

Page 91: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

92http://www.cs.wisc.edu/condor

“Standalone” Checkpointing

› Can use Condor Project’s checkpoint technology outside of Condor… SIGTSTP = checkpoint and exit SIGUSR2 = periodic checkpoint

condor_compile cc myapp.c –o myappmyapp -_condor_ckpt foo-image.ckpt…myapp -_condor_restart foo-image.ckpt

Page 92: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

93http://www.cs.wisc.edu/condor

Checkpoint Library Interface

› void init image with file name( char *ckpt file name )

› void init image with file descriptor( int fd )› void ckpt()› void ckpt and exit()› void restart()› void condor ckpt disable()› void condor ckpt enable()› int condor warning config( const char *kind,const

char *mode)› extern int condor compress ckpt

Page 93: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

94http://www.cs.wisc.edu/condor

What Condor Daemons are

running on my machine, and what

do they do?

Page 94: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

95http://www.cs.wisc.edu/condor

Condor Daemon Layout

Personal Condor / Central Manager

master

collector

negotiator

schedd

startd

= Process Spawned

Page 95: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

96http://www.cs.wisc.edu/condor

condor_master› Starts up all other Condor

daemons› If there are any problems and a

daemon exits, it restarts the daemon and sends email to the administrator

› Checks the time stamps on the binaries of the other Condor daemons, and if new binaries appear, the master will gracefully shutdown the currently running version and start the new version

master

Page 96: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

97http://www.cs.wisc.edu/condor

condor_master (cont’d)› Acts as the server for many Condor

remote administration commands: condor_reconfig, condor_restart,

condor_off, condor_on, condor_config_val, etc.

Page 97: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

98http://www.cs.wisc.edu/condor

condor_startd› 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 soon)

master

startd

Page 98: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

99http://www.cs.wisc.edu/condor

condor_schedd› Represents users to the

Condor system› 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, …

master

schedd

startd

Page 99: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

100http://www.cs.wisc.edu/condor

condor_collector

› Collects information from all other Condor daemons in the pool “Directory Service” / Database for a Condor pool

› Each daemon sends a periodic update called a “ClassAd” to the collector

› Services queries for information: Queries from other Condor daemons Queries from users (condor_status)

scheddcollector

master

startd

Page 100: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

101http://www.cs.wisc.edu/condor

condor_negotiator

› Performs “matchmaking” in Condor› 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

master

collector

negotiator

schedd

startd

Page 101: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

102http://www.cs.wisc.edu/condor

Happy Day! Frieda’s organization purchased

a Beowulf Cluster!› Frieda Installs Condor on

all the dedicated Cluster nodes, and configures them with her machine as the central manager…

› Now her Condor Pool can run multiple jobs at once

Page 102: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

103http://www.cs.wisc.edu/condor

yourworkstation

personalCondor

600 Condorjobs

Condor Pool

Page 103: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

104http://www.cs.wisc.edu/condor

Layout of the Condor PoolCentral Manager (Frieda’s)

master

collector

negotiator

schedd

startd

= ClassAd Communication Pathway

= Process Spawned Cluster Node

master

startd

Cluster Node

master

startd

Page 104: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

105http://www.cs.wisc.edu/condor

condor_status% condor_status

Name OpSys Arch State Activity LoadAv Mem ActvtyTime

haha.cs.wisc. IRIX65 SGI Unclaimed Idle 0.198 192 0+00:00:04

antipholus.cs LINUX INTEL Unclaimed Idle 0.020 511 0+02:28:42

coral.cs.wisc LINUX INTEL Claimed Busy 0.990 511 0+01:27:21

doc.cs.wisc.e LINUX INTEL Unclaimed Idle 0.260 511 0+00:20:04

dsonokwa.cs.w LINUX INTEL Claimed Busy 0.810 511 0+00:01:45

ferdinand.cs. LINUX INTEL Claimed Suspended 1.130 511 0+00:00:55

vm1@pinguino. LINUX INTEL Unclaimed Idle 0.000 255 0+01:03:28

vm2@pinguino. LINUX INTEL Unclaimed Idle 0.190 255 0+01:03:29

Page 105: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

106http://www.cs.wisc.edu/condor

Frieda tries out ‘static’ parallel jobs: MPI

Universe› Schedule and start an MPICH job on

dedicated resources

## MPI example submit description fileuniverse = MPIexecutable = simplempilog = logfileinput = infile.$(NODE)output = outfile.$(NODE)error = errfile.$(NODE)machine_count = 4queue

Page 106: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

107http://www.cs.wisc.edu/condor

The Boss says Frieda can add her

co-workers’ desktop machines

into her Condor pool as well…

but only if they can also submit jobs.

(Boss Fat Cat)

Page 107: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

108http://www.cs.wisc.edu/condor

Layout of the Condor PoolCentral Manager (Frieda’s)

master

collector

negotiator

schedd

startd

= ClassAd Communication Pathway

= Process Spawned

Desktop

schedd

startd

master

Desktop

schedd

startd

master

Cluster Node

master

startd

Cluster Node

master

startd

Page 108: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

109http://www.cs.wisc.edu/condor

Some of the machines in the Pool do not have

enough memory or scratch disk space

to run my job!

Page 109: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

110http://www.cs.wisc.edu/condor

Specify Requirements!› An expression (syntax similar to C or Java)› Must evaluate to True for a match to be made

Universe = vanillaExecutable = my_jobInitialDir = run_$(Process)Requirements = Memory >= 256 && Disk > 10000Queue 600

Page 110: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

111http://www.cs.wisc.edu/condor

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 = vanillaExecutable = my_jobArguments = -arg1 –arg2InitialDir = run_$(Process)Requirements = Memory >= 256 && Disk > 10000Rank = (KFLOPS*10000) + MemoryQueue 600

Page 111: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

112http://www.cs.wisc.edu/condor

What attributes can I reference in

Requirements/Rank ?› Answer: Any attributes that appear in the

machine or job classad› Out of the box, Condor has ~70 attributes per

machine classad and ~70 attributes per job classad

› Sites can add their own custom machine or job classads

› To see all ad attributes: condor_status –long (for machine classads) condor_q –long (for job classads)

Page 112: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

113http://www.cs.wisc.edu/condor

How can my jobs access their data

files?

Page 113: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

114http://www.cs.wisc.edu/condor

Access to Data in Condor

› Use Shared Filesystem if available› No shared filesystem?

Remote System Calls (in the Standard Universe)

Condor File Transfer Service• Can automatically send back changed files• Atomic transfer of multiple files

Remote I/O Proxy Socket

Page 114: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

115http://www.cs.wisc.edu/condor

Standard Universe Remote System Calls

› I/O System calls trapped and sent back to submit machine

› Allows Transparent Migration Across Administrative Domains Checkpoint on machine A, restart on B

› No Source Code changes required› Language Independent› Opportunities

For Application Steering• Example: Condor tells customer process “how” to open files

For compression on the fly More…

Page 115: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

116http://www.cs.wisc.edu/condor

Customer Job

Job Startup

Submit

Schedd

Shadow

Startd

Starter

CondorSyscall Lib

Page 116: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

117http://www.cs.wisc.edu/condor

condor_q -ioc01(69)% condor_q -io

-- Submitter: c01.cs.wisc.edu : <128.105.146.101:2996> : c01.cs.wisc.edu

ID OWNER READ WRITE SEEK XPUT BUFSIZE BLKSIZE

72.3 edayton [ no i/o data collected yet ]

72.5 edayton 6.8 MB 0.0 B 0 104.0 KB/s 512.0 KB 32.0 KB

73.0 edayton 6.4 MB 0.0 B 0 140.3 KB/s 512.0 KB 32.0 KB

73.2 edayton 6.8 MB 0.0 B 0 112.4 KB/s 512.0 KB 32.0 KB

73.4 edayton 6.8 MB 0.0 B 0 139.3 KB/s 512.0 KB 32.0 KB

73.5 edayton 6.8 MB 0.0 B 0 139.3 KB/s 512.0 KB 32.0 KB

73.7 edayton [ no i/o data collected yet ]

0 jobs; 0 idle, 0 running, 0 held

Page 117: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

118http://www.cs.wisc.edu/condor

Condor File Transfer› Set Should_Transfer_Files

YES : Always transfer files to execution site NO : Rely on a shared filesystem IF_NEEDED : will automatically transfer the files if the submit

and execute machine are not in the same FileSystemDomain

› Set When_To_Transfer_Output ON_EXIT or ON_EXIT_OR_VACATE

Universe = vanillaExecutable = my_jobRequirements = Memory >= 256 && Disk > 10000Should_Transfer_Files = IF_NEEDEDWhen_To_Transfer_Output = IF_NEEDEDTransfer_input_files = dataset$(Process), common.dataTransfer_output_files = TheAnswer.datQueue 600

Page 118: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

119http://www.cs.wisc.edu/condor

Remote I/O Socket› Job can request that the condor_starter process on

the execute machine create a Remote I/O Proxy Socket

› Used for online access of file on submit machine – without Standard Universe. Use in Vanilla, Java, …

› Libraries provided for Java and for C, e.g. :Java: FileInputStream -> ChirpInputStream

C : open() -> chirp_open()› Or use Parrot!

Page 119: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

120http://www.cs.wisc.edu/condor

Job

Fork

startershadow

HomeFile

System

I/O Library

I/O Server I/O Proxy

Secure Remote I/O

Local System Calls

Local I/O(Chirp)

Execution SiteSubmission Site

Page 120: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

121http://www.cs.wisc.edu/condor

I am adding nodes to the Cluster… but

the Engineering Department has priority on these

nodes.

(Boss Fat Cat)

Policy Configuration

Page 121: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

122http://www.cs.wisc.edu/condor

The Machine (Startd) Policy Expressions

START – When is this machine willing to start a job

RANK - Job PreferencesSUSPEND - When to suspend a jobCONTINUE - When to continue a suspended

jobPREEMPT – When to nicely stop running a jobKILL - When to immediately kill a

preempting job

Page 122: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

123http://www.cs.wisc.edu/condor

Freida’s Current Settings

START = TrueRANK =SUSPEND = FalseCONTINUE =PREEMPT = FalseKILL = False

Page 123: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

124http://www.cs.wisc.edu/condor

Freida’s New Settings for the Chemistry

nodesSTART = True

RANK = Department == “Chemistry”

SUSPEND = FalseCONTINUE =PREEMPT = FalseKILL = False

Page 124: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

125http://www.cs.wisc.edu/condor

Submit file with Custom Attribute

Executable = charm-runUniverse = standard+Department = Chemistryqueue

Page 125: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

126http://www.cs.wisc.edu/condor

What if “Department” not specified?

START = TrueRANK = Department =!= UNDEFINED

&& Department == “Chemistry”SUSPEND = FalseCONTINUE =PREEMPT = FalseKILL = False

Page 126: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

127http://www.cs.wisc.edu/condor

Another example

START = TrueRANK = Department =!= UNDEFINED

&& ((Department == “Chemistry”)*2 + Department == “Physics”)

SUSPEND = FalseCONTINUE =PREEMPT = FalseKILL = False

Page 127: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

128http://www.cs.wisc.edu/condor

The Cluster is fine. But not the

desktop machines. Condor can only use the desktops when they would otherwise be idle.

(Boss Fat Cat)

Policy Configuration, cont

Page 128: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

129http://www.cs.wisc.edu/condor

So Frieda decides she wants the desktops to:

› START jobs when their has been no activity on the keyboard/mouse for 5 minutes and the load average is low

› SUSPEND jobs as soon as activity is detected

› PREEMPT jobs if the activity continues for 5 minutes or more

› KILL jobs if they take more than 5 minutes to preempt

Page 129: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

130http://www.cs.wisc.edu/condor

Macros in the Config FileNonCondorLoadAvg = (LoadAvg - CondorLoadAvg)

BackgroundLoad = 0.3HighLoad = 0.5KeyboardBusy = (KeyboardIdle < 10)CPU_Busy = ($(NonCondorLoadAvg) >= $

(HighLoad))MachineBusy = ($(CPU_Busy) || $(KeyboardBusy))ActivityTimer = (CurrentTime -

EnteredCurrentActivity)

Page 130: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

131http://www.cs.wisc.edu/condor

Desktop Machine Policy

START = $(CPU_Idle) && KeyboardIdle > 300SUSPEND = $(MachineBusy)CONTINUE = $(CPU_Idle) && KeyboardIdle >

120PREEMPT = (Activity == "Suspended") &&

$(ActivityTimer) > 300KILL = $(ActivityTimer) > 300

Page 131: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

132http://www.cs.wisc.edu/condor

Policy Review› Users submitting jobs can specify

Requirements and Rank expressions› Administrators can specify Startd Policy

expressions individually for each machine (Start,Suspend,etc)

› Expressions can use any job or machine ClassAd attribute

› Custom attributes easily added› Bottom Line: Enforce almost any policy!

Page 132: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

133http://www.cs.wisc.edu/condor

I want to use Java.Is there any easyway to run Java programs via

Condor?

Page 133: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

134http://www.cs.wisc.edu/condor

Java Universe Jobuniverse = javaexecutable = Main.classjar_files = MyLibrary.jarinput = infileoutput = outfilearguments = Main 1 2 3queue

condor_submit

Page 134: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

135http://www.cs.wisc.edu/condor

Why not use Vanilla Universe for Java jobs?

› Java Universe provides more than just inserting “java” at the start of the execute line Knows which machines have a JVM installed Knows the location, version, and

performance of JVM on each machine 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.

Page 135: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

136http://www.cs.wisc.edu/condor

Java support, cont.

condor_status -java

Name JavaVendor Ver State Activity LoadAv Mem

aish.cs.wisc. Sun Microsy 1.2.2 Owner Idle 0.000 249

anfrom.cs.wis Sun Microsy 1.2.2 Owner Idle 0.030 249

babe.cs.wisc. Sun Microsy 1.2.2 Claimed Busy 1.120 123

...

Page 136: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

137http://www.cs.wisc.edu/condor

My MPI programs are running on the dedicated nodes.Can I run parallel jobs on the non-

dedicated nodes?

Page 137: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

138http://www.cs.wisc.edu/condor

PVM Universe› Allows dynamic, “opportunistic” PVM

Number of nodes can change dynamically› Specify a minimum and maximum

number of nodes› Works well for Master/Worker paradigm› Differences from regular PVM

pvm_addhost() is non-blocking pvm_notify enhanced w/ suspend state PVM “arch string” enhanced

› Can also use “MW” … does all the work for you.

Page 138: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

139http://www.cs.wisc.edu/condor

Non-dedicated Parallel Job: PVM Universe, Cont.

# The job is a PVM universe job.universe = PVM# The executable of the master PVM program is ``master.exe''.executable = master.exeinput = "in.dat"output = "out.dat"error = "err.dat"################### Machine class 0 ##################Requirements = (Arch == "INTEL") && (OpSys == "LINUX")# We want at least 2 machines in class 0 before starting the# program. We can use up to 4 machines.machine_count = 2..4queue################### Machine class 1 ##################Requirements = (Arch == "SUN4x") && (OpSys == "SOLARIS26")# We can use up to 50 more….machine_count = 1..50queue

Page 139: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

140http://www.cs.wisc.edu/condor

General User Commands› condor_status View Pool Status

› condor_q View Job Queue› condor_submit Submit new Jobs› condor_rm Remove Jobs› condor_prio Intra-User Prios› condor_history Completed Job Info› condor_submit_dag Specify Dependencies› condor_checkpoint Force a checkpoint› condor_compile Link Condor library

Page 140: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

141http://www.cs.wisc.edu/condor

Administrator Commands› condor_vacate Leave a machine now

› condor_on Start Condor

› condor_off Stop Condor

› condor_reconfig Reconfig on-the-fly

› condor_config_val View/set config

› condor_userprio User Priorities

› condor_stats View detailed usage accounting stats

Page 141: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

142http://www.cs.wisc.edu/condor

CondorView Usage Graph

Page 142: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

143http://www.cs.wisc.edu/condor

Back to the Story…

Frieda Needs Remote Resources…

Page 143: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

144http://www.cs.wisc.edu/condor

Frieda Builds a Grid!

› First Frieda takes advantage of her Condor friends!

› She knows people with their own Condor pools, and gets permission to access their resources

› She then configures her Condor pool to “flockflock” to these pools

Page 144: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

145http://www.cs.wisc.edu/condor

yourworkstation

Friendly Condor Pool

personalCondor

600 Condorjobs

Condor Pool

Page 145: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

146http://www.cs.wisc.edu/condor

How Flocking Works› Add a line to your condor_config :

FLOCK_HOSTS = Pool-Foo, Pool-Bar

ScheddSchedd

CollectorCollector

NegotiatorNegotiator

Central Manager

(CONDOR_HOST)

CollectorCollector

NegotiatorNegotiator

Pool-Foo Central Manager

CollectorCollector

NegotiatorNegotiator

Pool-BarCentral Manager

SubmitMachine

Page 146: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

147http://www.cs.wisc.edu/condor

Condor Flocking› Remote pools are contacted in the order

specified until jobs are satisfied

› The list of remote pools is a property of the Schedd, not the Central Manager So different users can Flock to different

pools And remote pools can allow specific users

› User-priority system is “flocking-aware” A pool’s local users can have priority over

remote users “flocking” in.

Page 147: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

148http://www.cs.wisc.edu/condor

Condor Flocking, cont.› Flocking is “Condor” specific technology…› Frieda also has access to Globus resources

she wants to use She has certificates and access to Globus

gatekeepers at remote institutions

› But Frieda wants Condor’s queue management features for her Globus jobs!

› She installs Condor-G so she can submit “Globus Universe” jobs to Condor

Page 148: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

149http://www.cs.wisc.edu/condor

Condor-G: Access non-Condor Grid resources

Globus

› middleware deployed across entire Grid

› remote access to computational resources

› dependable, robust data transfer

Condor› job scheduling across

multiple resources

› strong fault tolerance with checkpointing and migration

› layered over Globus as “personal batch system” for the Grid

Page 149: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

150http://www.cs.wisc.edu/condor

Condor-G

Condor-GCondor-G

Job Description (Job ClassAd)

GT2 [.1|2|4]

HTTPSCondor NorduGrid Oracle

GT3

OGSIUnicore?

Page 150: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

151http://www.cs.wisc.edu/condor

Frieda Submits a Globus Universe Job

› In her submit description file, she specifies: Universe = Globus Which Globus Gatekeeper to use Optional: Location of file containing your

Globus certificateuniverse = globusglobusscheduler = beak.cs.wisc.edu/jobmanagerexecutable = prognamequeue

Page 151: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

152http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

Personal Condor Globus Resource

Page 152: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

153http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

Personal Condor Globus Resource

600 Globusjobs

Page 153: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

154http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

Personal Condor Globus Resource

GridManagerGridManager

600 Globusjobs

Page 154: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

155http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

Personal Condor Globus Resource

GridManagerGridManager

600 Globusjobs

Page 155: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

156http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

User JobUser Job

Personal Condor Globus Resource

GridManagerGridManager

600 Globusjobs

Page 156: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

Condor Globus Universe

Page 157: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

158http://www.cs.wisc.edu/condor

Globus Universe Concerns

› What about Fault Tolerance? Local Crashes

• What if the submit machine goes down? Network Outages

• What if the connection to the remote Globus jobmanager is lost?

Remote Crashes• What if the remote Globus jobmanager

crashes?• What if the remote machine goes down?

Page 158: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

159http://www.cs.wisc.edu/condor

Changes to the Globus JobManager for Fault

Tolerance› Ability to restart a JobManager

› Enhanced two-phase commit submit protocol

Page 159: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

160http://www.cs.wisc.edu/condor

Globus Universe Fault-Tolerance: Submit-side

Failures› All relevant state for each submitted job

is stored persistently in the Condor job queue.

› This persistent information allows the Condor GridManager upon restart to read the state information and reconnect to JobManagers that were running at the time of the crash.

› If a JobManager fails to respond…

Page 160: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

161http://www.cs.wisc.edu/condor

Globus Universe Fault-Tolerance:Lost Contact with Remote

JobmanagerCan we contact gatekeeper?

Yes – network was downNo – machine crashed

or job completed

Yes - jobmanager crashed No – retry until we can talk to gatekeeper again…

Can we reconnect to jobmanager?

Has job completed?

No – is job still running?

Yes – update queue

Restart jobmanager

Page 161: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

162http://www.cs.wisc.edu/condor

Globus Universe Fault-Tolerance: Credential

Management› Authentication in Globus is done

with limited-lifetime X509 proxies› Proxy may expire before jobs finish

executing› Condor can put jobs on hold and

email user to refresh proxy› Todo: Interface with MyProxy…

Page 162: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

163http://www.cs.wisc.edu/condor

Can Condor-G decide where to run

my jobs?

Page 163: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

164http://www.cs.wisc.edu/condor

Condor-G Matchmaking

› Alternative to Glidein: Use Condor-G matchmaking with globus universe jobs

› Allows Condor-G to dynamically assign computing jobs to grid sites

› An example of lazy planning

Page 164: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

165http://www.cs.wisc.edu/condor

Condor-G Matchmaking, cont.

› Normally a globus universe job must specify the site in the submit description file via the “globusscheduler” attribute like so:

Executable = foo

Universe = globus

Globusscheduler = beak.cs.wisc.edu/jobmanager-pbs

queue

Page 165: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

166http://www.cs.wisc.edu/condor

Condor-G Matchmaking, cont.

› With matchmaking, globus universe jobs can use requirements and rank:

Executable = foo

Universe = globus

Globusscheduler = $$(GatekeeperUrl)

Requirements = arch == LINUX

Rank = NumberOfNodes

Queue

› The $$(x) syntax inserts information from the target ClassAd when a match is made.

Page 166: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

167http://www.cs.wisc.edu/condor

Condor-G Matchmaking, cont.› Where do these target ClassAds

representing Globus gatekeepers come from? Several options: Simple script on gatekeeper publishes an ad via

condor_advertise command-line utility (method used by D0 JIM, USCMS)

Program to query Globus MDS and convert information into ClassAd (method used by EDG)

Run HawkEye with appropriate plugins on the gatekeeper

› For explanation of Condor-G matchmaking setup for USCMS, see http://www.cs.wisc.edu/condor/USCMS_matchmaking.html

Page 167: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

168http://www.cs.wisc.edu/condor

DAGMan Callouts› Another mechanism to achieve lazy

planning: DAGMan callouts› Define DAGMAN_HELPER_COMMAND in

condor_config (usually a script)› The helper command is passed a copy of

the job submit file when DAGMan is about to submit that node in the graph

› This allows changes to be made to the submit file (such as changing GlobusScheduler) at the last minute

Page 168: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

169http://www.cs.wisc.edu/condor

But Frieda Wants More…

› She wants to run standard universe jobs on Globus-managed resources For matchmaking and dynamic

scheduling of jobs For job checkpointing and migration For remote system calls

Page 169: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

170http://www.cs.wisc.edu/condor

One Solution: Condor-G GlideIn

› Frieda can use the Globus Universe to run Condor daemons on Globus resources

› When the resources run these GlideIn jobs, they will temporarily join her Condor Pool

› She can then submit Standard, Vanilla, PVM, or MPI Universe jobs and they will be matched and run on the Globus resources

Page 170: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

171http://www.cs.wisc.edu/condor

yourworkstation

Friendly Condor Pool

personalCondor

600 Condorjobs

Globus Grid

PBS LSF

Condor

Condor Pool

glide-in jobs

Page 171: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

172http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

CollectorCollector

Personal Condor Globus Resource

600 Condorjobs

Page 172: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

173http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

CollectorCollector

Personal Condor Globus Resource

600 Condorjobs

GlideIn jobs

Page 173: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

174http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd

LSFLSF

CollectorCollector

Personal Condor Globus Resource

GridManagerGridManager

600 Condorjobs

GlideIn jobs

Page 174: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

175http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

CollectorCollector

Personal Condor Globus Resource

GridManagerGridManager

600 Condorjobs

GlideIn jobs

Page 175: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

176http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

StartdStartd

CollectorCollector

Personal Condor Globus Resource

GridManagerGridManager

600 Condorjobs

GlideIn jobs

Page 176: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

177http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

StartdStartd

CollectorCollector

Personal Condor Globus Resource

GridManagerGridManager

600 Condorjobs

GlideIn jobs

Page 177: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

178http://www.cs.wisc.edu/condor

How It Works

ScheddSchedd JobManagerJobManager

LSFLSF

User JobUser Job

StartdStartd

CollectorCollector

Personal Condor Globus Resource

GridManagerGridManager

600 Condorjobs

GlideIn jobs

Page 178: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

179http://www.cs.wisc.edu/condor

Job Submission Machine

Job Execution Site

Job

Condor-G GridManager

GASS Server

Condor-G Scheduler

Persistant Job Queue

End User Requests

Condor Shadow

Process for Job X

Condor-G Collector

Globus Daemons +

Local Site Scheduler

[See Figure 1]

Condor Daemons

Job X

Condor System Call

Trapping & Checkpoint Library

Resource

Information

Transfer Job X

Redirected System Call

Data

Page 179: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

180http://www.cs.wisc.edu/condor

GlideIn Concerns

› What if a Globus 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

Page 180: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

181http://www.cs.wisc.edu/condor

Common Questions, cont.My Personal Condor is flocking with a bunch

of Solaris machines, and also doing a GlideIn to a Silicon Graphics O2K. I do not want to statically partition my jobs.

Solution: In your submit file, say: Executable = myjob.$$(OpSys).$$(Arch)

The “$$(xxx)” notation is replaced with attributes from the machine ClassAd which was matched with your job.

Page 181: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

182http://www.cs.wisc.edu/condor

In Review

With Condor Frieda can… … manage her compute job workload … access local machines … build a grid to access remote

Condor Pools via flocking … access remote compute resources

on grids via Globus Universe jobs … carve out her own personal Condor

Pool from a grid with GlideIn technology

Page 182: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

183http://www.cs.wisc.edu/condor

I wan to create a portal to Condor.

Is there a developer API to Condor?

Page 183: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

184http://www.cs.wisc.edu/condor

Developer API

› Do not underestimate the flexibility of the command line tools!

› If not possible, consider SOAP

Page 184: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

185http://www.cs.wisc.edu/condor

HTTP Stack Added

Condor Service

CedarTodo:HTTPS and/orHTTPG

And nowHTTP

Page 185: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

186http://www.cs.wisc.edu/condor

Current SOAP status

› Clients can now use CEDAR or HTTP protocol to communicate to Condor daemons.

› If HTTP command is GET : use a built-in “mini” web server

• Useful for retrieving WSDL from the service itself

POST : assumed to be a SOAP RPC

Page 186: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

187http://www.cs.wisc.edu/condor

Current SOAP status, cont.

› Created first pass XML Schema representation of a list of ClassAds, and first pass WSDL files.

› CEDAR is more of a message-passing model instead of a true RPCmodel many back-and-forth messages.  we working on the considerable

task of re-arranging the implementation in the Condor daemons from message-passing model to a true RPC model.   

Page 187: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

188http://www.cs.wisc.edu/condor

Current SOAP status, cont.

› Started with the Collector modified the implementation of the collector

so all of the query operations are ignorant of the underlying transport (CEDAR or SOAP, it no longer knows or cares)

created SOAP stubs for all collector query operations

Proof of concept: simple “condor_status” was written in Perl. It works!

Page 188: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

189http://www.cs.wisc.edu/condor

Current Activity

› Currently adding soap stubs in the schedd for our queue management API.  This will give the equal of condor_q,

condor_prio, condor_qedit, condor_rm, …

› Adding DIME support (binary attachments to SOAP messages) in preparation for job sandbox delivery for submit interface.

Page 189: Condor Users Tutorial  National e-Science Centre Edinburgh, Scotland October 2003

190http://www.cs.wisc.edu/condor

Thank you!

Check us out on the Web:http://www.cs.wisc.edu/condor

Email:[email protected]