Author Topic: Python job submission, agenda using passes rather than frames  (Read 3648 times)

purest

  • Jr. Member
  • **
  • Posts: 2
Python job submission, agenda using passes rather than frames
« on: February 21, 2012, 02:22:29 PM »
Hi everyone,

I am writing a script to submit a texture prepping job to the farm.
I would like to have the job run a number of tasks, but they are not frames with frame numbers, rather passes, with pass names.

I want to do something like:

Code: [Select]
# job properties:
job = {}
job['name'] = 'my job'
job['prototype'] = 'cmdrange'

# package properties:
job['package'] = {}
job['package']['cmdline'] = '"doPrepWith QB_PASS"'
job['package']['frameCount']=6


# setting 'agenda' to get tasks
agenda = ["dif","spec","dirt","colour","matt","bmp"]
job['agenda'] = agenda

ListOfSubmittedJobs = qb.submit([job])

is this possible?


jburk

  • Administrator
  • *****
  • Posts: 493
Re: Python job submission, agenda using passes rather than frames
« Reply #1 on: March 02, 2012, 07:51:16 PM »
Yes, but you'll have to write your own backend and not use the cmdrange jobtype.

This is easier than it sounds, and you might want to check out the "helloWorld" jobtype in $QBDIR/examples/python/types/helloWorld/.  The README there has instructions on how to develop, test, and get your jobtype showing up on the farm.

Build your agenda like:

Code: [Select]
agenda = []
for i in ["dif","spec","dirt","colour","matt","bmp"]:
    work = {'name': i}
    agenda.append(work)

job['agenda'] = agenda


All agenda items must have at least the 'name' key/value defined; for cmdrange jobs, the 'name' is the frame number.

Then in your backend (the execute.py) in the executeWork() loop, when you get an agenda item from the supervisor with qb.requestwork(), the  pass name will be:

work = qb.requestwork()
passName = work['name']




purest

  • Jr. Member
  • **
  • Posts: 2
Re: Python job submission, agenda using passes rather than frames
« Reply #2 on: March 07, 2012, 04:04:26 PM »
that's great,
thanks for your help - just got it working.

R