2 nd May 2007Condor Week 2007, Madison WI1 Condor Gotchas II John Kewley Daresbury Laboratory e-Science Centre ( this time it's cynical!)

Slides:



Advertisements
Similar presentations
Escape Sequences \n newline \t tab \b backspace \r carriage return
Advertisements

Standard I/O Lesson Outline
Standard I/O Lesson CS1313 Spring Standard I/O Lesson Outline 1.Standard I/O Lesson Outline 2.Output via printf 3.Placeholders 4.Placeholders for.
John Kewley e-Science Centre CCLRC Daresbury Laboratory 28 th June nd European Condor Week Milano Condor Submissions: Gotchas.
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Introduction to C Programming
Introduction To Computers and Programming Lecture 2: Your first program Professor: Evan Korth New York University.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
CMT Programming Software Applications
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
 2003 Prentice Hall, Inc. All rights reserved. Customized by Sana Odeh for the use of this class. 1 Introduction to Computers and Programming in JAVA.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
The Class String. String Constants and Variables  There is no primitive type for strings in Java.  There is a class called String that can be used to.
Characters and Strings. Characters In Java, a char is a primitive type that can hold one single character A character can be: –A letter or digit –A punctuation.
CSc 352 Shell Scripts Saumya Debray Dept. of Computer Science
Introduction to C Programming
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
CTEC 1863 – Operating Systems Shell Scripting. CTEC F2 Overview How shell works Command line parameters –Shift command Variables –Including.
Shell Scripting Awk (part1) Awk Programming Language standard unix language that is geared for text processing and creating formatted reports but it.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
Javascript and the Web Whys and Hows of Javascript.
17/09/2004 John Kewley Grid Technology Group Introduction to Condor.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
1 Operating Systems Lecture 3 Shell Scripts. 2 Brief review of unix1.txt n Glob Construct (metacharacters) and other special characters F ?, *, [] F Ex.
An Introduction to Unix Shell Scripting
Nael Alian Introduction to PHP
John Kewley e-Science Centre CCLRC Daresbury Laboratory 28 th June nd European Condor Week Milano Heterogeneous Pools John Kewley
JavaDoc1 JavaDoc DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY July 24, 2006 by Emil Vassev & Joey Paquet revision 1.2 –
Strings The Basics. Strings can refer to a string variable as one variable or as many different components (characters) string values are delimited by.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Introduction to Bash Programming Ellen Zhang. Previous three classes What have we learnt so far ?
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 2 - Introduction to Java Applications Outline 2.1Introduction 2.2A Simple Program: Printing a.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Introduction to Unix – CS 21 Lecture 12. Lecture Overview A few more bash programming tricks The here document Trapping signals in bash cut and tr sed.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
Review, Pseudocode, Flow Charting, and Storyboarding.
GREP. Whats Grep? Grep is a popular unix program that supports a special programming language for doing regular expressions The grammar in use for software.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
CIT 590 Intro to Programming Lecture 13. Some Eclipse shortcuts CTRL + SHIFT + F – format file (proper indentation etc). Please do this before you submit.
CorrectWrongHome Desktop 100 Toolbars Best Friends MiscNerdville
22 nd Oct 2008Euro Condor Week 2008 Barcelona 1 Condor Gotchas III John Kewley STFC Daresbury Laboratory
Basic Scripting & Variables Yasar Hussain Malik - NISTE.
Program Development Cycle 1.Edit program 2.Compile program - translates it from C to machine language 3. Run/execute your program. 4. If not satisfied,
John Kewley e-Science Centre CCLRC Daresbury Laboratory 15 th March 2005 Paradyn / Condor Week Madison, WI Caging the CCLRC Compute Zoo (Activities at.
1 Objective Caml (Ocaml) Aaron Bloomfield CS 415 Fall 2005.
17-Mar-16 Characters and Strings. 2 Characters In Java, a char is a primitive type that can hold one single character A character can be: A letter or.
Today… Style, Cont. – Naming Things! Methods and Functions Aside - Python Help System Punctuation Winter 2016CISC101 - Prof. McLeod1.
Module 1 Introduction to JavaScript
Things you may not know about HTCondor
Things you may not know about HTCondor
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
TCL/TK Tool Command Language/Tool Kit.
Program Style Console Input and Output
CSE 303 Concepts and Tools for Software Development
CISC101 Reminders All assignments are now posted.
Beginning Python Programming
Introduction to Bash Programming, part 3
Introduction to C Programming
Presentation transcript:

2 nd May 2007Condor Week 2007, Madison WI1 Condor Gotchas II John Kewley Daresbury Laboratory e-Science Centre ( this time it's cynical!)

2 nd May 2007Condor Week 2007, Madison WI2 What is a "gotcha" This presentation was originally called "Hints and Tips", but I think the term "Gotchas" (aka pitfalls) is more appropriate. From Wikipedia: "A 'gotcha' is a feature of a system, a program or a programming language that works in the way it is documented, but is counter- intuitive and almost invites mistakes because it is both enticingly easy to invoke and completely unexpected and/or unreasonable in its outcome."

2 nd May 2007Condor Week 2007, Madison WI3 Outline Some "gotchas", mostly related to submit files Custom attributes Environment variables (and whitespace) The new syntax – is it a panacea? If time, also a tip for formatting with condor_status

2 nd May 2007Condor Week 2007, Madison WI4 Custom attributes How do I declare my own attributes so my jobs can distinguish between Red Hat 9 and other Linuxes? On Red Hat 9 machines add the following to its configuration: OPSYS_FLAVOUR = RH9 OPSYS_FLAVOUR = "RH9" STARTD_EXPRS = OPSYS_FLAVOUR STARTD_ATTRS = OPSYS_FLAVOUR It can then be matched with a REQUIREMENTS statement: REQUIREMENTS = (OPSYS_FLAVOUR = RH9) REQUIREMENTS = (OPSYS_FLAVOUR == RH9) REQUIREMENTS = (OPSYS_FLAVOUR == "RH9") REQUIREMENTS = (OPSYS_FLAVOUR =?= "RH9") √

2 nd May 2007Condor Week 2007, Madison WI5 Custom Attributes 1.Declare the attribute and match against it 2.Always quote non-numerics 3.“Export” the attribute by adding to STARTD_ATTRS, rather than STARTD_EXPRS 4.Remember the use of the meta operators: =?= and =!=

2 nd May 2007Condor Week 2007, Madison WI6 How do I pass ROOT=C:\ to Windows? ENVIRONMENT = ROOT=C:\ ARGUMENTS = first_param ENVIRONMENT = ROOT=C:\\\ ARGUMENTS = first_param ENVIRONMENT = ROOT=C:\\ ARGUMENTS = first_param ENVIRONMENT = ROOT=C:\ □ ARGUMENTS = first_param ENVIRONMENT = ROOT=C:\\ ARGUMENTS = first_param ENVIRONMENT = ROOT=C:\|DUMMY="" ARGUMENTS = first_param ROOT=C:ARGUMENTS = …ROOT=C:\ARGUMENTS = … ROOT=C:\\ARGUMENTS = … ROOT=C:ARGUMENTS = … √ √ ENVIRONMENT = ROOT="C:\" ARGUMENTS = first_param ? Environment variables

2 nd May 2007Condor Week 2007, Madison WI7 Environment variables How about passing more than one environment variable on Windows and/or Linux? E1=AB □E2=DE E1=AB E2=DE ENVIRONMENT = E1=AB|□E2=DEENVIRONMENT = E1=AB□|□E2=DE ENVIRONMENT = E1=AB□|E2=DEENVIRONMENT = E1=AB|E2=DE √√ CondorVersion 6.6

2 nd May 2007Condor Week 2007, Madison WI8 Environment Variables What about using newlines for better formatting when passing lots of environment variables? E1=AB □E2=DE E1=AB E2=DE ENVIRONMENT = E1=AB;□\ E2=DE ENVIRONMENT = E1=AB□;\ E2=DE ENVIRONMENT = E1=AB\ ;E2=DE ENVIRONMENT = E1=AB;\ E2=DE √

2 nd May 2007Condor Week 2007, Madison WI9 Environment variables Remember a trailing backslash will escape the newline, even if you add a trailing space or escape it with another backslash, or both. You must escape it and have a blank line afterwards. Be careful about blanks and tabs in the middle of the environment line, they may render your declarations impotent. Probably better to avoid whitespace.

2 nd May 2007Condor Week 2007, Madison WI10 Whitespace, or not We have already seen that \ escapes a newline, even with whitespace after it. What about the comment char? How about: ARGUMENTS = one two \ three ARGUMENTS = one two \ # Above 2 Args are important \ three ARGUMENTS = A B # 2 Args ?

2 nd May 2007Condor Week 2007, Madison WI11 The "new" syntax 1.Put double quotes around the entire string. 2.Use whitespace to separate arguments. To include whitespace, surround by single quotes. 3.To insert a double quote, repeat it. 4.To insert a single quote, repeat it inside a single-quoted section.

2 nd May 2007Condor Week 2007, Madison WI12 How are previous gotchas handled? The following all work as expected for passing environment variables: ENVIRONMENT = "ROOT=C:\" ENVIRONMENT = "E1=AB E2=AC" ENVIRONMENT = "E1=AB \ E2=AC" 

2 nd May 2007Condor Week 2007, Madison WI13 What? No Gotchas? How do I setup an environment variables for a single quote or a double quote? SQUOTE="'" DQUOTE="\"" DQUOTE='"' # in old Syntax ENVIRONMENT = SQUOTE="'" ENVIRONMENT = DQUOTE="\"" ENVIRONMENT = DQUOTE='"'

2 nd May 2007Condor Week 2007, Madison WI14 SQUOTE # New Syntax # Trying to produce SQUOTE="'" ENVIRONMENT = "SQUOTE=""''''"""

2 nd May 2007Condor Week 2007, Madison WI15 DQUOTE # New Syntax # Trying to produce DQUOTE='"' ENVIRONMENT = "DQUOTE=''''""''''" # Trying to produce DQUOTE="\"" ENVIRONMENT = "DQUOTE=""\"""""

2 nd May 2007Condor Week 2007, Madison WI16 In Summary 1.Good writing is all about spelling, grammar and punctuation. The same is true with condor configuration and submit files. 2.Use the new arguments/environment syntax!

2 nd May 2007Condor Week 2007, Madison WI17 Tip for condor_status $ condor_status -f "%-6s" Arch -f "%-7s" OpSys \ -f " %-12s\n" OPSYS_FLAVOUR | sort | uniq -c 1 1 INTEL LINUX Gentoo 1 INTEL LINUX Mandrake10 2 INTEL LINUX RH80 3 INTEL LINUX RH9 2 INTEL LINUX SUSE80 6 INTEL LINUX SUSE90 5 INTEL LINUX WBL 1 INTEL WINNT40INTEL WINNT50INTEL WINNT51

2 nd May 2007Condor Week 2007, Madison WI18 $ condor_status -f "%-6s" Arch -f "%-7s" OpSys \ -f " %-12s" OPSYS_FLAVOUR -f "\n" OpSys | sort | uniq -c 1 1 INTEL LINUX Gentoo 1 INTEL LINUX Mandrake10 2 INTEL LINUX RH80 3 INTEL LINUX RH9 2 INTEL LINUX SUSE80 6 INTEL LINUX SUSE90 5 INTEL LINUX WBL 1 INTEL WINNT40 1 INTEL WINNT50 1 INTEL WINNT51 Tip for condor_status