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

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



Hi John,
the script i was referring to should be a python script receiving $(args) appended to its sys.argv
Ideally, I would like to use in the submit file something like:

[1]
include command :Â "/bin/sh -c 'echo MY_FILELIST=$(./myscript.py $(args) )'"

and then:
[2]
transfer_input_files = this,that,$(MY_FILELIST)

I need to expand $(args) somehow to pass it in [1]. I tried using strcat but have not found a way yet.

Stefano


On 07/02/24 16:58, John M Knoeller via HTCondor-users wrote:
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/

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