Skip to main content

MPI parallel map and cluster scheduling

Project description

About Pyina

The pyina package provides several basic tools to make MPI-based parallel computing more accessable to the end user. The goal of pyina is to allow the user to extend their own code to MPI-based parallel computing with minimal refactoring.

The central element of pyina is the parallel map algorithm. pyina currently provides two strategies for executing the parallel-map, where a strategy is the algorithm for distributing the work list of jobs across the availble nodes. These strategies can be used “in-the-raw” (i.e. directly) to provide the map algorithm to a user’s own mpi-aware code. Further, in pyina.mpi pyina provides pipe and map implementations (known as “easy map”) that hide the MPI internals from the user. With the “easy map”, the user can launch their code in parallel batch mode – using standard python and without ever having to write a line of MPI code.

There are several ways that a user would typically launch their code in parallel – directly with mpirun or mpiexec, or through the use of a scheduler such as torque or slurm. pyina encapsulates several of these “launchers”, and provides a common interface to the different methods of launching a MPI job.

pyina is part of pathos, a python framework for heterogeneous computing. pyina is in active development, so any user feedback, bug reports, comments, or suggestions are highly appreciated. A list of issues is located at https://github.com/uqfoundation/pyina/issues, with a legacy list maintained at https://uqfoundation.github.io/project/pathos/query.

Major Features

pyina provides a highly configurable parallel map interface to running MPI jobs, with:

  • a map interface that extends the python map standard

  • the ability to submit batch jobs to a selection of schedulers

  • the ability to customize node and process launch configurations

  • the ability to launch parallel MPI jobs with standard python

  • ease in selecting different strategies for processing a work list

Current Release

The latest released version of pyina is available at:

https://pypi.org/project/pyina

pyina is distributed under a 3-clause BSD license.

Development Version

You can get the latest development version with all the shiny new features at:

https://github.com/uqfoundation

If you have a new contribution, please submit a pull request.

Installation

pyina can be installed with pip:

$ pip install pyina

A version of MPI must also be installed. Launchers in pyina that submit to a scheduler will throw errors if the underlying scheduler is not available, however a scheduler is not required for pyina to execute.

Requirements

pyina requires:

  • python (or pypy), ==2.7 or >=3.7

  • setuptools, >=42

  • cython, >=0.29.22

  • numpy, >=1.0

  • mpi4py, >=1.3

  • dill, >=0.3.5.1

  • pox, >=0.3.1

  • pathos, >=0.2.9

More Information

Probably the best way to get started is to look at the documentation at http://pyina.rtfd.io. Also see pyina.examples and pyina.tests for a set of scripts that demonstrate the configuration and launching of mpi-based parallel jobs using the “easy map” interface. Also see pyina.examples_other for a set of scripts that test the more raw internals of pyina. You can run the tests with python -m pyina.tests. A script is included for querying, setting up, and tearing down an MPI environment, see python -m pyina for more information. The source code is generally well documented, so further questions may be resolved by inspecting the code itself. Please feel free to submit a ticket on github, or ask a question on stackoverflow (@Mike McKerns). If you would like to share how you use pyina in your work, please send an email (to mmckerns at uqfoundation dot org).

Important classes and functions are found here:

  • pyina.mpi [the map API definition]

  • pyina.schedulers [all available schedulers]

  • pyina.launchers [all available launchers]

Mapping strategies are found here:

  • pyina.mpi_scatter [the scatter-gather strategy]

  • pyina.mpi_pool [the worker pool strategy]

pyina also provides a convience script that helps navigate the MPI environment. This script can be run from anywhere with:

$ mpi_world

If may also be convienent to set a shell alias for the launch of ‘raw’ mpi-python jobs. Set something like the following (for bash):

$ alias mpython1='mpiexec -np 1 `which python`'
$ alias mpython2='mpiexec -np 2 `which python`'
$ ...

Citation

If you use pyina to do research that leads to publication, we ask that you acknowledge use of pyina by citing the following in your publication:

M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis,
"Building a framework for predictive science", Proceedings of
the 10th Python in Science Conference, 2011;
http://arxiv.org/pdf/1202.1056

Michael McKerns and Michael Aivazis,
"pathos: a framework for heterogeneous computing", 2010- ;
https://uqfoundation.github.io/project/pathos

Please see https://uqfoundation.github.io/project/pathos or http://arxiv.org/pdf/1202.1056 for further information.

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

pyina-0.2.6.tar.gz (131.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyina-0.2.6-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

pyina-0.2.6-py2-none-any.whl (47.5 kB view details)

Uploaded Python 2

File details

Details for the file pyina-0.2.6.tar.gz.

File metadata

  • Download URL: pyina-0.2.6.tar.gz
  • Upload date:
  • Size: 131.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for pyina-0.2.6.tar.gz
Algorithm Hash digest
SHA256 61ea91dd022ade0a605a53aa2ab939c0fade65e7347b099a7c992dec9d48d289
MD5 adfb0ba7bcb89a09780bfcaf63832a96
BLAKE2b-256 c28cf34f5ed54aac4537f55a2d6509190e9a96ac28a8a660abf7ab9f08fe2bcd

See more details on using hashes here.

File details

Details for the file pyina-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: pyina-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for pyina-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5cbdebaf333ec4160a0cdba2c88d175d3b4bfa5a663fc5ace6106c4a36983211
MD5 0bc2fa2d00d0efd73b715ba53b9d3b93
BLAKE2b-256 72c60ec0bb12ba5d41eb597e03797792d18ea712622c0e3495ce54a3f5c06f86

See more details on using hashes here.

File details

Details for the file pyina-0.2.6-py2-none-any.whl.

File metadata

  • Download URL: pyina-0.2.6-py2-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for pyina-0.2.6-py2-none-any.whl
Algorithm Hash digest
SHA256 483f26b62dd720d23ae02f54f8f974102bfe3ae94e8cf97fb63863cf5432f480
MD5 1ba865794bfd5c2e9fc473b408ff43dd
BLAKE2b-256 6710194e1a168f02bc9c87440fedbc25ff9c132d8ed840c76f86d4659fec3503

See more details on using hashes here.

Supported by

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