Skip to content

Commit

Permalink
Use the $(JOB) macro for default output/error filename stem
Browse files Browse the repository at this point in the history
When running multiple dags at once or splicing dags, dagman munges
the node names for uniqueness. $(JOB) contains the munged name.
Hence we can now associate a nodename in JOBSTATE_LOG or
NODE_STATUS_FILE with its stdout and stderr.
  • Loading branch information
candlerb committed Jan 27, 2015
1 parent efbf726 commit 59f4920
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions htcondor_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ def deferred(*args, **kwargs):
if 'input' not in job.vars:
job.var(input=dag.input) # default to dag's shared input file
if 'output' not in job.vars:
job.var(output='%s.%s.out' % (dag.id, job.id))
job.var(output='$(JOB).out')
if 'error' not in job.vars:
job.var(error='%s.%s.err' % (dag.id, job.id))
job.var(error='$(JOB).err')
job.set_function_data(func, args, kwargs, dag)
return job

Expand Down Expand Up @@ -544,7 +544,9 @@ def autorun(report_hostname=True, *args, **kwargs):

# Another option is to set Executable = htcondor_dag.py in submit file.
# For this to work, when you write the dag file the functions must have
# been imported from a different module, not implicitly __main__
# been imported from a different module, not implicitly __main__. Note
# also that the executable is renamed to "condor_exec.exe", so other
# code will not see htcondor_dag.py and hence cannot import htcondor_dag
if __name__ == '__main__':
run()
sys.exit(0)
Expand Down

0 comments on commit 59f4920

Please sign in to comment.