Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions MC/bin/o2_dpg_workflow_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,12 @@ def __init__(self, workflowfile, args, jmax=100):
self.do_early_file_removal = True
self.file_removal_candidates = filegraph_expand_timeframes(filegraph_data, self.timeframeset, self.full_target_namelist)

def apply_global_env(self, environ_dict):
for e in self.globalinit['env']:
if environ_dict.get(e, None) == None:
value = self.globalinit['env'][e]
actionlogger.info("Applying global environment from init section " + str(e) + " : " + str(value))
environ_dict[e] = str(value)

def perform_early_file_removal(self, taskids):
"""
Expand Down Expand Up @@ -1259,9 +1265,13 @@ def submit(self, tid, nice):
if self.workflowspec['stages'][tid].get('env')!=None:
taskenv.update(self.workflowspec['stages'][tid]['env'])

# envfilename = "taskenv_" + str(tid) + ".json"
# with open(envfilename, "w") as file:
# json.dump(taskenv, file, indent=2)
# add global workflow environment
self.apply_global_env(taskenv)

if os.environ.get('PIPELINE_RUNNER_DUMP_TASKENVS') != None:
envfilename = "taskenv_" + str(tid) + ".log"
with open(envfilename, "w") as file:
json.dump(taskenv, file, indent=2)

p = psutil.Popen(['/bin/bash','-c',c], cwd=workdir, env=taskenv)
try:
Expand Down