Skip to content

Commit 80f9144

Browse files
committed
update Readme and enforce strict channel priority in github ci
1 parent 3f5bd14 commit 80f9144

File tree

2 files changed

+59
-6
lines changed

2 files changed

+59
-6
lines changed

.github/workflows/run-benchmark.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
activate-environment: model-validation
3333
use-mamba: true
3434

35+
- name: Set strict channel priority
36+
run: conda config --set channel_priority strict
37+
3538
- name: Update environment
3639
run: mamba env update -n model-validation -f environment_benchmarks.yml
3740

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,59 @@
11
# Infinite plate with hole benchmark in FEniCSx
22

3-
This directory contains:
3+
## Problem Definition
44

5-
* `Snakefile`: A snakefile to run the benchmark.
6-
* `run_simulation.py`: The main script to run the benchmark.
7-
* `create_input_files.py`: A script to create the input files for the benchmark.
8-
* `environment.yml`: A conda environment file to create the environment needed to run the benchmark.
9-
* `parameters_*.json`: A set of parameters files for the benchmark. Each file will create a new instance of the benchmark with different parameters.
5+
See the [documentation](../../docs/benchmarks/linear%20elasticity/index.md) for a detailed problem definition and mathematical formulation.
6+
7+
## Running the Benchmark
8+
9+
1. **Generate Configuration Files**
10+
11+
Before running the benchmark, generate the configuration files using:
12+
```bash
13+
python generate_config.py
14+
```
15+
This script creates a workflow_config.json that defines what configurations are computed (in the starndard case one for each parameter_file_*.json) and what tools are used.
16+
17+
2. **Run the Benchmark**
18+
19+
The benchmark is managed via Snakemake. You can run all tools or specify a subset (e.g., only fenics) by editing the generated config or passing parameters via the command line:
20+
```bash
21+
snakemake --use-conda --cores all
22+
```
23+
To run only a specific tool or specific configuration (e.g. for testing), update the config file or use:
24+
```bash
25+
snakemake --use-conda --cores all --config tools=fenics
26+
```
27+
28+
3. **Collect Provenance**
29+
30+
After running, provenance data is collected automatically and stored in .snakemake. If you want to use the reporter plugin ([metadata4ing](https://github.com/izus-fokus/snakemake-report-plugin-metadata4ing)) to generate an ROCrate, call snakemake again (make sure the plugin is added to the environment):
31+
```bash
32+
snakemake --use-conda --cores all --reporter metadata4ing
33+
```
34+
Output and provenance files are stored in the `snakemake_results/` directory and as zipped archives.
35+
36+
## Hierarchical Structure of Snakefiles
37+
38+
The workflow is organized hierarchically:
39+
- The main `Snakefile` orchestrates the benchmark and includes sub-workflows for each tool.
40+
- Each tool (e.g., fenics) has its own rules and output structure.
41+
42+
### Inputs
43+
44+
Each tool's rule must accept:
45+
- A parameter/configuration file (e.g., `parameters_*.json`) specifying geometry, material properties, boundary conditions, and solver settings.
46+
- A mesh file (*.msh from gmsh) generated with the rule generate_mesh.
47+
48+
### Outputs
49+
50+
Each tool's rule must produce:
51+
- **Solution field results**: This zip-file should include all the data used to plot the output like strains, stresses or displacements of the solution field.
52+
- **Metrics file**: JSON-File summarizing key metrics (e.g., max Mises stress at Gauss points or maximum mises stress obtained when projecting to the nodes).
53+
- All output files should be placed in the designated results directory (e.g., `snakemake_results/{benchmark}/{tool}/solution_field_data_{configuration}.zip`). `snakemake_results/` is generated from the level where snakemake is executed, but this directory is then zipped.
54+
55+
To add another simulation tool:
56+
- Create a new subdirectory for the tool.
57+
- Create a new Snakefile with at least one rule that produces the outputs (metrics and solution fields)
58+
- Ensure the rule accepts the standardized parameter file and mesh/input files.
59+
- Update the main `Snakefile` to include the new tool's rules.

0 commit comments

Comments
 (0)