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

Re: [HTCondor-users] passing parametric values to transfer_input_files



That depends on what $(args) expands to.  You can use any classad _expression_ with $STRING () in a submit file. so something like this...

MY_SCRIPT = <_expression_>("$(args)")
transfer_input_files = this,that,$STRING(MY_SCRIPT)

Where <_expression_> can use classad functions, replace, split & join.  join turns a list into a string, while split turns a string into a list.  so, for instance

MY_SCRIPT = join(",", split("$(args)"))

will change spaces between items to commas, so if 

   args = a b c

$STRING will evaluate to a,b,c and thus transfer_input_files will be

   transfer_input_files = this,that,a,b,c

Conversely.  you can formulate the items as bare list that you transform both into args and into a file transfer sublist

# submit statements
args = -file $STRING(args_from_items)
transfer_input_files = this,that,$STRING(files_from_Items)

# turn "a b c" into   "a -file b -file c"
args_from_items = join(" -file ", split("$(items)"))
# turn "a b c" into "a,b,c"
files_from_items = join(",", split("$(items)"))

queue items from {
  a b c
  d e f
}

From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Stefano Dal Pra <stefano.dalpra@xxxxxxxxxxxx>
Sent: Wednesday, February 7, 2024 8:31 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] passing parametric values to transfer_input_files
 
Hi all,

I'm using as last line of condor submit file:

queue args from somefile.txt

and I would like to specify something like:

transfer_input_files = this,that,MY_SCRIPT($(args))

where MY_SCRIPT($(args)) evaluates to: surl_1,surl_2,...,surl_x

Note that <x> is not necessarily the same number for every line in
somefile.txt
Is something like that doable?

Thanks
Stefano
_______________________________________________
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/