Skip to main content

A simple MPI-based task scheduler for dynamically distributing commands across MPI processes.

Project description

PyLauncherMPI

Flake8 Lint

A simple MPI-based task scheduler for dynamically distributing commands across MPI processes.

How to use

Assuming there is access to HPC resources with MPI capabilities, PyLauncherMPI can be used to dynamically allocate tasks to processes. Tasks are defined as shell commands in a file, one line per task, like so:

taskfile

./my_program arg1 arg2 arg3
./my_program arg4 arg5 arg6
...

Two environment variables need to be speified, LAUNCHER_WORKDIR (the absolute path from which all tasks will be executed), and LAUNCHER_JOB_FILE (the path to the task file relative to LAUNCHER_WORKDIR).

The following is an example SLURM script using PyLauncherMPI.

#!/bin/bash
#SBATCH -J test_job        # Job name
#SBATCH -o test_job.o%j    # Name of stdout file
#SBATCH -e test_job.e%j    # Name of stderr error file
#SBATCH -p xyz             # Queue (partition) name
#SBATCH -N 3               # Total # of nodes
#SBATCH -n 144             # Total # of mpi tasks
#SBATCH -t 00:02:30        # Run time (hh:mm:ss)
##SBATCH --mail-user=username@address.xyz
##SBATCH --mail-type=all
#SBATCH -A allocation_name # Allocation name (req'd if you have more than 1)

source $HOME/.bashrc

micromamba activate rid_prj
# (Or use any other way to activate the environment where PyLauncherMPI is installed.)

export OMP_NUM_THREADS=1
export PYTHONPATH=$PYTHONPATH:$(pwd):$HOME/bin
export LAUNCHER_WORKDIR=/path/to/project/root/directory
export LAUNCHER_JOB_FILE=relative/path/name_of_taskfile

ibrun pylaunchermpi

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

pylaunchermpi-0.1.8.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

PyLauncherMPI-0.1.8-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pylaunchermpi-0.1.8.tar.gz.

File metadata

  • Download URL: pylaunchermpi-0.1.8.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pylaunchermpi-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f55d2f96699a5bf4daa3c4ca814467c22935a8b19d01088182234dbb4191ff7f
MD5 7b5e7b5cdc2c8cc71f0032e8b1ad1ee8
BLAKE2b-256 95df4a2f8a9c75b436b5a9b8adaa0159c657bffb71bcf5da3eb4a62435cf083e

See more details on using hashes here.

File details

Details for the file PyLauncherMPI-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for PyLauncherMPI-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 61e95083dffab81f35fbb3ada23125612e87b804134fc64712df70fedd59016e
MD5 533dc5aa64c21115d9146d2f252d351a
BLAKE2b-256 156811bd893e105ef28ebc085551e4eed357e196722fcc97a43567a3e84cd384

See more details on using hashes here.

Supported by

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