Skip to main content

mpi-sppy

Optimization under uncertainty for Pyomo and other models.

Documentation is available at readthedocs and there is a paper.

Status for internal tests

pyo tracker

MPI

A recent version of MPI and a compatible version of mpi4py are needed.

Here are two methods that seem to work well for installation, at least when considering non-HPC platforms.

  1. Install OpenMPI and mpi4py using conda. Keep the order.
    conda install openmpi
    conda install mpi4py
    
  2. If you already have an existing version of MPI, it may be better compile mpi4py against it. This can be done by installing mpi4py though pip.
    pip install mpi4py
    
  3. It is also possible to automate mpi4py installation through pip as an optional dependency when installing mpi-sppy from pip or from source by adding the [mpi] extras flag.
    pip install -e .[mpi]
    
    Run the line aborve after cloning and moving to the repo root directory.

To test your installation, cd to the directory where you installed mpi-sppy (it is called mpi-sppy) and then give this command.

mpirun -n 2 python -m mpi4py mpi_one_sided_test.py

If you don't see any error messages, you might have an MPI installation that will work well. Note that even if there is an error message, mpi-sppy may still execute and return correct results. Per the comment below, the run-times may just be unnecessarily inflated.

Installing mpi-sppy

It is possible to pip install mpi-sppy; however, most users are better off getting the software from Github because it is under active development.

Citing mpi-sppy

If you find mpi-sppy useful in your work, we kindly request that you cite the following paper:

 @article{mpi-sppy,
   title={A Parallel Hub-and-Spoke System for Large-Scale Scenario-Based Optimization Under Uncertainty},
   author={Bernard Knueven and David Mildebrath and Christopher Muir and John D Siirola and Jean-Paul Watson and David L Woodruff},
   journal = {Math. Prog. Comp.},
   volume = {15}, 
   pages = {591-–619},
   year={2023}
 }

AN IMPORTANT NOTE FOR MPICH USERS ON HPC PLATFORMS

At least on some US Department of Energy (e.g., at Lawrence Livermore National Laboratory) compute clusters, users of mpi-sppy that are using an MPICH implementation of MPI may need to set the following in order for both (1) proper execution of the one-sided test referenced above and (2) rapid results when running any of the algorithms shipped with mpi-sppy:

export MPICH_ASYNC_PROGRESS=1

Without this setting, we have observed run-times increase by a factor of between 2 and 4, due to non-blocking point-to-point calls apparently being treated as blocking.

Further, without this setting and in situations with a large number of ranks (e.g., >> 10), we have observed mpi-sppy stalling once scenario instances are created.

2026 NOTICE: per-spoke solver-options now overlay the global dict

The per-spoke solver-options flags (--lagrangian-solver-options, --reduced-costs-solver-options, etc.) now overlay the global --solver-options dict for that spoke instead of replacing it. The spoke flag's keys win on the keys it names; the global flag's other keys survive. Previously the spoke flag wiped the global dict for that spoke.

In the unlikely event you relied on the spoke flag dropping a global key, re-spell every key you want in the spoke options or omit the global flag. See the solver-options section of the generic_cylinders docs for the worked example.

2022 NOTICE

There was a disruptive change on August 11, 2022 concerning how options are accessed. See the file disruptions.txt for more information. If you are a new user, this will not affect you, regardless of how you install. If you are an existing user, you should consider the disruption before updating to the latest mpi-sppy. The documentation on readthedocs probably refers to the newest version.

Download files

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

Source Distribution

mpi_sppy-0.14.0.tar.gz (682.1 kB view details)

Uploaded Source

Built Distribution

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

mpi_sppy-0.14.0-py3-none-any.whl (873.3 kB view details)

Uploaded Python 3

File details

Details for the file mpi_sppy-0.14.0.tar.gz.

File metadata

  • Download URL: mpi_sppy-0.14.0.tar.gz
  • Upload date:
  • Size: 682.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mpi_sppy-0.14.0.tar.gz
Algorithm Hash digest
SHA256 a5a2d3df936d69c1f24d0f102cbdd089412c3fe8a26069e42c330cc0b9dd4983
MD5 3a01f483b2ebcf36aeaf31b8caaff641
BLAKE2b-256 c360bd1c832d47ccfb830f2b8af1dec01489fd0b35ec9c30ebfc392be62ddab5

See more details on using hashes here.

File details

Details for the file mpi_sppy-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: mpi_sppy-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 873.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mpi_sppy-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da3815fcba4349b17d62641e5609dc76160ab97f84da9ba62aa713eea47cb387
MD5 3de67a17136659181f80336383e7b21e
BLAKE2b-256 c1afc6ae4ecdc6a10fa1fef09e72a7fbd8bae9a52a0fa9ede595e16233be861c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.0 This release

2 files

0.13.1

2 files

0.12.1

2 files

0.11.1

2 files

0.11

2 files

0.10

2 files

0.9

2 files

0.8

2 files

0.7

2 files

0.6

2 files

0.5

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page