@@ -210,28 +210,56 @@ class OpenfoamOrg(SpackApplication):
210
210
211
211
log_prefix = os .path .join (Expander .expansion_str ('experiment_run_dir' ), 'log.' )
212
212
213
+ config_file = "{experiment_run_dir}/openfoam_config"
214
+
213
215
figure_of_merit ('Number of cells' , log_file = (log_prefix + 'snappyHexMesh' ),
214
216
fom_regex = r'Layer mesh\s+:\s+cells:(?P<ncells>[0-9]+)\s+.*' ,
215
217
group_name = 'ncells' , units = '' )
216
218
217
- figure_of_merit ('snappyHexMesh Time ({n_ranks_hex} ranks) ' , log_file = (log_prefix + 'snappyHexMesh' ),
219
+ figure_of_merit ('snappyHexMesh Time' , log_file = (log_prefix + 'snappyHexMesh' ),
218
220
fom_regex = r'Finished meshing in = (?P<mesh_time>[0-9]+\.?[0-9]*).*' ,
219
221
group_name = 'mesh_time' , units = 's' )
220
222
221
- figure_of_merit ('simpleFoam Time ({n_ranks} ranks)' , log_file = (log_prefix + 'simpleFoam' ),
223
+ figure_of_merit ('snappyHexMesh Ranks' , log_file = config_file ,
224
+ fom_regex = r'snappyHexMesh ranks: (?P<ranks>[0-9]+)' ,
225
+ group_name = 'ranks' , units = '' )
226
+
227
+ figure_of_merit ('simpleFoam Time' , log_file = (log_prefix + 'simpleFoam' ),
222
228
fom_regex = r'\s*ExecutionTime = (?P<foam_time>[0-9]+\.?[0-9]*).*' ,
223
229
group_name = 'foam_time' , units = 's' )
224
230
225
- figure_of_merit ('potentialFoam Time ({n_ranks} ranks) ' , log_file = (log_prefix + 'potentialFoam ' ),
231
+ figure_of_merit ('simpleFoam Time' , log_file = (log_prefix + 'simpleFoam ' ),
226
232
fom_regex = r'\s*ExecutionTime = (?P<foam_time>[0-9]+\.?[0-9]*).*' ,
227
233
group_name = 'foam_time' , units = 's' )
228
234
235
+ figure_of_merit ('simpleFoam Ranks' , log_file = config_file ,
236
+ fom_regex = r'simpleFoam ranks: (?P<ranks>[0-9]+)' ,
237
+ group_name = 'ranks' , units = '' )
238
+
239
+ figure_of_merit ('potentialFoam Time' , log_file = (log_prefix + 'potentialFoam' ),
240
+ fom_regex = r'\s*ExecutionTime = (?P<foam_time>[0-9]+\.?[0-9]*).*' ,
241
+ group_name = 'foam_time' , units = 's' )
242
+
243
+ figure_of_merit ('potentialFoam Ranks' , log_file = config_file ,
244
+ fom_regex = r'potentialFoam ranks: (?P<ranks>[0-9]+)' ,
245
+ group_name = 'ranks' , units = '' )
246
+
229
247
success_criteria ('snappyHexMesh_completed' , mode = 'string' , match = 'Finalising parallel run' ,
230
248
file = '{experiment_run_dir}/log.snappyHexMesh' )
231
249
232
250
success_criteria ('simpleFoam_completed' , mode = 'string' , match = 'Finalising parallel run' ,
233
251
file = '{experiment_run_dir}/log.simpleFoam' )
234
252
253
+ def _prepare_analysis (self , workspace , app_inst = None ):
254
+ conf_path = self .expander .expand_var (self .config_file )
255
+
256
+ with open (conf_path , "w+" ) as f :
257
+ hex_ranks = self .expander .expand_var ("{n_ranks_hex}" )
258
+ simple_ranks = self .expander .expand_var ("{n_ranks}" )
259
+ f .write (f"snappyHexMesh ranks: { hex_ranks } \n " )
260
+ f .write (f"simpleFoam ranks: { simple_ranks } \n " )
261
+ f .write (f"potentialFoam ranks: { simple_ranks } \n " )
262
+
235
263
def _define_commands (self , exec_graph ):
236
264
export_prefix = self .expander .expand_var_name ('export_prefix' )
237
265
export_vars = self .expander .expand_var_name ('export_variables' ).split (',' )
0 commit comments