From 4a5164de4d5e1c0269be1ab5d3e009b421c8c999 Mon Sep 17 00:00:00 2001 From: Alicia Klinvex <64440832+amklinv-nnl@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:07:57 -0500 Subject: [PATCH 1/2] Add OpenMC benchmark OpenMC is an open source Monte Carlo transport simulation code. --- repo/openmc/application.py | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 repo/openmc/application.py diff --git a/repo/openmc/application.py b/repo/openmc/application.py new file mode 100644 index 00000000..a3907973 --- /dev/null +++ b/repo/openmc/application.py @@ -0,0 +1,70 @@ +# Copyright 2022-2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +import os +from ramble.appkit import * +from ramble.expander import Expander + + +class Openmc(SpackApplication): + '''Define OpenMC application''' + name = 'openmc' + + maintainers('klinveam') + + tags('monte carlo', 'transport', 'benchmark') + + default_compiler('gcc9', spack_spec='gcc@9.3.0') + + software_spec('impi2018', + spack_spec='intel-mpi@2018.4.274') + + software_spec('openmc', + spack_spec='openmc +mpi +openmp +ipo', + compiler='gcc9') + + required_package('openmc') + + workload('progression', executables=['set-cross-sections','execute'], inputs=['benchmark', 'cross_sections']) + workload('tally', executables=['set-cross-sections','execute'], inputs=['benchmark', 'cross_sections']) + + # Get the benchmark repo + input_file('benchmark', + url='https://github.com/jtramm/openmc_offloading_benchmarks/archive/refs/heads/main.zip', + description='HPC Benchmarking input for OpenMC') + + # Get the cross section library from https://openmc.org/official-data-libraries/ + # Version VIII.0 is missing C0, which causes a runtime error for all but the small and medium benchmarks + # We want VII.1 + input_file('cross_sections', + url='https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz', + description='Cross section library input for OpenMC') + + if Expander.expansion_str('workload_name') == 'progression': + input_dir = '{workload_input_dir}/benchmark/progression_tests/XXL/' + else: + input_dir = '{workload_input_dir}/benchmark/tally_tests/HM_large_tally/' + + # We have to use a relative path because of the fixed string length for the cross section file + executable('set-cross-sections', + template=["sed -i -e 's~~\\n../../../../inputs/openmc/{workload_name}/cross_sections/cross_sections.xml~g' -i " + input_dir + "materials.xml"], + use_mpi=False) + + executable('execute', 'openmc ' + input_dir, use_mpi=True) + + figure_of_merit('Simulation Time', log_file='{experiment_run_dir}/{experiment_name}.out', + fom_regex=r'\s*Total time in simulation\s*=\s*(?P.*)', + group_name='solve_time', units='s') + + figure_of_merit('Inactive Batch Time', log_file='{experiment_run_dir}/{experiment_name}.out', + fom_regex=r'\s*Time in inactive batches\s*=\s*(?P.*)', + group_name='inactive_time', units='s') + + figure_of_merit('Active Batch Time', log_file='{experiment_run_dir}/{experiment_name}.out', + fom_regex=r'\s*Time in active batches\s*=\s*(?P.*)', + group_name='active_time', units='s') From 7435bdbd179f2803e160d406ef34a69026989421 Mon Sep 17 00:00:00 2001 From: pearce8 Date: Wed, 24 Apr 2024 17:58:13 -0700 Subject: [PATCH 2/2] license --- repo/openmc/application.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/repo/openmc/application.py b/repo/openmc/application.py index a3907973..950a355d 100644 --- a/repo/openmc/application.py +++ b/repo/openmc/application.py @@ -1,10 +1,9 @@ -# Copyright 2022-2023 Google LLC +#!/bin/bash # -# Licensed under the Apache License, Version 2.0 or the MIT license -# , at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. +# Copyright 2023 Lawrence Livermore National Security, LLC and other +# Benchpark Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: Apache-2.0 import os from ramble.appkit import *