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

[HTCondor-users] What is the proper way to insert expressions into classads using the python bindings?



Hi,

I have been checking out the python bindings and I have run into a problem inserting expressions into the submit classads with python bindings. In a standard condor submit file I generally specify output and log files with the $(Cluster) and $(Process) expressions in the file names so that I can link the files to the jobs.

For example:

log     = $(Cluster).$(Process).out

When I instruct condor_submit to dump the classad rather than perform the submit, I see the output line translated to:

UserLog = "/path/to/submit/directory/..log"

When using the python bindings to submit a job, the "..log" syntax generates a file named "..log". I have tried the following combinations without success:

ad["UserLog"] = "$(ClusterId).$(ProcId).log"
    - results in a file named $(ClusterId).$(ProcId).log

ad["UserLog"] = classad.ExprTree("$(ClusterId).$(ProcId).log")
    - results in "SyntaxError: Unable to parse string into a ClassAd."

ad["UserLog"] = "%s.%s.log" % (str(classad.ExprTree("ClusterId")), str(classad.ExprTree("ProcId")))
    - results in a file named  ClusterId.ProcId.out

ad["UserLog"] = "%s.%s.log" % (str(classad.ExprTree("$(ClusterId)")), str(classad.ExprTree("$(ProcId)")))
    - results in "SyntaxError: Unable to parse string into a ClassAd."

ad["UserLog"] = "%s.%s.log" % (str(classad.ExprTree("$$(ClusterId)")), str(classad.ExprTree("$$(ProcId)")))
    - results in "SyntaxError: Unable to parse string into a ClassAd."

What is the proper way to insert expressions into classads using the python bindings?

Thanks,

--
Anthony Tiradani
tiradani@xxxxxxxx
+1 630 840 4479


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature