Skip to content

Commit 8ab2794

Browse files
add parameter conditions #215
1 parent df85dd5 commit 8ab2794

File tree

4 files changed

+104
-18
lines changed

4 files changed

+104
-18
lines changed

config/toolbox_heat/heat_plots.json

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"names": [ ],
1515
"xaxis": {
16-
"parameter": "meshes",
16+
"parameter": "mesh",
1717
"label": "mesh levels"
1818
},
1919
"yaxis": {
@@ -28,7 +28,7 @@
2828
"label": "Measures"
2929
},
3030
"aggregations":[
31-
{"column":"nb_tasks.tasks","agg":"filter:128"}
31+
{"column":"nb_tasks.tasks","agg":"filter:640"}
3232
]
3333
},
3434
{
@@ -46,7 +46,7 @@
4646
"label": "Number of tasks"
4747
},
4848
"secondary_axis": {
49-
"parameter": "meshes",
49+
"parameter": "mesh",
5050
"label": "Mesh level"
5151
},
5252
"yaxis": {
@@ -75,7 +75,7 @@
7575
"label": "Number of tasks"
7676
},
7777
"secondary_axis": {
78-
"parameter": "meshes",
78+
"parameter": "mesh",
7979
"label": "Mesh level"
8080
},
8181
"yaxis": {
@@ -104,7 +104,7 @@
104104
"label": "Number of tasks"
105105
},
106106
"secondary_axis": {
107-
"parameter": "meshes",
107+
"parameter": "mesh",
108108
"label": "Mesh level"
109109
},
110110
"yaxis": {
@@ -133,7 +133,7 @@
133133
"label": "Number of tasks"
134134
},
135135
"secondary_axis": {
136-
"parameter": "meshes",
136+
"parameter": "mesh",
137137
"label": "Mesh level"
138138
},
139139
"yaxis": {
@@ -146,6 +146,64 @@
146146
"aggregations":[
147147
{"column":"discretization","agg":"filter:P2"}
148148
]
149+
},
150+
{
151+
"title": "Performance (P3)",
152+
"plot_types": [ "stacked_bar", "grouped_bar" ],
153+
"transformation": "performance",
154+
"variables": [
155+
"Constructor_init",
156+
"Solve_algebraic-assembly",
157+
"PostProcessing_exportResults"
158+
],
159+
"names": [ ],
160+
"xaxis": {
161+
"parameter": "nb_tasks.tasks",
162+
"label": "Number of tasks"
163+
},
164+
"secondary_axis": {
165+
"parameter": "mesh",
166+
"label": "Mesh level"
167+
},
168+
"yaxis": {
169+
"label": "execution time (s)"
170+
},
171+
"color_axis":{
172+
"parameter":"performance_variable",
173+
"label":"Performance variable"
174+
},
175+
"aggregations":[
176+
{"column":"discretization","agg":"filter:P3"}
177+
]
178+
},
179+
{
180+
"title": "Speedup (P3)",
181+
"plot_types": [ "scatter" ],
182+
"transformation": "speedup",
183+
"variables": [
184+
"Constructor_init",
185+
"Solve_algebraic-assembly",
186+
"PostProcessing_exportResults"
187+
],
188+
"names": [ ],
189+
"xaxis": {
190+
"parameter": "nb_tasks.tasks",
191+
"label": "Number of tasks"
192+
},
193+
"secondary_axis": {
194+
"parameter": "mesh",
195+
"label": "Mesh level"
196+
},
197+
"yaxis": {
198+
"label": "Speedup"
199+
},
200+
"color_axis":{
201+
"parameter":"performance_variable",
202+
"label":"Performance variable"
203+
},
204+
"aggregations":[
205+
{"column":"discretization","agg":"filter:P3"}
206+
]
149207
}
150208
]
151209
}

config/toolbox_heat/thermal_bridges_case_3.json

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"executable": "feelpp_toolbox_heat",
3-
"output_directory": "{{machine.output_app_dir}}/toolboxes/heat/ThermalBridgesENISO10211/Case3",
3+
"output_directory": "{{machine.output_app_dir}}/javier_test/toolboxes/heat/ThermalBridgesENISO10211/Case3",
44
"use_case_name": "ThermalBridgesENISO10211",
55
"timeout":"0-00:10:00",
66
"memory":"250G",
@@ -9,7 +9,7 @@
99
"image": {
1010
"name":"{{machine.containers.apptainer.image_base_dir}}/feelpp-noble.sif"
1111
},
12-
"input_dir":"/input_data/",
12+
"input_dir":"/input_data",
1313
"options": [
1414
"--home {{machine.output_app_dir}}",
1515
"--bind {{machine.input_dataset_base_dir}}/{{use_case_name}}/:{{platforms.apptainer.input_dir}}",
@@ -29,11 +29,8 @@
2929
"--heat.scalability-save=1",
3030
"--repository.append.np 0",
3131
"--case.discretization {{parameters.discretization.value}}",
32-
"--heat.json.patch='{\"op\": \"replace\",\"path\": \"/Meshes/heat/Import/filename\",\"value\": \"{{platforms.{{machine.platform}}.input_dir}}/partitioning/case3/{{parameters.meshes.value}}/case3_p{{parameters.nb_tasks.tasks.value}}.json\" }'"
32+
"--heat.json.patch='{\"op\": \"replace\",\"path\": \"/Meshes/heat/Import/filename\",\"value\": \"{{platforms.{{machine.platform}}.input_dir}}/partitioning/case3/{{parameters.mesh.value}}/case3_p{{parameters.nb_tasks.tasks.value}}.json\" }'"
3333
],
34-
"env_variables":{
35-
"OMP_NUM_THREADS":"1"
36-
},
3734
"outputs": [
3835
{
3936
"filepath": "{{output_directory}}/{{instance}}/{{use_case_name}}/heat.measures/values.csv",
@@ -70,17 +67,33 @@
7067
"parameters": [
7168
{
7269
"name": "nb_tasks",
73-
"sequence": [
74-
{"tasks":128,"tasks_per_node":128,"exclusive_access":true}
70+
"zip":[
71+
{
72+
"name":"tasks",
73+
"range":{ "min":128, "max":1280, "step":128}
74+
},
75+
{
76+
"name":"exclusive_access",
77+
"repeat":{"value":true,"count":10}
78+
},
79+
{
80+
"name":"tasks_per_node",
81+
"repeat":{"value":128,"count":10}
82+
}
7583
]
7684
},
7785
{
78-
"name": "meshes",
79-
"sequence": ["M1"]
86+
"name":"mesh",
87+
"sequence":["M1","M2","M3"]
8088
},
8189
{
82-
"name": "discretization",
83-
"sequence": ["P1"]
90+
"name":"discretization",
91+
"sequence":["P1","P2","P3"],
92+
"conditions":{
93+
"P1":{ "nb_tasks.tasks":[128, 256, 384, 512, 640, 768] },
94+
"P2":{ "nb_tasks.tasks":[768, 896, 1024, 1152, 1280] },
95+
"P3":{ "nb_tasks.tasks":[640, 768, 896, 1024, 1152, 1280] }
96+
}
8497
},
8598
{
8699
"name": "solver",

src/feelpp/benchmarking/reframe/config/configParameters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class Parameter(BaseModel):
6666
mode:str = None
6767
active:Optional[bool] = True
6868

69+
conditions: Optional[dict[str,dict[str,List]]] = {}
70+
6971
linspace:Optional[Linspace] = None
7072
geomspace:Optional[Geomspace] = None
7173
range:Optional[Range] = None

src/feelpp/benchmarking/reframe/setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,19 @@ class ReframeSetup(rfm.RunOnlyRegressionTest):
180180
param_values = list(ParameterFactory.create(param_config).parametrize())
181181
exec(f"{param_config.name}=parameter({param_values})")
182182

183+
@run_after('init')
184+
def pruneParameterSpace(self):
185+
for param_config in self.app_setup.reader.config.parameters:
186+
for current_param_value, filters in param_config.conditions.items():
187+
if getattr(self,param_config.name) == current_param_value:
188+
for accept_name,accept_values in filters.items():
189+
param_path = accept_name.split(".")
190+
current_filter_value = getattr(self,param_path[0])
191+
if len(param_path) > 1:
192+
for p in param_path[1:]:
193+
current_filter_value = current_filter_value[p]
194+
self.skip_if( current_filter_value not in accept_values, f"{accept_name}={current_filter_value} not in {param_config.name}={current_param_value} condition list ({accept_values})", )
195+
183196
@run_after('init')
184197
def setupAfterInit(self):
185198
""" Sets the necessary post-init configurations"""

0 commit comments

Comments
 (0)