|
| 1 | +# Copyright 2022-2024 The Ramble Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 4 | +# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 5 | +# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your |
| 6 | +# option. This file may not be copied, modified, or distributed |
| 7 | +# except according to those terms. |
| 8 | + |
| 9 | +from ramble.appkit import * |
| 10 | + |
| 11 | + |
| 12 | +class Roms(ExecutableApplication): |
| 13 | + """ |
| 14 | + The Regional Ocean Modeling System (ROMS) is a free-surface, |
| 15 | + terrain-following, primitive equations ocean model widely used by the |
| 16 | + scientific community for a diverse range of applications. ROMS includes |
| 17 | + accurate and efficient physical and numerical algorithms and several |
| 18 | + coupled models for biogeochemical, bio-optical, sediment, and sea ice |
| 19 | + applications. |
| 20 | +
|
| 21 | + https://www.myroms.org/ |
| 22 | + """ |
| 23 | + |
| 24 | + name = "roms" |
| 25 | + |
| 26 | + tags("ocean") |
| 27 | + |
| 28 | + software_spec( "roms", pkg_spec="[email protected]", package_manager="spack*") |
| 29 | + software_spec( |
| 30 | + "openmpi412", pkg_spec="[email protected]", package_manager="spack*" |
| 31 | + ) |
| 32 | + |
| 33 | + input_file( |
| 34 | + "bm1", |
| 35 | + url="https://raw.githubusercontent.com/myroms/roms/refs/tags/roms-4.1/ROMS/External/roms_benchmark1.in", |
| 36 | + expand=False, |
| 37 | + description="Simple test benchmark (small)", |
| 38 | + ) |
| 39 | + input_file( |
| 40 | + "varinfo", |
| 41 | + url="https://raw.githubusercontent.com/myroms/roms/refs/tags/roms-4.1/ROMS/External/varinfo.yaml", |
| 42 | + expand=False, |
| 43 | + description="Metadata dict for benchmark inputs", |
| 44 | + ) |
| 45 | + |
| 46 | + executable("execute", "romsM {input_deck}", use_mpi=True) |
| 47 | + |
| 48 | + executable( |
| 49 | + "copy_input", "cp {input_path} {experiment_run_dir}/.", use_mpi=False |
| 50 | + ) |
| 51 | + |
| 52 | + executable( |
| 53 | + "copy_varinfo", |
| 54 | + template=[ |
| 55 | + "mkdir -p {experiment_run_dir}/ROMS/External/", |
| 56 | + "cp {varinfo} {experiment_run_dir}/ROMS/External/", |
| 57 | + ], |
| 58 | + use_mpi=False, |
| 59 | + ) |
| 60 | + |
| 61 | + workload( |
| 62 | + "benchmark_1", |
| 63 | + executables=["copy_input", "copy_varinfo", "execute"], |
| 64 | + inputs=["bm1", "varinfo"], |
| 65 | + ) |
| 66 | + |
| 67 | + workload_variable( |
| 68 | + "input_deck", |
| 69 | + default="roms_benchmark1.in", |
| 70 | + description="Name of input deck", |
| 71 | + workloads=["benchmark_1"], |
| 72 | + ) |
| 73 | + |
| 74 | + workload_variable( |
| 75 | + "input_path", |
| 76 | + default="{bm1}", |
| 77 | + description="Path to input deck", |
| 78 | + workloads=["benchmark_1"], |
| 79 | + ) |
| 80 | + |
| 81 | + success_criteria( |
| 82 | + "prints_done", |
| 83 | + mode="string", |
| 84 | + match=r".*ROMS/TOMS: DONE.*", |
| 85 | + ) |
| 86 | + |
| 87 | + figure_of_merit( |
| 88 | + "Total Time", |
| 89 | + fom_regex=r"\s*All percentages are with respect to total time =\s+(?P<time>\d+\.\d+).*", |
| 90 | + group_name="time", |
| 91 | + units="s", |
| 92 | + ) |
0 commit comments