Version 3.12
Version 5.0.3
While any MPI implementation should work, here are my recommended options.
For macOS, you can install Open MPI using Homebrew:
brew install openmpi
For Linux, you may need to either install Open MPI from source or check your distribution’s repositories. For example, on Ubuntu/Debian, MPICH is readily available:
sudo apt install mpich
For Windows, Microsoft MPI is required. Follow the Microsoft MPI installation guide for instructions.
This project uses Poetry for dependency management. Please refer to the offical docs for installation details.
# install dependencies
poetry install
# activate the virtual environment
poetry shell
You're all set! You can now run examples, tests, and other code from this repository.
python examples/run_ga_example.py
python examples/run_optimized_example.py
mpiexec -n 4 python examples/run_ga_mpi_example.py
pytest -m functional
mpiexec -n 4 python -m pytest -m mpi
The 8
is an arbitrary value and you can use as many parallel environments as many your MPI implementation detects.
for cores in {1..8}; do echo "Running with $cores cores"; time mpiexec -n $cores python benchmark/hyperparameter_search.py; done