Skip to content

Allow micro simulations to pass local data for adaptivity calculation only #1019

Allow micro simulations to pass local data for adaptivity calculation only

Allow micro simulations to pass local data for adaptivity calculation only #1019

Workflow file for this run

name: Run unit tests for user-side functions
on:
push:
branches:
- main
- develop
pull_request:
branches:
- "*"
jobs:
unit_tests:
runs-on: ubuntu-latest
container: precice/precice:nightly
steps:
- 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.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
working-directory: micro-manager
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install .
- name: Run micro_manager unit test
working-directory: micro-manager
run: |
. .venv/bin/activate
pip uninstall -y pyprecice
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: |
. .venv/bin/activate
pip install .[sklearn]
pip uninstall -y pyprecice
cd tests/unit
python3 -m unittest test_interpolation.py
- name: Install Micro Manager and run micro simulation crash unit test
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_micro_simulation_crash_handling.py
- name: Install Micro Manager and run HDF5 read and write unit tests
working-directory: micro-manager/
run: |
. .venv/bin/activate
pip install .[snapshot]
pip uninstall -y pyprecice
cd tests/unit
python3 -m unittest test_hdf5_functionality.py
- name: Install Micro Manager and run snapshot_computation unit tests
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_snapshot_computation.py