Skip to main content

mpi list

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/.

Metadata

Release files for mpi_list 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mpi_list 0.2.1
File Size Uploaded
mpi_list-0.2.1.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mpi_list 0.2.1
File Interpreter ABI Platform
mpi_list-0.2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 29.9 kB

Release files / mpi_list-0.2.1.tar.gz

Download URL mpi_list-0.2.1.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
95513f4c564b0ea89939ab7ad6a391d9e185469d8895de2882a016dfdac419ed
BLAKE2b-256 checksum
How to use checksums
2880ef6fb5ac5c7b379c0c3077ba08c66d967eb1a2e93c1618669d922d0c797f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / mpi_list-0.2.1-py2.py3-none-any.whl

Download URL mpi_list-0.2.1-py2.py3-none-any.whl
Size 10.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c795bfb2650d919133774add6521a774be80e9aec17156181e504baa56d38f2a
BLAKE2b-256 checksum
How to use checksums
8e38d8dcfca0385dfc0ecbfc7b152416794113d04ab467db1b849b6d54e4ba83
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3

2 release files

This release

0.2.1 This release

2 release files

0.2

2 release 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