Petri

Master

Code to execute on master thread.

The master thread holds a thread pool and a queue of jobs. It sends jobs to worker processors and reports status on running jobs.

class pykaryote.petri.master.Master(dest_dir, status_interval=10)

Object to run on the master processor.

Master controls the queuing of jobs and the reporting of job status.

add_comparison(comparison_config_filename, sim_config_filename, comparison_name, num_runs, clean=True)

Queues a comparison to run.

add_comparisons(batch_config, num_runs=None, clean=True)

Adds comparisons from a config file.

Optionally overrides the number of runs. Config files are in .ini format, where each section is the name of a comparison. For example:

[my-comparison] comparison_config = configs/cmp.cfg simulation_config = configs/sim.cfg num_runs = 80
log(string)

Prints a string to the log.

The function could later be used to write to a log file.

shutdown()

Shuts down all processes and clear the list of queued jobs.

If a job is currently running, that job will not shutdown until it finishes.

No jobs can be sent after this call.

wait_and_log()

Starts the main loop.

Call this after adding jobs to the queue. This is the main loop of the program, which sends jobs and prints status reports.

Worker

Code to be run by worker processors.

Worker processors execute jobs and report status back to the master processor.

class pykaryote.petri.worker.Worker(data_dir, status_interval=10)

Runs jobs on worker processors and reports status back to the master.

Jobs are received from the master thread. Typical jobs include running simulations and graphing comparison batches.

graph_comparison(cmp_name, values=None, clean=True)

Aggregate and graph a completed comparison.

run()

Runs the current job.

Tags

Tags contains constants for tags used when communicating over MPI.

Table Of Contents

Previous topic

Complexes

Next topic

Analysis

This Page