[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] if/endif conditionals in new/old style job transforms/routes



Hi Thomas,

Adding onto TJ's response, it's important to note that if this is for an HTCondor-CE, HTCondor-CE's default configuration does not yet support writing routes in the new syntax. We're planning on adding new configuration to support the new job router syntax in HTCondor-CE 5.1.0.

Thanks,
Brian

On 2/24/21 12:55 PM, John M Knoeller wrote:
My example is new syntax.  

The old syntax puts square brackets [] around the route, which indicates it should be parsed as  a classad.  the semicolons are required for old syntax.

So in your examples below, you have Old syntax and new syntax swapped.  

Old syntax is

ROUTE_TRANSFORM_FOO @=end
[
   eval_set_Attribute = _expression_;
]
@end

New syntax is 

ROUTE_TRANSFORM_FOO @=end

  # declare a temporary variable, this does not change the job classad
  tmp = true
  # you can refer to temp variables in if expressions
  if $(tmp)
     EVALSET Attribute _expression_
  endif

@end


-tj



From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Thomas Hartmann <thomas.hartmann@xxxxxxx>
Sent: Wednesday, February 24, 2021 11:04 AM
To: htcondor-users@xxxxxxxxxxx <htcondor-users@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] if/endif conditionals in new/old style job transforms/routes
 
Hi Tj,

thanks for the clarification :)

The example you gave - is it in old or new style syntax?  From the code
Krunow sugegsted it should be 'new style' [1], or?

---

We had a discussion here, which language/syntax styles/conventions are
suggested

The 'new syntax' marked with square brackets, with the macros tending to
be underscore_separated

```
ROUTE_TRANSFORM_SQUAREBRACKETS @=end
[
   lower_macro_foo.ad ... ;
   # eval_set_foo.ad ... ;
]
@end
```

The semicolons are not necessary but suggested, or?

---

And the 'old syntax' with something like

```
ROUTE_TRANSFORM_NOSQUAREBRACKETS @=end

   if defined Some.Ad
        CAPITALMACRO foo.ad
        # EVALSET foo.ad ...
   endif

@end
```

where the macros are normally named in capital letters in the documentation.

Job routes are equivalent/the same as job transformations - i.e., no
syntax differences?


Is this mostly correct? ;)


Cheers and thanks,
   Thomas



[1]
// Load transform rule from the config param into the xfm object.  If
                 // the config param starts with a '[' (after trimming
out leading whitespace above)
                 // then assume the rule is in the form of a new classad.
                 if ( raw_transform_text[0] == '[' ) {
...


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/