Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0ccf27c
Patched MicroSimulation Interface (#218)
Snapex2409 Feb 19, 2026
3d46a80
Implented Tasking Model (#219)
Snapex2409 Feb 25, 2026
5dc8f4f
Added Model Instancing for reduced memory consumption (#226)
Snapex2409 Feb 25, 2026
d9629fb
Bump actions/upload-artifact from 6 to 7 (#232)
dependabot[bot] Mar 2, 2026
e039299
Bump actions/download-artifact from 7 to 8 (#233)
dependabot[bot] Mar 2, 2026
1a97da9
Expose MicroSimulationInterface as public abstract base class for us…
AdityaGupta716 Mar 4, 2026
1ff9a73
Fix duplicate micro simulations for macro-points on rank boundaries (…
AdityaGupta716 Mar 5, 2026
a99ac74
Avoid division-by-zero warning in L1rel/L2rel norm calculation in ada…
PranjalManhgaye Mar 10, 2026
d45bf82
Implemented Generic Load Balancing (#228)
Snapex2409 Mar 12, 2026
d6c9cab
Add dependency checks with clear error messages on missing packages #…
AdityaGupta716 Mar 13, 2026
d1d4ef0
Add CI workflow to check test coverage (#225)
AdityaGupta716 Mar 14, 2026
8f95ce8
Bump actions/checkout from 4 to 6 (#236)
dependabot[bot] Mar 16, 2026
35e0524
Remove unused imports
IshaanDesai Mar 31, 2026
56a7875
Fix lazy initialization (#238)
IshaanDesai Apr 1, 2026
b31027a
Memory optimizations to norm calculations and a fix to lazy initializ…
IshaanDesai Apr 9, 2026
4526b6e
Fix comparison of zero values of type float32 and float64 in simulati…
IshaanDesai Apr 10, 2026
6bb2ddc
Fix load balancing configuration (#245)
IshaanDesai Apr 13, 2026
b680b89
Refactor DomainDecomposer class and add new functionality to decompos…
IshaanDesai Apr 15, 2026
3965eb9
Bump version
IshaanDesai Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Check test coverage

on:
push:
branches:
- main
- develop
pull_request:
branches:
- "*"

jobs:
coverage:
name: Run test coverage check
runs-on: ubuntu-latest
container: precice/precice:nightly
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: micro-manager

- name: Install dependencies
run: |
apt-get -qq update
apt-get -qq install python3-dev python3-venv git pkg-config
apt-get -qq install wget build-essential

- name: Load Cache OpenMPI 5
id: ompi-cache-load
uses: actions/cache/restore@v5
with:
path: ~/openmpi
key: openmpi-v5-${{ runner.os }}-build

- name: Build OpenMPI 5
if: steps.ompi-cache-load.outputs.cache-hit != 'true'
run: |
wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz
tar -xzf openmpi-5.0.5.tar.gz
cd openmpi-5.0.5
mkdir -p ~/openmpi
./configure --prefix=$HOME/openmpi
make -j$(nproc)
make install

- name: Save OpenMPI 5 to cache
if: steps.ompi-cache-load.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ~/openmpi
key: openmpi-v5-${{ runner.os }}-build

- name: Configure OpenMPI
run: |
cp -r ~/openmpi/* /usr/local/
ldconfig
which mpiexec
mpiexec --version

- name: Create a virtual environment and install Micro Manager with coverage
timeout-minutes: 6
working-directory: micro-manager
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install coverage
pip install .[sklearn,snapshot]
pip uninstall -y pyprecice

- name: Run serial unit tests with coverage
working-directory: micro-manager/tests/unit
env:
PYTHONPATH: .
run: |
. ../../.venv/bin/activate
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_micro_manager
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_micro_simulation_crash_handling
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_adaptivity_serial
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_domain_decomposition
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_interpolation
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_hdf5_functionality
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_snapshot_computation
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_micro_simulation

- name: Run tasking unit tests with coverage
working-directory: micro-manager/tests/unit
env:
PYTHONPATH: .
OMPI_ALLOW_RUN_AS_ROOT: "1"
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: "1"
run: |
. ../../.venv/bin/activate
python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_tasking

- name: Run parallel unit tests with coverage
working-directory: micro-manager/tests/unit
run: |
. ../../.venv/bin/activate
mpirun -n 2 --allow-run-as-root -x PYTHONPATH=. python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_adaptivity_parallel
mpirun -n 2 --allow-run-as-root -x PYTHONPATH=. python3 -m coverage run --parallel-mode --source=micro_manager -m unittest test_load_balancing

- name: Combine coverage data
working-directory: micro-manager/tests/unit
run: |
. ../../.venv/bin/activate
python3 -m coverage combine
python3 -m coverage report --format=total | python3 ../../check_coverage.py
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- run: pip install --upgrade build
- name: Build package
run: pyproject-build
- uses: actions/upload-artifact@v6
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist
Expand All @@ -33,7 +33,7 @@ jobs:
id-token: write
steps:
- name: Download package
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: dist
path: dist
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/run-adaptivity-tests-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,20 @@ jobs:
with:
path: micro-manager

- name: Install sudo for MPI
working-directory: micro-manager
run: |
apt-get -qq update
apt-get -qq install sudo
- name: Load Cache OpenMPI 5
id: ompi-cache-load
uses: actions/cache/restore@v5
with:
path: ~/openmpi
key: openmpi-v5-${{ runner.os }}-build
# If this fails, cache gets built in run-unit-tests

- name: Use mpi4py
uses: mpi4py/setup-mpi@v1
- name: Configure OpenMPI
run: |
cp -r ~/openmpi/* /usr/local/
ldconfig
which mpiexec
mpiexec --version

- name: Install Dependencies
working-directory: micro-manager
Expand Down Expand Up @@ -94,12 +100,12 @@ jobs:
run: |
. .venv/bin/activate
cd tests/unit
mpiexec -n 2 --allow-run-as-root python3 -m unittest test_global_adaptivity_lb.py
mpiexec -n 2 --allow-run-as-root python3 -m unittest test_load_balancing.py

- name: Run load balancing tests with 4 ranks
- name: Run load balancing unit tests with 4 ranks
timeout-minutes: 3
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
mpiexec -n 4 --allow-run-as-root --oversubscribe python3 -m unittest test_global_adaptivity_lb.py
mpiexec -n 4 --oversubscribe --allow-run-as-root python3 -m unittest test_load_balancing.py
44 changes: 44 additions & 0 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,40 @@ jobs:
run: |
apt-get -qq update
apt-get -qq install python3-dev python3-venv git pkg-config
apt-get -qq install wget build-essential

- name: Load Cache OpenMPI 5
id: ompi-cache-load
uses: actions/cache/restore@v5
with:
path: ~/openmpi
key: openmpi-v5-${{ runner.os }}-build

- name: Build OpenMPI 5
if: steps.ompi-cache-load.outputs.cache-hit != 'true'
run: |
wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz
tar -xzf openmpi-5.0.5.tar.gz
cd openmpi-5.0.5
mkdir -p ~/openmpi
./configure --prefix=$HOME/openmpi
make -j$(nproc)
make install

- name: Save OpenMPI 5 to cache
if: steps.ompi-cache.outputs.cache-hit != 'true'
id: ompi-cache-store
uses: actions/cache/save@v5
with:
path: ~/openmpi
key: openmpi-v5-${{ runner.os }}-build

- name: Configure OpenMPI
run: |
cp -r ~/openmpi/* /usr/local/
ldconfig
which mpiexec
mpiexec --version

- name: Create a virtual environment and install Micro Manager in it
timeout-minutes: 6
Expand All @@ -37,6 +71,16 @@ jobs:
cd tests/unit
python3 -m unittest test_micro_manager.py

- name: Install Micro Manager and run tasking unit test
working-directory: micro-manager
env:
OMPI_ALLOW_RUN_AS_ROOT: "1"
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: "1"
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_tasking.py

- name: Install Micro Manager and run interpolation unit test
working-directory: micro-manager
run: |
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/test-pip-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test pip installation and dependency check

on:
push:
branches:
- develop
- main
pull_request:
branches:
- "*"

jobs:
test-pip-install:
runs-on: ubuntu-latest
container: precice/precice:nightly

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: micro-manager

- name: Install dependencies
run: |
apt-get -qq update
apt-get -qq install python3-dev python3-venv git pkg-config

- name: Create a virtual environment and install Micro Manager in it
working-directory: micro-manager
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install .

- name: Run dependency check with all dependencies present
working-directory: micro-manager
run: |
. .venv/bin/activate
micro-manager-precice --test-dependencies

- name: Run dependency check with pyprecice uninstalled
working-directory: micro-manager
run: |
. .venv/bin/activate
pip uninstall -y pyprecice
if micro-manager-precice --test-dependencies; then
echo "ERROR: dependency check should have failed but passed"
exit 1
else
echo "OK: dependency check correctly reported missing pyprecice"
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dist
precice-profiling/
precice-run/
*events.json
.coverage*
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Micro Manager changelog

## v0.9.0

- Refactored `DomainDecomposer` class and added a new variant of non-uniform decomposition [#243](https://github.com/precice/micro-manager/pull/243)
- Fixed load balancing configuration `partitioning` parameter setting [#245](https://github.com/precice/micro-manager/pull/245)
- Fixed comparison of zero values of type float32 and float64 in simulation deactivation [#244](https://github.com/precice/micro-manager/pull/244)
- Optimized norm calculations and further fixed lazy initialization [#241](https://github.com/precice/micro-manager/pull/241)
- Fixed lazy initialization for ranks without (active) micro simulations [#238](https://github.com/precice/micro-manager/pull/238)
- Added coverage testing and simulation interface tests [#225](https://github.com/precice/micro-manager/pull/225)
- Added `--test-dependencies` CLI flag to check if all required dependencies are correctly installed, with clear error messages listing missing packages and how to fix them [#221](https://github.com/precice/micro-manager/pull/221)
- Added load balancing based on micro simulation solve timings [#228](https://github.com/precice/micro-manager/pull/228)
- Fixed invalid value in division warning in L1rel/L2rel adaptivity when data contains zeros [#234](https://github.com/precice/micro-manager/pull/234)
- Fixed duplicate micro simulations for macro-points on rank boundaries by filtering coordinates already claimed by lower-ranked ranks [#230](https://github.com/precice/micro-manager/pull/230)
- Exposed `MicroSimulationInterface` as a public abstract base class for user subclassing [#224](https://github.com/precice/micro-manager/pull/224)
- Added option to use compute instances to reduce memory consumption [#226](https://github.com/precice/micro-manager/pull/226)
- Added support to run micro simulations in separate processes with workers [#219](https://github.com/precice/micro-manager/pull/219)
- Added abstraction layers to micro simulations to support more features [#218](https://github.com/precice/micro-manager/pull/218)

## v0.8.0

- Conformed to naming standard in precice/tutorials [#215](https://github.com/precice/micro-manager/pull/215)
Expand Down
32 changes: 32 additions & 0 deletions check_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Script to check if test coverage is above a predefined threshold.
Reads total coverage percentage from stdin (output of coverage report --format=total).
"""

import sys

THRESHOLD = 60 # Minimum required coverage percentage


if __name__ == "__main__":
try:
coverage = int(sys.stdin.read().strip())
except ValueError:
print("Error: could not parse coverage value from stdin.")
sys.exit(1)

print("Total coverage: {}%".format(coverage))
if coverage < THRESHOLD:
print(
"Coverage {}% is below the required threshold of {}%.".format(
coverage, THRESHOLD
)
)
sys.exit(1)
else:
print(
"Coverage {}% meets the required threshold of {}%.".format(
coverage, THRESHOLD
)
)
sys.exit(0)
Loading