job.run_all_tasks() — run all queued tasks, and return results

This runs all of the tasks in the job's queue on any available slave. When all of the tasks have finished, this functions returns a list of all the return values from the tasks, in the same order that they were submitted.

Tasks are run in a simple round-robin fashion on the available slaves. If a slave fails while running a task, that task is automatically resubmitted to another slave. If you submit more tasks than available slaves, new slaves are automatically added to the job if the job supports this functionality (e.g., sge_qsub_job()).

See also job.yield_tasks_unordered().
Example: examples/python/

from modeller import *
from modeller.parallel import task

class MyTask(task):
    """A task to read in a PDB file on the slave, and return the resolution"""
    def run(self, code):
        env = environ() = ["../atom_files"]
        mdl = model(env, file=code)
        return mdl.resolution

Example: examples/python/

from modeller import *
from modeller.parallel import *

# Load in my task from (note: needs to be in a separate Python
# module like this, in order for Python's pickle module to work correctly)
from mytask import MyTask

# Create an empty parallel job, and then add 2 slave processes running
# on the local machine
j = job()

# Run 'mytask' tasks

results = j.run_all_tasks()

print("Got model resolution: " + str(results))

Automatic builds 2017-02-17