Code Monkey home page Code Monkey logo

mpi4py-examples's Introduction

mpi4py Examples

Code examples that illustrate the use of message passing in python using the mpiy4pi library.

Forest fire simulation

From the home directory of the demo-g1 user on the head node of a CSinParallel Raspberry Pi cluster, you can get to this example like this:

cd CSinParallel/mpi4py-examples/fire

From any directory on the head node of the cluster, you can do this:

cd  ~/CSinParallel/mpi4py-examples/fire

The folder called fire has a simple simulation of the spread of a wildfire in a forest.

  • fire_sequential_once.py runs a single model of a fire starting from one tree and burning until it is out.

  • fire_sequentail_simulate.py runs many of the above single model cases for many 'trials' and averages the results to get a reasonable overall behavior of a fire at different thresholds of probability that fire will spread from one tree to another.

  • fire_mpi_simulate.py does the same simulation as the above sequential version, but uses parallelism to split the number of trials among processes.

Drug design simulation

From any directory on the head node of the cluster, you can do this:

cd  ~/CSinParallel/mpi4py-examples/drug-design

The folder called drug-design contains two versions of a simple model for matching ligands to proteins.

  • dd_mpi_dynamic.py uses dynamic load balancing, assigning a new ligand to each process after it finishes one.

  • dd_mpi_equal_chunks.py splits the work equally and assigns every process the same number of ligands.

How to experiment with each example

See separate README.md and corresponding README.pdf files inside each directory for instructions about running each example and what you can learn about particular interesting phenomena regarding how each of these examples use parallelism to improve the performance of the simulation.

mpi4py-examples's People

Contributors

libbyshoop avatar rabstolaf avatar

Stargazers

Xim avatar

Watchers

James Cloos avatar  avatar Joel Adams avatar  avatar Max Narvaez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.