Skip to content

Files

Latest commit

aec988b · Jan 20, 2022

History

History

mpi4py

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 1, 2021
Oct 23, 2021
Dec 6, 2019
Jun 24, 2020
Dec 6, 2019
Jul 1, 2021
Jan 20, 2022
Dec 6, 2019
Dec 6, 2019
Dec 6, 2019
Dec 6, 2019
Dec 6, 2019
Oct 23, 2021
Jun 19, 2020
Dec 6, 2019
Jun 18, 2021
Jun 24, 2020
Jun 24, 2020
Dec 6, 2019
Dec 6, 2019
Dec 6, 2019
Dec 6, 2019
Jun 18, 2021
Dec 6, 2019
Oct 23, 2021

Mpi4py

Distributed parallel programs can be developed using this library (not in Python's starndard library, requires that an MPI library is installed). It follows the MPI standard to some degree, but simplifies in many places, making development easy, at the price of performace. Not to be advised when interprocess communication is fine-grained with respect to communication given (much) larger overhead when compared with C/C++ or Fortran implementations.

What is it?

  1. all_to_all.py: simple example of an all-to-all comminication.
  2. halo.py: halo exchange example, illustrates 2D cartesian grid communicator, Sendrecv.
  3. pi.py: implementation for computing pi as suggested in the slides.
  4. reduce.py: example of numpy array reduction.
  5. ring.py: implementation of a "token" send around a ring.
  6. run_ring.sh: Bash script illustrating how to run the program.
  7. ring.pbs: PBS script to run the ring program as a job.
  8. round_about.py: another ring type implementation.
  9. exchange.py: even ranks send, odd ranks receive, and vice versa.
  10. mpi_count.py: count amino acids in a long sequence, distributing the work over processes.
  11. large_dna.txt: example data file to use with mpi_count.py.
  12. mpifitness.py: application to time various MPI communications.
  13. pi_mpipool.py: illustration of using mpi.futures.MPIPoolExecutor to compute the value of pi using a quadrature method.
  14. run_pi_mpipool.sh: Bash script to run pi_mpipool.py.
  15. file_trafficker.py: file write/read test application that can run serially, multi-threaded, multi-process and MPI.
  16. mpi_io.py: timing of MPI-IO operations.
  17. translate_bin.py: translate binary to ASCII data.

How to run?

The MPIPoolExecutor applications can be run using the command below for MPICH2:

$ mpiexec -n 1 -usize 3 ./file_trafficker.py --mode mpi ...

For Intel MPI/Open MPI:

$ mpiexec -n 3 python -m mpi4py.futures ./file_trafficker.py --mode mpi ...

This would run the application with 2 worker processes.