Skip to main content

An MPI wrapper for Python

Project description

Installing and Using mpiPython on Debian-based Systems

Overview

This guide outlines the steps to install and use mpiPython on Debian-based systems.

Prerequisites

  • Debian-based system (e.g., Ubuntu, Debian)
  • build-essential package installed (provides necessary compilers and tools)
  • 'mpich' the program is made to work with this, you can either have it installed by package manager or custom compiled with '--enable-shared'
  • Python >=3.10

Installation Steps

  1. Install required packages:
    sudo apt install build-essential mpich
    
  2. Install mpiPython:
    pip install mpiPython
    
  3. Compile Library
    python -m mpiPython
    

The last step is not technically needed, but because mpiPython will self compile the library if it is not present, running a program with a lot of nodes will have every node compile the shared library.

Additional Notes

  • Virtual Environments: Consider using virtual environments to isolate Python environments and avoid conflicts.

Using mpiPython

Once installed, you can import and use mpiPython in your Python scripts:

from mpiPython import MPIpy

MPI = MPIpy()
rank = MPI.Rank()
size = MPI.Size()

print("Hello from process {} out of {}".format(rank, size))

To run program:

$mpirun -n 2 python file.py

Project details


Download files

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

Source Distribution

mpipython-1.0.5.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

mpiPython-1.0.5-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file mpipython-1.0.5.tar.gz.

File metadata

  • Download URL: mpipython-1.0.5.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for mpipython-1.0.5.tar.gz
Algorithm Hash digest
SHA256 7087703c731baabdeb2a7c8c4ce5a058421d6d4586f3b200b12d0b6c0c95ed93
MD5 21f4bdd70fb22dd9e68cca0f669e2d8e
BLAKE2b-256 8264dd72e94c4fbf80dc01546c0468c15a7382b3e38bf9edcbed4ee6b8b6f089

See more details on using hashes here.

File details

Details for the file mpiPython-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: mpiPython-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for mpiPython-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 58acdedee8065774060164a48738453c0e74ef5389904307929b30f364523fe0
MD5 bef0408e5db3db1db6c208f6ee1e1f6f
BLAKE2b-256 fa2ae4fa680740e8520f2fe8c86faed5a09d1729350c8a58604b003b2c35d12a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page