Skip to content

About

Standalone OpenMPI + gRPC worker for distributed epidemic simulation (Docker-ready)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Standalone MPI Worker

Deployable OpenMPI + gRPC worker for distributed epidemic simulation. Rank 0 serves gRPC; other ranks join the simulation and aggregate state with MPI_Allreduce. Designed to run on a separate machine from the middleware (see companion pandemic-sim orchestrator if you use the full stack).

Prerequisites

Docker (recommended)

  • Docker Desktop (Windows/macOS) or Docker Engine + Compose (Linux)

Manual build (optional)

  • CMake 3.15+
  • OpenMPI
  • gRPC and Protobuf
  • C++17 compiler

Quick start (Docker)

git clone https://github.com/diptomistry/standalone-mpi-worker.git
cd standalone-mpi-worker

Optional .env (defaults listen on 0.0.0.0:50054 with 4 ranks):

WORKER_HOST=0.0.0.0
WORKER_PORT=50054
MPI_RANKS=4
docker-compose build
docker-compose up -d
docker-compose logs -f

Expected logs include rank initialization and Server listening on 0.0.0.0:50054.

Connecting to middleware

On the machine running middleware:

middleware:
  environment:
    - WORKER_MPI=192.168.1.60:50054  # MPI worker host:port
docker-compose restart middleware

How it works

  • Container runs OpenMPI via mpirun -np MPI_RANKS ./mpi_worker <host:port>
  • Ranks participate in the simulation; results are reduced with MPI_Allreduce
  • Only rank 0 runs the gRPC server toward middleware

Layout

standalone-mpi-worker/
├── docker-compose.yml
├── Dockerfile
├── .env.example
├── CMakeLists.txt
├── proto/
│   ├── pandemic_sim.proto
│   └── CMakeLists.txt
└── workers/mpi/
    ├── CMakeLists.txt
    └── main.cpp

Security notes

  • gRPC is without TLS (fine for local lab networks). Enable TLS for anything exposed beyond a trusted network.
  • Restrict inbound TCP on WORKER_PORT to the middleware host.

About

Standalone OpenMPI + gRPC worker for distributed epidemic simulation (Docker-ready)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages