Skip to main content

A set of tools for running simulation using vivarium on cluster.

Project description

https://badge.fury.io/py/vivarium-cluster-tools.svg Latest Version Documentation Status

Vivarium cluster tools is a python package that makes running vivarium simulations at scale on a Slurm cluster easy.

Installation

You can install this package with

pip install vivarium-cluster-tools

In addition, this tool needs the redis client. This must be installed using conda.

conda install redis

A simple example

If you have a vivarium model specifcation file defining a particular model, you can use that along side a branches file to launch a run of many simulations at once with variations in the input data, random seed, or with different parameter settings.

psimulate run /path/to/model_specification.yaml /path/to/branches_file.yaml

The simplest branches file defines a count of input data draws and random seeds to launch.

input_draw_count: 25
random_seed_count: 10

This branches file defines a set of simulations for all combinations of 25 input draws and 10 random seeds and so would run, in total, 250 simulations.

You can also define a set of parameter variations to run your model over. Say your original model specification looked something like

plugins:
  optional: ...

components:
  vivarium_public_health:
    population:
      - BasePopulation()
      - Mortality()
    disease.models:
      - SIS('lower_respiratory_infections')
  my_lri_intervention:
    components:
      - GiveKidsVaccines()

configuration:
  population:
    population_size: 1000
    age_start: 0
    age_end: 5
  lri_vaccine:
    coverage: 0.2
    efficacy: 0.8

Defining a simple model of lower respiratory infections and a vaccine intervention. You could then write a branches file that varied over both input data draws and random seeds, but also over different levels of coverage and efficacy for the vaccine. That file would look like

input_draw_count: 25
random_seed_count: 10

branches:
  lri_vaccine:
    coverage: [0.0, 0.2, 0.4, 0.8, 1.0]
    efficacy: [0.4, 0.6, 0.8]

The branches file would overwrite your original lri_vaccine configuration with each combination of coverage and efficacy in the branches file and launch a simulation. More, it would run each coverage-efficacy pair in the branches for each combination of input draw and random seed to produce 25 * 10 * 5 * 3 = 3750 unique simulations.

To read about more of the available features and get a better understanding of how to correctly write your own branches files,

Check out the docs!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vivarium_cluster_tools-2.1.0.tar.gz (80.5 kB view details)

Uploaded Source

Built Distribution

vivarium_cluster_tools-2.1.0-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file vivarium_cluster_tools-2.1.0.tar.gz.

File metadata

File hashes

Hashes for vivarium_cluster_tools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 0e1a32c0bd827517f0161fc1b43b54f5fa473657adc7195c16ab632159656e67
MD5 1e0a539c866533d49d0f728d463a322d
BLAKE2b-256 a6105dd956bf07ffe6b5bc183bbb222a8795edab93cffa01962c95c2ae6058e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vivarium_cluster_tools-2.1.0.tar.gz:

Publisher: deploy.yml on ihmeuw/vivarium_cluster_tools

Attestations:

File details

Details for the file vivarium_cluster_tools-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vivarium_cluster_tools-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e09f7ca0903224629e873cb65b74e9d42d4f6111e445077717617ffdb7f4ae6
MD5 6942d3221f875249bcb752a66f09b5ff
BLAKE2b-256 a3e487dc9df4c147f56625cff6d19f7e68e36a7dcb10cc435782782d83cc4e59

See more details on using hashes here.

Provenance

The following attestation bundles were made for vivarium_cluster_tools-2.1.0-py3-none-any.whl:

Publisher: deploy.yml on ihmeuw/vivarium_cluster_tools

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page