Skip to content

Commit

Permalink
PDG: Submit Graph AsJob settings added.
Browse files Browse the repository at this point in the history
Now you can specify graph job capacity and hosts mask to run it on some slow machine,
or run it on the same host and at the same time with work items tasks.

References #514.
  • Loading branch information
timurhai committed Jul 20, 2021
1 parent 7233901 commit 56d8066
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Binary file modified plugins/houdini/afanasyscheduler.hda
Binary file not shown.
15 changes: 13 additions & 2 deletions plugins/houdini/pdg/types/afanasyscheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def _getLocalAddr(self):
""" Solution from:
https://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib?page=1&tab=votes#tab-top
"""
print(addr)
return addr

def workItemResultServerAddr(self):
Expand Down Expand Up @@ -365,11 +364,23 @@ def submitAsJob(self, graph_file, node_path):
cmd += ' --toppath "%s"' % node_path

# Constuct a job:
job = self._constructJob()
job = af.Job(self['gj_name'].evaluateString())
job.setBranch(self['job_branch'].evaluateString())
job.setPriority(self['gj_priority'].evaluateInt())
job.setDependMask(self['gj_depend_mask'].evaluateString())
job.setDependMaskGlobal(self['gj_depend_mask_global'].evaluateString())
job.setHostsMask(self['gj_hosts_mask'].evaluateString())
job.setHostsMaskExclude(self['gj_hosts_mask_exclude'].evaluateString())
if self['gj_start_paused'].evaluateInt():
job.setPaused()
# Block
block = af.Block('PDG-GRAPH','hbatch')
block.setCapacity(self['gj_capacity'].evaluateInt())
# Task
task = af.Task(node_path)
task.setCommand(cmd)
task.setEnv('AF_USERNAME', cgruconfig.VARS['USERNAME'])
# Append task and block and send job
block.tasks.append(task)
job.blocks.append(block)
job.send()
Expand Down

0 comments on commit 56d8066

Please sign in to comment.