A Distributed List API over MPI
Project description
This package implements the DFM class.
The DFM is a useful abstraction for working with lists distributed over a set of MPI ranks. The acronym stands for distributed free monoid, which is just a fancy way to say it’s a list.
If you’re familiar with spark, it’s like an RDD, but only holds a list.
Quick Start
from mpi_list import Context, DFM
C = Context() # calls MPI_Init via mpi4py
# After each of the three lines below:
# 1. each rank now has 1000//C.procs consecutive numbers
# 2. each rank now has a list of strings
# 3. only numbers containing a '2' remain
dfm = C . iterates(1000) \
. map(lambda i: f"String {i}") \
. filter(lambda s: '2' in s)
if C.rank == 0:
# Caution! Uncommenting this will deadlock your program.
# Collective calls must be called by all ranks!
#print( dfm . head(10) )
pass
# This is OK, since all ranks now have 'ans'
ans = dfm.head(10)
if C.rank == 0:
print( ans )
ans = dfm . filter(lambda s: len(s) <= len("String nn")) \
. collect()
if ans is not None: # only rank 0 gets "collect"
print( ans )
Launch your program with mpirun python my_prog.py.
If you’re using a supercomputer, consider installing spindle, and then use spindle mpirun python my_prog.py.
Note
This project has been set up using PyScaffold 4.0.1. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mpi_list-0.3.tar.gz
.
File metadata
- Download URL: mpi_list-0.3.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e5ce172ad058577d675d0276ed6b36f9fb64d1321be69cbaef9a873d6fa2ac7 |
|
MD5 | 7b300e57ad2c05246eacf12c924cb238 |
|
BLAKE2b-256 | 06e5c7f43e056342547676a90208a2f7db0e5ab4fafdf3b5cf9091bc10240731 |
File details
Details for the file mpi_list-0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: mpi_list-0.3-py2.py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29b3a11c7d7022ebdc02c05a34da39f061acdc44fa8cf69d54564451a1bf862f |
|
MD5 | 67190863be4dde9fd634df8520f833cb |
|
BLAKE2b-256 | 079bee2d99393d8586152410e0e1c7b58d32523fcabefd87828a9067f6c417a8 |