New condor_submit features in HTCondor 8.3/8.4 John (TJ) Knoeller Condor Week 2015.

Slides:



Advertisements
Similar presentations
Arrays A list is an ordered collection of scalars. An array is a variable that holds a list. Arrays have a minimum size of 0 and a very large maximum size.
Advertisements

CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Introduction to C Programming
Introduction to C Programming
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 14 – Student Grades Application: Introducing.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 5 Looping.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Chapter 5: Loops and Files.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 8 focuses on: array declaration and use passing arrays and array.
Chapter 6 C Arrays Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc. Arrays are data structures.
Chapter 8 Arrays and Strings
Introduction to C Programming
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Bash Shell Scripting 10 Second Guide Common environment variables PATH - Sets the search path for any executable command. Similar to the PATH variable.
Shell Script Examples.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 19 - The Preprocessor Outline 19.1 Introduction 19.2 The #include Preprocessor Directive 19.3.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Programming Languages -1 (Introduction to C) arrays Instructor: M.Fatih AMASYALI
Lists in Python.
Unix Talk #2 (sed). 2 You have learned…  Regular expressions, grep, & egrep  grep & egrep are tools used to search for text in a file  AWK -- powerful.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
Chapter 8 Arrays and Strings
Input, Output, and Processing
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Control Structures. Important Semantic Difference In all of these loops we are going to discuss, the braces are ALWAYS REQUIRED. Even if your loop/block.
UNIX Shell Script (1) Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
C Hints and Tips The preprocessor and other fun toys.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Chapter 9: Perl Programming Practical Extraction and Report Language Some materials are taken from Sams Teach Yourself Perl 5 in 21 Days, Second Edition.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
 2003 Prentice Hall, Inc. All rights reserved. 1 IS 0020 Program Design and Software Tools Preprocessing Lecture 12 April 7, 2005.
5 1 Data Files CGI/Perl Programming By Diane Zak.
HTCondor and Workflows: An Introduction HTCondor Week 2015 Kent Wenger.
Searching and Sorting. Why Use Data Files? There are many cases where the input to the program may come from a data file.Using data files in your programs.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
Loops and Files. 5.1 The Increment and Decrement Operators.
Think Possibility 1 Iterative Constructs ITERATION / LOOPS C provides three loop structures: the for-loop, the while-loop, and the do-while-loop. Each.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 5 Looping.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
The Preprocessor Directives Introduction Preprocessing – Occurs before program compiled Inclusion of external files Definition of symbolic constants.
Grid Compute Resources and Job Management. 2 Grid middleware - “glues” all pieces together Offers services that couple users with remote resources through.
CSC 4630 Meeting 17 March 21, Exam/Quiz Schedule Due to ice, travel, research and other commitments that we all have: –Quiz 2, scheduled for Monday.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
CSC 4630 Perl 3 adapted from R. E. Beck. Problem But we worked on it first: Input: Read from a text file named in a command line argument Output: List.
HTCondor Advanced Job Submission John (TJ) Knoeller Center for High Throughput Computing.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
ITM 3521 ITM 352 Functions. ITM 3522 Functions  A function is a named block of code (i.e. within {}'s) that performs a specific set of statements  It.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Improvements to Configuration
Topics Designing a Program Input, Processing, and Output
Things you may not know about HTCondor
Computer Programming BCT 1113
Things you may not know about HTCondor
Miscellaneous Items Loop control, block labels, unless/until, backwards syntax for “if” statements, split, join, substring, length, logical operators,
CISC101 Reminders Assn 3 due tomorrow, 7pm.
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Late Materialization has (lately) materialized
CISC101 Reminders Assignment 3 due today.
Arrays.
Overview Development of an advanced submit file
Presentation transcript:

New condor_submit features in HTCondor 8.3/8.4 John (TJ) Knoeller Condor Week 2015

› One submit file – many jobs.  Process a bunch of similar files or directories  For simple cases - use python bindings for the hard cases › Address some usability issues  Reduce the need to wrap submit in a script › Pick up some of the 8.2 config features › Prepare the ground for future scalability The goals 2

Queue Queue Universe = Vanilla Executable = cook Output = meal$(Process).out Args = -i pasta Queue Args = -i chicken Queue › This produces 2 jobs in the same Cluster, each with different arguments Review – The way it works in 8.2 3

› In 8.3.5/8.4 This submit file can be shortened to Universe = Vanilla Executable = cook Output = meal$(Process).out Args = -i $(Item) Queue Item in (pasta, chicken) › Identical results to the previous submit The new way: Submit 'foreach' 4

Queue in ( ) Queue matching ( ) Queue from Queue from | Queue from ( ) › Iterate, creating jobs for each item › In/from/matching keywords control how we get › This is not the full syntax description. Many ways to Queue 'foreach' 5

› 'in' keyword indicates a literal item list › List is comma and/or space separated  Items cannot contain commas or whitespace  Items are not otherwise interpreted › If list begins with '(' it continues to the closing ')'  Closing ')' must be on the first line, or on a line by itself. Queue in 6

Args = $(Item) Queue 2 in ( alpha, beta delta gamma )  Produces 8 jobs (2 for each item) Queue Queue Queue  It unrolls to this submit file: Item=alpha Step=0 Queue Step=1 Queue Item=beta Step=0 Queue... Example: Queue in 7

› Refer to these variables in your submit file  $(Process) - goes from 0 to #Jobs-1 Resets to 0 when $(Cluster) changes  $(Item) - current Item from Exists only if is not specified in Queue line  $(ItemIndex) - goes from 0 to #Items-1  $(Step) - goes from 0 to N-1 (repeatedly)  $(Row) - synonym for $(ItemIndex) Automatic Loop Variables 8

› Each glob in is matched against filenames relative to the current directory › Each glob expands to zero or more names  Globs that match nothing can produce errors or warnings › Duplicate filenames are removed.  Removal of duplicates can produce errors or warnings  Resulting set of is sorted alphabetically › Some OS's don't support directory globbing Queue matching 9

Queue 3 Item matching files (*.dat, m*) › Produces 3 jobs for each file that matches *.dat or m* (or both) › Ignores directories because of optional keyword 'files' › $(Item) holds each filename in turn Queue matching files 10

› New macro expansion: $F[pdnxq](Item)  Expands file parts from Item where p,d,n,x, and q determine which parts: p = all directories d = parent directory n = basename x = extension with leading. q = "" around result › Suppose $(Item) is "/home/work/recipe.lst" $Fp(Item) is /home/work/ $Fd(Item) is work/ $Fn(Item) is recipe $Fx(Item) is.lst $Fnx(Item) is recipe.lst $F(Item) is /home/work/recipe.lst Manipulating filenames 11

Universe = Vanilla Executable = $Fnx(Script) InitialDir = $Fd(Script) Queue Script matching files (work*/*.sh) If current directory contains : work1/Fish.sh work1/Rice.sh work2/Bacon.sh 3 jobs will be submitted with : Executable = Fish.sh InitialDir = work1/ Executable = Rice.sh InitialDir = work1/ Executable = Bacon.sh InitialDir = work2/ Example: Queue matching files 12

Universe = Vanilla Executable = $ENV(HOME)/cook.sh Queue InitialDir matching dirs * If current directory contains: Fish/ Rice/ Bacon!/ 3 jobs will be submitted with: InitialDir = Fish/ InitialDir = Rice/ InitialDir = Bacon!/ Example: Queue matching dirs 13

Queue from lines  Read and treat lines as items Queue from | lines  Execute and treat output lines as items Queue from (... ) lines  Read submit file, treating lines as items Queue from : Lines are Items 14

Args = -m $(Method) -- $(Items) Queue Method,Items from ( Braise Carrots Grill Steak Bake Bread Cake ) › Produces 3 jobs, one for each line › each line is tokenized on space and/or comma until all but last variable have a value. › Last variable gets remainder of the line. Queue from allows multiple vars 15

Queue from ( #... ) › When item list is read directly from the submit file, the usual submit file rules for comments and line- continuation apply.  Lines that begin with # are ignored.  Lines that end with \ are continued on the next line. (remember that lines are items…) Commenting out Queue items. 16

› Python style slice [start:end:step] syntax. › Only jobs which have $(ItemIndex) within the slice are submitted Queue Item in [:1] (Alpha, Beta Delta Gamma ) This slice selects only ItemIndex==0 so only Alpha jobs are submitted Slicing 17

$INT( | [, ]) $REAL( | [, ])  Lookup and evaluate it, or just evaluate. › Result is printed using Output = out_$INT(Process,%06d) MyId = $(ItemIndex) + $(Step)/ Args = -id $REAL(MyId,%.4f) -delay $INT(12*60) Output = out_ Args = -id delay 720 Formatted Numbers 18

$CHOICE( |, )  Lookup and evaluate it, or just evaluate. Then use as an index into to extract a single item. Args = $CHOICE(Step,Items) Queue 2 Executable,Items from ( Braise Carrots,Beets Grill Steak,Chicken ) Choice 19

Queue 4*5 Item in (alpha beta)  For Queue, can be an expression It can refer to command line attributes > condor_submit cook.sub num=2 > cat cook.sub... Queue $(num:0)*2 as expression 20

› Any argument with = in the middle is treated as a submit attribute assignment › Parsed before the submit file is read  Can be used in Queue or If statements > condor_submit cook.sub trial=1 > cat cook.sub Executable = cook If $(trial) Hold = $(Process) > 0 endif... Command line attributes 21

› Only if submit file has no Queue statement › It should be the last argument. because: condor_submit cook.sub -queue in *.dat › Item list can be read from standard input dir /b *.dat | condor_submit cook.sub -que from - Condor_submit -queue 22

condor_submit cook.sub -dry-run cook.ads  writes to job to cook.ads instead of Schedd  $(Cluster) is always 1  First Ad has all job attributes for ProcId=0  Remaining Ads have only attrs that differ condor_submit cook.sub -dry -  Quickly see what Queue 'foreach' will do Condor_submit -dry-run 23

condor_submit -maxjobs › Fail the submit if number of jobs would exceed condor_submit -onecluster › Fail the submit if more than one cluster would be created  For automated submission tools like DAGMan Circuit breakers 24

Any Questions? 25