Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

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

2 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."

3 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

4 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") √

5 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 =!=

6 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

7 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

8 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 √

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

10 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 ?

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

12 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" 

13 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='"'

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

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

16 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!

17 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

18 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


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

Similar presentations


Ads by Google