Giter Site home page Giter Site logo

mpih's Introduction

Warning!

This project is pretty new. It seems to be working but it probably needs further testing.

Description

$ mpih help
Usage: mpih [--socket <path>] [--help] <command> [<args>]

Description:

   'mpih' stands for 'MPI harness'. It provides
   a command-line interface for streaming data between
   machines using MPI, a widely used messaging API for
   implementing cluster-based software.

   While MPI applications are usually written in programming
   languages such as C or python, mpih allows
   users to implement MPI applications using shell scripts.

The available commands are:

   finalize  shutdown current MPI rank (stops daemon)
   help      show usage for specific commands
   init      initialize current MPI rank (starts daemon)
   rank      print rank of current MPI process
   recv      stream data from another MPI rank
   run       set up environment and run a user script
   send      stream data to another MPI rank
   size      print number of ranks in current MPI job

See 'mpih help <command>' for help on specific commands.

Synopsis

$ cat hello-world.sh
#!/bin/bash
set -eu -o pipefail

# send 'hello' messages in a ring
dest_rank=$((($MPIH_RANK + 1) % $MPIH_SIZE))
src_rank=$(($MPIH_RANK - 1))
if [ $src_rank -lt 0 ]; then
	src_rank=$(($MPIH_SIZE - 1))
fi

# send a message to a neighbour
echo "Hello, from rank $MPIH_RANK!" | mpih send $dest_rank

# receive a message from a neighbour
msg=$(mpih recv $src_rank)
echo "rank $MPIH_RANK received: '$msg'"
$ mpirun -np 10 mpih run hello-world.sh
rank 1 received: 'Hello, from rank 0!'
rank 3 received: 'Hello, from rank 2!'
rank 2 received: 'Hello, from rank 1!'
rank 4 received: 'Hello, from rank 3!'
rank 5 received: 'Hello, from rank 4!'
rank 6 received: 'Hello, from rank 5!'
rank 7 received: 'Hello, from rank 6!'
rank 9 received: 'Hello, from rank 8!'
rank 8 received: 'Hello, from rank 7!'
rank 0 received: 'Hello, from rank 9!'

Dependencies

'mpih' requires:

  • an MPI library (e.g. OpenMPI, MPICH)
  • libevent

Installing

Compile and install to your $HOME/bin (requires git and CMake):

$ git clone [email protected]:benvvalk/mpih.git
$ mkdir mpih/build
$ cd mpih/build
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..
$ make
$ make install

See also

Author

Ben Vandervalk

mpih's People

Stargazers

Sébastien Boisvert avatar Kamil Slowikowski avatar Cheng H. Lee avatar Ian Kirker avatar Pierre Lindenbaum avatar Austin Richardson avatar Shaun Jackman avatar

Watchers

Ben Vandervalk avatar  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.