{"id":19329759,"url":"https://github.com/outerbounds/metaflow-mpi","last_synced_at":"2026-06-12T06:32:01.851Z","repository":{"id":199524740,"uuid":"702742053","full_name":"outerbounds/metaflow-mpi","owner":"outerbounds","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-24T18:27:55.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-24T06:46:45.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outerbounds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-09T23:28:55.000Z","updated_at":"2024-09-24T18:27:58.000Z","dependencies_parsed_at":"2023-10-10T20:36:53.707Z","dependency_job_id":"68393624-47f2-431a-be66-ff99fde44a5d","html_url":"https://github.com/outerbounds/metaflow-mpi","commit_stats":null,"previous_names":["outerbounds/metaflow-mpi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/outerbounds/metaflow-mpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fmetaflow-mpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fmetaflow-mpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fmetaflow-mpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fmetaflow-mpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outerbounds","download_url":"https://codeload.github.com/outerbounds/metaflow-mpi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fmetaflow-mpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34232790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:29:48.203Z","updated_at":"2026-06-12T06:32:01.833Z","avatar_url":"https://github.com/outerbounds.png","language":"Python","funding_links":[],"categories":["Distributed Compute \u0026 Training"],"sub_categories":[],"readme":"### Introduction\n[MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface) is a standard framework for writing parallel applications. `metaflow-mpi` is an extension for Metaflow that allows you to dynamically form a multi-node MPI cluster using Metaflow to make it easier to run your MPI programs on any infrastructure.\n\n### Features\n- **Automatic SSH configuration**: Researchers and MPI program developers don't need to worry about how to form the MPI cluster. Metaflow's `@mpi` decorator will do this for you so you can assume nodes are able to pass information to each other.\n- **Seamless Python interface**: Many MPI programs are written in C and Fortran, making them hard to use with Python orchestration systems. Metaflow's `@mpi` exposes a set of methods shaped like `current.mpi.\u003cMETHOD\u003e` to make it easy to run MPI commands on your transient MPI cluster.\n\n### Installation\nInstall this experimental module:\n```\npip install metaflow-mpi\n```\n\nTo use the MPI integration in your Metaflow steps, you will need those steps to be run in a Docker container that has an MPI implementation - we have mainly test against [OpenMPI](https://www.open-mpi.org/), which you can build as shown [here](./examples/Dockerfile).\n\n### Getting Started\nAfter installing the module, you can import the `mpi` decorator and annotate steps with it.\nDoing this exposes four new methods on the Metaflow `current` object, which you can see described in context of the following workflow scaffolding:\n```python\n# flow.py\nfrom metaflow import FlowSpec, step, batch, mpi, current\n\nclass MPI4PyFlow(FlowSpec):\n\n    @step\n    def start(self):\n        self.next(self.multinode, num_parallel=4)\n\n    @batch(cpu=32)\n    @mpi\n    @step\n    def multinode(self):\n        # matches mpiexec command\n        current.mpi.exec(\n            args=[\"-n\", \"128\"],\n            program=\"python mpi_program.py\",\n        )\n        # others: \n            # current.mpi.run: matches mpirun command\n            # current.mpi.cc: matches mpicc command\n            # current.mpi.broadcast_file: sends file from control to all others, such as a compiled binary.\n        \n        ...\n    ...\n\nif __name__ == \"__main__\":\n    MPI4PyFlow()\n```\n\n### Examples\n\n| Directory | MPI program description |\n| :--- | ---: |\n| [Hello C](examples/c-hello/README.md) | Run a hello world C program that shows how to include, compile, and run a c program on your dynamically formed MPI cluster. |  \n| [Hello Python](examples/python-hello/README.md) | A hello world program using [mpi4py](https://mpi4py.readthedocs.io/en/stable/). |  \n| [NumPy Array Passing](examples/numpy/README.md) | An MPI program that shows you how to broadcast, scatter, gather, and implement your own all reduce routine on NumPy arrays. |  \n| [LibGrape](examples/libgrape-ldbc-graph-benchmark/README.md) | A set of workflows, each run using the [LibGrape framework](https://github.com/alibaba/libgrape-lite) from Alibaba, showing how to run highly scalable graph algorithms such as weakly connected component, pagerank, and breadth first search.|\n\n\n### License\n`metaflow-mpi` is distributed under the \u003cu\u003eApache License\u003c/u\u003e.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouterbounds%2Fmetaflow-mpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fouterbounds%2Fmetaflow-mpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouterbounds%2Fmetaflow-mpi/lists"}