Here a trivial submission file:
executable = /path/to/myexecutable
error = test.err
output = test.out
log = test.log
request_memory = 1024
request_cpus = 1
queue
myexecutable is a python executable
#!/usr/bin/env python
import htcondor
# here some code that retrieves the
# value of a descriptor, e.g. 1024 for 'request_memory'
Once the executable started by condor (e.g. via condor_submit) is there some ways to retrieve the values of the descriptors provided in the submission file ? (including the values of the expanded macros, so directly parsing the file would not do it)
I recommend not using the
htcondorpython bindings inside of an executable.I think the most straightforward is to use the
argumentscommand in the submit file to pass information from the submit file to the executable.Here is how to pass the value of
request_memoryin your example. The submit file:The executable:
Note that the variable name itself (
request_memory) is not passed, only its value, so you need to make sure the order of your arguments in the submit file matches the order you in which you catch the arguments.Update: Realized the title was asking for all descriptors.
I don't recommend this, but in the executable's directory should be a file
.job.adthat should contain all of that job's ClassAds that existed at the start of the job execution.The reason I don't recommend it is that the submit descriptors do not necessarily match the name of their corresponding ClassAd. For your example, the submit descriptor
request_memorycorresponds to the ClassAdRequestMemory.For your example, this looks like