Package park :: Package core :: Module pool

Module pool

source code

Support for job pools.

Example

Using the above, you can set up a workflow which halts when any job on the workflow improves past a certain point:

from park.core.pool import terminate, any_improved

M = mymodel
servers = ['compufans','teragrid','teragrid',local_service]
pool = [fit(M, server=s) for s in servers]
terminate(pool, when=any_improved(pool, 'chisq<20'), server=local_server)

TODO: How do we make the output of terminate be the result of the first job to

Functions
    Composite conditions
 
any_improved(jobs=[], expression=None)
Condition is satisfied when any of a set of jobs has improved to the point where expression evaluates to True.
source code
 
any_completed(jobs=[])
Condition is satisfied when any of a set of jobs are completed.
source code
 
all_improved(jobs=[], expression=None)
Condition is satisfied when any of a set of jobs has improved to the point where expression evaluates to True.
source code
 
all_completed(jobs=[])
Condition is satisfied when any of a set of jobs are completed.
source code
    Services
 
terminate(pool, **kw)
Terminate a pool of jobs when condition is satisfied.
source code
Function Details

terminate(pool, **kw)

source code 

Terminate a pool of jobs when condition is satisfied.
Standard job submission keywords are accepted, including::
    when=condition
    service=service
See `park.core.service.Proxy.submit`