Author Topic: Submitting with chunks via python  (Read 3002 times)


  • Jr. Member
  • **
  • Posts: 3
    • Guava Studios
Submitting with chunks via python
« on: October 13, 2008, 11:51:09 PM »
I can't, for the life of me, figure out what I'm missing in order to submit a job with chunks via the Python API. Here is my workflow:

Code: [Select]
job = {}                                                                                                                                                                   job['name']      = 'test chunk'
job['cpus']      = 10
job['priority']  = 5000
job['prototype'] = 'cmdrange'   
package = {}                                                                                                                                                               job['package']   = package
job['package']['cmdline'] = 'echo QB_FRAME_START QB_FRAME_END'
job['package']['padding'] = 0                                                                                                                                              job['package']['rangeChunkSize'] = 5                                                                                                                                       job['package']['range'] = '1-100'
job['package']['rangePartitions'] = None                                                                                                                                   
range = '1-100'
agenda = qb.genframes( range )
job['agenda']    = agenda                                                                                                                                                 
                                                                                                                                                                           submit        = []
submitted     = qb.submit( submit )                                                                                                                                       

When I submit the job, it's listed in the GUI as a normal, non-chunking job. Do I have to do something specific to the agenda genframes?

If I re-submit this job from within the GUI, chunks IS in fact on, and numchunks IS set to 5. Is my custom agenda overriding the chunks?

Adrian Graham
VFX Technical Supervisor
Guava Visual Effects

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Submitting with chunks via python
« Reply #1 on: October 14, 2008, 02:32:47 AM »
You are very close, and just need to switch out the genframes() with the genchunks() function.  See below for the documentation and examples for genchunks().

You may also want to check out the SimpleCmd documentation for quickly creating submission dialogs for your own commandline calls.

def genchunks(chunksize, range, *extraRanges, **kwargs):
Generate a work agenda (individual Work items) in frame chunks based upon range list.

    :See: `rangesplit`, `rangechunk`, `rangepartition`
    :See: `genframes`, `genchunks`, `genpartitions`
    :Change: Added "binarySort" keyword option for Qube 5.3
        chunksize : int
            number of frames per chunk
        range : str
            Frame range string (additional ranges can be specified)
                - n1                                       (ie.  1)
                - n1,n2,...   -- comma separated list      (i.e. 1,2,3,5,10)
                - n1-n2       -- n1 through n2             (i.e. 1-10)
                - n1-n2xStep  -- n1 through n2, step Step  (i.e. 1-10x2)

        binarySort : bool
            perform a binary sort (first, last, middle) on the resulting order (default=False)
    :Returns: list of Work instances. ([`Work`])
    :Example: qb.genchunks(10, '1-100')
    :Example: qb.genchunks(10, '-100--10')

Full Python API and SimpleCmd documentation can be found at: