MatEnsemble
MatEnsemble is a framework to build, orchestrate, and asynchronously manage extremely scalable adaptive-learning workflows, especially targeted for compute-intensive AI-driven high-throughput and ensemble-driven materials modeling simulations (e.g., atomistic modeling, Phase-Field, etc.) as efficiently as possible.
While it can in general run on your personal Mac/Linux workstation and orchestrate arbitrary python callables, shell commands with explicit resource and dependency-aware execution graphs from a single python workflow driver process, MatEnsemble shines with user-defined autonomous strategic execution of large batches of adaptively and hierarchically-scheduled tasks on HPC systems, specifically on Peta and Exascale computing facilities, e.g., Perlmutter, Frontier, Aurora etc.
Here is an example which defines a simple MPI chore, adds ten independent instances of it to a pipeline, and submits the workflow.
pipe = Pipeline()
# register a function the MatEnsemble
@pipe.chore(num_tasks=10, cores_per_task=1, gpus_per_task=0, mpi=True)
def mpi_hello_world():
size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()
print(f"Hello World! I am process {rank} of {size} on {name}.")
# adding 10 mpi_hello_world chores to the pipeline
for _ in range(10):
mpi_hello_world()
pipe.submit(log_delay=1)
Rather than launching the MPI jobs directly, you describe the work declaratively with the @pipe.chore decorator and enqueue each invocation. MatEnsemble then schedules the chores through Flux, allocating the requested resources (num_tasks, CPU cores, GPUs, and MPI support) for each job.
Hs, GPUs, and MPI support) for each job.
Installation
To install MatEnsemble you can follow our documentation which will walk you through manual installation for different systems, and also give many helpful tips for working with containers
You can also use our installation script to install MatEnsemble along side the MCP server with:
curl -fsSL https://raw.githubusercontent.com/Q-CAD/MatEnsemble/refs/heads/main/install.sh | bash
Minimal Code Example
MatEnsemble workflows are ordinary Python scripts (and/or shell commands) which can be use to:
- define resource-aware chores
- Pass chore outputs into later chores to create a DAG
- Add a strategy when the workflow should decide what to launch next while the campaign is already running.
from matensemble.pipeline import Pipeline
from matensemble.model import Resources
from matensemble.chore import ChoreSpec
pipe = Pipeline()
md_resources = dict(num_tasks=128, cores_per_task=1, gpus_per_task=4, mpi=True)
analysis_resources = dict(num_tasks=1, cores_per_task=8)
@pipe.chore(name="simulate", **md_resources)
def simulate(candidate):
# Run LAMMPS, DFT, phase-field, or another science application here.
return {"trajectory": "traj.dump", "candidate": candidate}
@pipe.chore(name="score", **analysis_resources)
def score(simulation):
# Analyze the completed simulation and propose the next high-value sample.
return {
"uncertainty": 0.18,
"next_candidate": {"temperature": 1750, "composition": "SiO2"},
}
@pipe.strategy(bolo_list=["score"], **analysis_resources)
def adapt(report):
if report["uncertainty"] < 0.05:
return None
return ChoreSpec(
args=(report["next_candidate"],),
kwargs={},
resources=Resources(**md_resources),
qualname="simulate",
)
seed = {"temperature": 1600, "composition": "SiO2"}
trajectory = simulate(seed)
score(trajectory) # OutputReference creates the simulate -> score DAG edge.
future = pipe.submit(log_delay=10)
results = future.result()
Publications
- Bagchi, Soumendu, et al. "Towards “on-demand” van der Waals epitaxy with adaptive ensemble sampling atomistic workflows." Digital Discovery (2026) https://doi.org/10.1039/d6dd00049e.
- Morelock, Ryan, et al. "pyRMG: A framework for high-throughput, large-cell DFT calculations on supercomputers." The Journal of Chemical Physics 164.5 (2026).
Metadata
Release files for matensemble 0.5.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| matensemble-0.5.9.tar.gz | 70.1 kB | Without provenance | Details for matensemble-0.5.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matensemble-0.5.9-py3-none-any.whl | Python 3 | none | any | Details for matensemble-0.5.9-py3-none-any.whl |
Total release size: 156.4 kB
Release files / matensemble-0.5.9.tar.gz
| Download URL | matensemble-0.5.9.tar.gz |
|---|---|
| Size | 70.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac7b68e482f34b7d6194546c1cf8fc9810ed868fcac43e6b401e23ad64d7534a
|
|
BLAKE2b-256 checksum How to use checksums |
ecaf25cddb7c1e3441e735db41539c1093ec90bb0ce379426b1faf15003f11cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / matensemble-0.5.9-py3-none-any.whl
| Download URL | matensemble-0.5.9-py3-none-any.whl |
|---|---|
| Size | 86.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9b2c688257b0441b3e0530fce3064a1c6eda1b6660e9c19b7713fdb7506134d
|
|
BLAKE2b-256 checksum How to use checksums |
7fb056d79f0b763a88bf60278d47d5001f144772d9875f4a058debc78754df8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for matensemble 0.5.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.