Author Topic: Submitting a job with multiple dependencies  (Read 5817 times)

chardavo

  • Full Member
  • ***
  • Posts: 11
Submitting a job with multiple dependencies
« on: July 31, 2009, 04:27:29 PM »
Hi!
I have a job that needs to wait for multiple callbacks to get triggered before unblocking itself. Specifically, I needs frames of job C to be unlocked when:
- job A is done (complete-job-A)
- the corresponding frame of job B is done (complete-work-B-22)

I currently have two callbacks associated with the agenda of job C:
# For the job-on-job dependency
callback['triggers'] = 'complete-job-A'
callback['language'] = 'qube'
callback['code'] = 'unblock-self'

# For the frame-on-frame dependency:
for agendaItem in agenda:
   agendaItemName = agendaItem['name']
   agendaItemCallback['triggers'] = 'complete-work-B-%s' % (agendaItemName)
   agendaItemCallback['language'] = 'python'
   agendaItemCallback['code'] = 'import qb'
   agendaItemCallback['code'] += '%s%s%s' % ('\nqb.workunblock(\'%s:', agendaItemName, '\' % qb.jobid())')
   agendaItemCallback['code'] += '\nqb.unblock(qb.jobid())'

Obviously, the frames get unlocked when either of the callbacks get triggered: what's the proper way to have frames unlock only after BOTH triggers have been emitted?

Thanks!




Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Submitting a job with multiple dependencies
« Reply #1 on: August 03, 2009, 09:38:23 PM »
Use the job "dependency" field added in Qube 5.3.  It is a field exposed in the QubeGUI submission dialogs as of 5.3 and also has a picker dialog to help with the syntax.  List the dependecies separated by a comma (,) for the frames to wait for multiple dependencies to complete

For your particular example via python, use:

Code: [Select]
job['dependency'] = "link-complete-job-A,link-complete-work-B"

See the "What's New in Qube 5.3 for details:
    http://www.pipelinefx.com/support/docs/Whats_New-5.3.pdf


chardavo

  • Full Member
  • ***
  • Posts: 11
Re: Submitting a job with multiple dependencies
« Reply #2 on: August 04, 2009, 01:24:02 AM »
Thanks for the answer!
Does that mean I could forgo ALL the callbacks (in the python code), and only use the "dependency" field (which presumably implicitly does the same thing as the callbacks under the hood)? That would rock...