Skip to main content

A small program for interactive sessions with MPI applications.

Project description

mpishell

A small program for interactive sessions with MPI applications.

Usage

mpishell redirects the standard input to all the jobs and decorates their standard output to make it easier to identify the job emitting them.

Consider the following example:

$ mpirun -np 2 cat
hello
hello

Here, hello was written to standard input, mpirun redirected it to the first job, running cat, which echoed the same word back. The second MPI job did nothing.

Now if one interleaves mpishell between mpirun and cat:

$ mpirun -np 2 mpishell cat
hello
0| hello
1| hello

This time, mpishell forwarded hello to the two jobs, and both reply the same word. mpishell also prepends the line with the job rank. Note that mpishell also colorizes the lines if the number of jobs is low.

mpishell can then be used with more complex programs, like bash or ipython:

$ mpirun -np 2 mpishell ipython3
0| Python 3.8.10 (default, Jun  2 2021, 10:49:15)
0| Type 'copyright', 'credits' or 'license' for more information
0| IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
0|
1| Python 3.8.10 (default, Jun  2 2021, 10:49:15)
1| Type 'copyright', 'credits' or 'license' for more information
1| IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
1|
from mpi4py import MPI
0| In [1]:
1| In [1]:
MPI.COMM_WORLD.Get_rank()
0| In [2]: Out[2]: 0
0|
1| In [2]: Out[2]: 1
1|

Finally, use CTRL+C to leave mpishell.

Installation

Simply install it with pip install mpishell.

Limitations

  • The standard input is sent to the jobs line by line, no intermediate update is sent.
  • mpishell is a bit brittle and errors may occur somewhat randomly.

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

mpishell-0.2.0.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distribution

mpishell-0.2.0-py3-none-any.whl (15.8 kB view hashes)

Uploaded Python 3

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