Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remhos experiment class #426

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,25 @@ jobs:
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run

- name: Dry run dynamic remhos/mpi with dynamic CTS ruby
run: |
./bin/benchpark experiment init --dest=remhos-ruby remhos
./bin/benchpark setup ./remhos-ruby ./ruby-system workspace/
. workspace/setup.sh
ramble \
--workspace-dir workspace/remhos-ruby/Cts-6d48f81/workspace \
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run

- name: Dry run dynamic remhos/mpi with dynamic Tioga
run: |
./bin/benchpark experiment init --dest=remhos-tioga remhos
./bin/benchpark setup remhos-tioga ./tioga-system workspace/
. workspace/setup.sh
ramble \
--workspace-dir workspace/remhos-tioga/Tioga-975af3c/workspace \
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run
82 changes: 82 additions & 0 deletions experiments/remhos/experiment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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

from benchpark.error import BenchparkError
from benchpark.directives import variant
from benchpark.experiment import Experiment
from benchpark.scaling import StrongScaling


class Remhos(
Experiment,
StrongScaling,
):

variant(
"workload",
default="remhos",
description="workload to execute",
)

variant(
"version",
default="1.0",
description="app version",
)

def compute_applications_section(self):
# TODO: Replace with conflicts clause
scaling_modes = {
"strong": self.spec.satisfies("strong=oui"),
"single_node": self.spec.satisfies("single_node=oui"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
if len(scaling_mode_enabled) != 1:
raise BenchparkError(
f"Only one type of scaling per experiment is allowed for application package {self.name}"
)

# Number of initial nodes
num_nodes = {"n_nodes": 1}

if self.spec.satisfies("single_node=oui"):
for pk, pv in num_nodes.items():
self.add_experiment_variable(pk, pv, True)
elif self.spec.satisfies("strong=oui"):
scaled_variables = self.generate_strong_scaling_params(
{tuple(num_nodes.keys()): list(num_nodes.values())},
int(self.spec.variants["scaling-factor"][0]),
int(self.spec.variants["scaling-iterations"][0]),
)
for pk, pv in scaled_variables.items():
self.add_experiment_variable(pk, pv, True)

self.add_experiment_variable(
"n_ranks", "{sys_cores_per_node} * {n_nodes}", True
)

def compute_spack_section(self):
# get package version
app_version = self.spec.variants["version"][0]

# get system config options
# TODO: Get compiler/mpi/package handles directly from system.py
system_specs = {}
system_specs["compiler"] = "default-compiler"
system_specs["mpi"] = "default-mpi"

# set package spack specs
# empty package_specs value implies external package
self.add_spack_spec(system_specs["mpi"])
# self.add_spack_spec(system_specs["blas"])

self.add_spack_spec(
self.name, [f"remhos@{app_version} +metis", system_specs["compiler"]]
)
self.add_spack_spec(
"hypre",
["[email protected] +mpi+openmp+mixedint~fortran", system_specs["compiler"]],
)
16 changes: 8 additions & 8 deletions repo/remhos/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Remhos(ExecutableApplication):



executable('run', 'remhos'+' -m {mesh}'+' -p {p}'+' -rs {rs}'+'{rp}'+' -dt {dt}'+' -tf {tf}'+' -ho {ho}' ' -lo {lo}'+' -fct {fct}', use_mpi=True)
executable('run', 'remhos'+' -m {mesh}'+' -p {p}'+' -rs {rs}'+' -rp {rp}'+' -dt {dt}'+'{tf}'+' -ho {ho}' ' -lo {lo}'+' -fct {fct}', use_mpi=True)

workload('remhos', executables=['run'])

Expand All @@ -30,30 +30,30 @@ class Remhos(ExecutableApplication):
description='number of serial refinements',
workloads=['remhos'])

workload_variable('rp', default='',
workload_variable('rp', default='1',
description='number of parallel refinements',
workloads=['remhos'])

workload_variable('dt', default='0.005',
workload_variable('dt', default='0.01',
description='time step',
workloads=['remhos'])

workload_variable('tf', default='0.8',
workload_variable('tf', default='',
description='time final',
workloads=['remhos'])

workload_variable('ho', default='1',
workload_variable('ho', default='3',
description='high order solver',
workloads=['remhos'])

workload_variable('lo', default='2',
workload_variable('lo', default='1',
description='low order solver',
workloads=['remhos'])

workload_variable('fct', default='2',
workload_variable('fct', default='1',
description='fct type',
workloads=['remhos'])
#FOM_regex=r'(?<=Merit)\s+[\+\-]*[0-9]*\.*[0-9]+e*[\+\-]*[0-9]*'
figure_of_merit("success", log_file='{experiment_run_dir}/{experiment_name}.out', fom_regex=r'(?P<done>.*)', group_name='done', units='')
figure_of_merit("mass loss", log_file='{experiment_run_dir}/{experiment_name}.out', fom_regex=r'(?P<done>.*)', group_name='done', units='')
success_criteria('valid', mode='string', match=r'.*', file='{experiment_run_dir}/{experiment_name}.out')