Skip to content

Commit 8e13401

Browse files
author
dtyagi
committed
benchmark URI addition
1 parent 00d5d6d commit 8e13401

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

benchmarks/common/summarize_results.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def create_summary(configurations: list[str],
77
solution_metrics: list[str],
88
solution_field_data: list[str],
99
benchmark: str,
10+
benchmark_uri: str,
1011
summary_json: str) -> None:
1112

1213
"""
@@ -19,16 +20,16 @@ def create_summary(configurations: list[str],
1920
solution_metrics: List of paths to metrics JSON files
2021
solution_field_data: List of paths to solution field data files
2122
benchmark: Name of the benchmark
23+
benchmark_uri: URI of the benchmark
2224
summary_json: Output path for the summary JSON file
2325
"""
2426

2527

2628
all_summaries = []
2729
for idx, config in enumerate(configurations):
28-
print(idx, config)
2930
summary = {}
3031
summary["benchmark"] = benchmark
31-
print(solution_metrics[idx])
32+
summary["benchmark_uri"] = benchmark_uri
3233
with open(parameter_files[idx], "r") as param_file:
3334
summary["parameters"] = json.load(param_file)
3435
summary["mesh"] = f"{config}/mesh"

benchmarks/linear-elastic-plate-with-hole/Snakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ configuration_to_parameter_file = config["configuration_to_parameter_file"]
66
configurations = config["configurations"]
77
tools = config["tools"]
88
benchmark = config["benchmark"]
9+
benchmark_uri = config["benchmark_uri"]
910

1011

1112
rule all:
@@ -64,6 +65,7 @@ rule summary:
6465
--input_solution_metrics {input.metrics} \
6566
--input_solution_field_data {input.solution_field_data} \
6667
--input_benchmark {benchmark} \
68+
--input_benchmark_uri {benchmark_uri} \
6769
--output_summary_json {output.summary_json}
6870
"""
6971

benchmarks/linear-elastic-plate-with-hole/generate_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def get_configuration(file):
4646
"configuration_to_parameter_file": configuration_to_parameter_file,
4747
"configurations": list(configurations.values()),
4848
"tools": ["fenics", "kratos"],
49-
"benchmark": benchmark
49+
"benchmark": benchmark,
50+
"benchmark_uri": "https://portal.mardi4nfdi.de/wiki/Model:6775296",
5051
}
5152

5253
# Write workflow configuration file

benchmarks/linear-elastic-plate-with-hole/main.nf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ process summary{
3535
val solution_field_data
3636
val benchmark
3737
val tool
38+
val benchmark_uri
3839

3940
output:
4041
path("summary.json")
@@ -48,6 +49,7 @@ process summary{
4849
--input_solution_metrics ${solution_metrics.join(' ')} \
4950
--input_solution_field_data ${solution_field_data.join(' ')} \
5051
--input_benchmark ${benchmark} \
52+
--input_benchmark_uri ${benchmark_uri} \
5153
--output_summary_json "summary.json"
5254
5355
"""
@@ -137,6 +139,7 @@ workflow {
137139

138140
//Summarizing results
139141
def ch_benchmark = Channel.value(params.benchmark)
142+
def ch_benchmark_uri = Channel.value(params.benchmark_uri)
140143
def ch_summarize_python_script = Channel.value(file('../common/summarize_results.py'))
141144
summary(ch_summarize_python_script, \
142145
input_summary_configuration, \
@@ -145,6 +148,7 @@ workflow {
145148
input_summary_metrics, \
146149
input_summary_solution_field, \
147150
ch_benchmark, \
151+
ch_benchmark_uri, \
148152
ch_tools)
149153

150154
}

0 commit comments

Comments
 (0)