Skip to content

Commit

Permalink
Merge branch 'develop' into configs/tamu
Browse files Browse the repository at this point in the history
  • Loading branch information
pearce8 authored May 17, 2024
2 parents 193b56f + 4770efb commit e48400c
Show file tree
Hide file tree
Showing 39 changed files with 806 additions and 177 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
license: ${{ steps.filter.outputs.license }}

steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # @v2
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # @v2
if: ${{ github.event_name == 'push' }}
with:
fetch-depth: 0
Expand All @@ -35,6 +35,7 @@ jobs:
filters: |
docs:
- '.github/**'
- 'bin/**'
- 'docs/**'
- 'README.rst'
style:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b

- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
verify-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b

- name: Set up Python 3.11
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docs
sphinx==7.2.6
sphinx==7.3.7
sphinx-rtd-theme==2.0.0
codespell==2.2.6
pandas==2.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/requirements/style.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==24.4.0
black==24.4.2
flake8==7.0.0
isort==5.13.2
codespell==2.2.6
4 changes: 2 additions & 2 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
sudo apt-get remove -y gcc-13
- name: Checkout Benchpark
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b

- name: Add needed Python libs
run: |
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Upload Workspace Archive as CI Artifact
if: always()
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: workspace-archive
path: './workspace/saxpy/openmp/nosite-x86_64/workspace/archive/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b

- name: Set up Python 3.11
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
Expand Down
118 changes: 72 additions & 46 deletions bin/benchpark
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def source_location():

def benchpark_list(subparsers, actions_dict):
list_parser = subparsers.add_parser(
"list", help="List available benchmarks and systems"
"list", help="List available experiments, systems, and modifiers"
)
list_parser.add_argument("sublist", nargs="?")
actions_dict["list"] = benchpark_list_handler
Expand All @@ -84,8 +84,7 @@ def benchpark_benchmarks():
benchmarks = []
experiments_dir = source_dir / "experiments"
for x in os.listdir(experiments_dir):
for y in os.listdir(experiments_dir / x):
benchmarks.append(f"{x}/{y}")
benchmarks.append(f"{x}")
return benchmarks


Expand All @@ -94,18 +93,30 @@ def benchpark_experiments():
experiments = []
experiments_dir = source_dir / "experiments"
for x in os.listdir(experiments_dir):
experiments.append(f"{x}")
for y in os.listdir(experiments_dir / x):
experiments.append(f"{x}/{y}")
return experiments


def benchpark_systems():
source_dir = source_location()
systems = []
for x in os.listdir(source_dir / "configs"):
systems.append(x)
if not (
os.path.isfile(os.path.join(source_dir / "configs", x)) or x == "common"
):
systems.append(x)
return systems


def benchpark_modifiers():
source_dir = source_location()
modifiers = []
for x in os.listdir(source_dir / "modifiers"):
modifiers.append(x)
return modifiers


def benchpark_get_tags():
f = source_location() / "tags.yaml"
tags = []
Expand All @@ -132,36 +143,44 @@ def benchpark_list_handler(args):
source_dir = source_location()
sublist = args.sublist
benchmarks = benchpark_benchmarks()
experiments = benchpark_experiments()
systems = benchpark_systems()
modifiers = benchpark_modifiers()

if sublist == None:
print("Benchmarks/ProgrammingModel:")
print("Experiments:")
for experiment in experiments:
print(f"\t{experiment}")
print("Systems:")
for system in systems:
print(f"\t{system}")
elif sublist == "benchmarks":
print("Benchmarks:")
for benchmark in benchmarks:
print(f"\t{benchmark}")
elif sublist == "experiments":
print("Experiments:")
for experiment in experiments:
print(f"\t{experiment}")
elif sublist == "systems":
print("Systems:")
for system in systems:
print(f"\t{system}")
elif sublist == "modifiers":
print("Modifiers:")
for modifier in modifiers:
print(f"\t{modifier}")
else:
if sublist == "benchmarks":
print("Benchmarks:")
for benchmark in benchmarks:
print(f"\t{benchmark}")
else:
if sublist == "systems":
print("Systems:")
for system in systems:
print(f"\t{system}")
else:
raise ValueError(
f'Invalid benchpark list "{sublist}" - must choose [benchmarks], [systems], or leave empty'
)
raise ValueError(
f'Invalid benchpark list "{sublist}" - must choose [experiments], [systems], [modifiers] or leave empty'
)


def benchpark_check_benchmark(arg_str):
benchmarks = benchpark_benchmarks()
found = arg_str in benchmarks
if not found:
out_str = f'Invalid benchmark/experiment "{arg_str}" - must choose one of: '
out_str = f'Invalid benchmark "{arg_str}" - must choose one of: '
for benchmark in benchmarks:
out_str += f"\n\t{benchmark}"
raise ValueError(out_str)
Expand All @@ -172,7 +191,7 @@ def benchpark_check_experiment(arg_str):
experiments = benchpark_experiments()
found = arg_str in experiments
if not found:
out_str = f'Invalid benchmark/experiment "{arg_str}" - must choose one of: '
out_str = f'Invalid experiment (benchmark/ProgrammingModel) "{arg_str}" - must choose one of: '
for experiment in experiments:
out_str += f"\n\t{experiment}"
raise ValueError(out_str)
Expand Down Expand Up @@ -201,13 +220,26 @@ def benchpark_check_tag(arg_str):
return found


def benchpark_check_modifier(arg_str):
modifiers = benchpark_modifiers()
found = arg_str in modifiers
if not found:
out_str = f'Invalid modifier "{arg_str}" - must choose one of: '
for modifier in modifiers:
out_str += f"\n\t{modifier}"
raise ValueError(out_str)
return found


def benchpark_setup(subparsers, actions_dict):
create_parser = subparsers.add_parser(
"setup", help="Set up an experiment and prepare it to build/run"
)

create_parser.add_argument(
"benchmark", type=str, help="The experiment (benchmark/ProgrammingModel) to run"
"experiment",
type=str,
help="The experiment (benchmark/ProgrammingModel) to run",
)
create_parser.add_argument(
"system", type=str, help="The system on which to run the experiment"
Expand Down Expand Up @@ -311,32 +343,28 @@ def benchpark_setup_handler(args):
experiments_root/
spack/
ramble/
<benchmark>/
<experiment>/
<system>/
workspace/
configs/
(everything from source/configs/<system>)
(everything from source/experiments/<benchmark>)
(everything from source/experiments/<experiment>)
"""

benchmark = args.benchmark
experiment = args.experiment
system = args.system
experiments_root = pathlib.Path(os.path.abspath(args.experiments_root))
modifier = args.modifier
source_dir = source_location()
debug_print(f"source_dir = {source_dir}")
debug_print(f"specified benchmark/ProgrammingModel = {benchmark}")
valid_benchmark = benchpark_check_benchmark(benchmark)
debug_print(f"specified experiment (benchmark/ProgrammingModel) = {experiment}")
valid_experiment = benchpark_check_experiment(experiment)
debug_print(f"specified system = {system}")
valid_system = benchpark_check_system(system)
if not (valid_benchmark and valid_system):
raise ValueError(
"Invalid benchmark/experiment and system provided: {0} {1}".format(
benchmark, system
)
)
debug_print(f"specified modifier = {modifier}")
valid_modifier = benchpark_check_modifier(modifier)

workspace_dir = experiments_root / str(benchmark) / str(system)
workspace_dir = experiments_root / str(experiment) / str(system)

if workspace_dir.exists():
if workspace_dir.is_dir():
Expand All @@ -360,7 +388,7 @@ def benchpark_setup_handler(args):
print(f"Setting up configs for Ramble workspace {ramble_configs_dir}")

configs_src_dir = source_dir / "configs" / str(system)
experiment_src_dir = source_dir / "experiments" / benchmark
experiment_src_dir = source_dir / "experiments" / experiment
modifier_config_dir = source_dir / "modifiers" / modifier / "configs"
ramble_configs_dir.mkdir(parents=True)
ramble_logs_dir.mkdir(parents=True)
Expand Down Expand Up @@ -458,7 +486,7 @@ Further steps are needed to build the experiments (ramble -P -D {ramble_workspac
print(instructions)


def helper_experiments_tags(ramble_exe, experiments):
def helper_experiments_tags(ramble_exe, benchmarks):
# find all tags in Ramble applications (both in Ramble built-in and in Benchpark/repo)
(tags_stdout, tags_stderr) = run_command(f"{ramble_exe} attributes --tags --all")
ramble_applications_tags = {}
Expand All @@ -469,20 +497,20 @@ def helper_experiments_tags(ramble_exe, experiments):
ramble_applications_tags[key_value[0]] = key_value[1].strip().split(",")

benchpark_experiments_tags = {}
for exp in experiments:
benchpark_experiments_tags[exp] = ramble_applications_tags[exp]
for benchmark in benchmarks:
benchpark_experiments_tags[benchmark] = ramble_applications_tags[benchmark]
return benchpark_experiments_tags


def benchpark_tags_handler(args):
"""
Filter ramble tags by benchpark experiments
Filter ramble tags by benchpark benchmarks
"""
source_dir = source_location()
experiments_root = pathlib.Path(os.path.abspath(args.experiments_root))
ramble_location = experiments_root / "ramble"
ramble_exe = ramble_location / "bin" / "ramble"
experiments = benchpark_experiments()
benchmarks = benchpark_benchmarks()

if args.tag:
if benchpark_check_tag(args.tag):
Expand All @@ -491,17 +519,15 @@ def benchpark_tags_handler(args):
lines = tag_stdout.splitlines()

for line in lines:
if line in experiments:
if line in benchmarks:
print(line)

elif args.application:
if benchpark_check_experiment(args.application):
benchpark_experiments_tags = helper_experiments_tags(
ramble_exe, experiments
)
if benchpark_check_benchmark(args.application):
benchpark_experiments_tags = helper_experiments_tags(ramble_exe, benchmarks)
print(benchpark_experiments_tags[args.application])
else:
benchpark_experiments_tags = helper_experiments_tags(ramble_exe, experiments)
benchpark_experiments_tags = helper_experiments_tags(ramble_exe, benchmarks)
print("All tags that exist in Benchpark experiments:")
for k, v in benchpark_experiments_tags.items():
print(k)
Expand Down
4 changes: 2 additions & 2 deletions checkout-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# SPDX-License-Identifier: Apache-2.0

versions:
ramble: bb664f142b2cbdb2b2ea39e70a8535c9f27c1179
spack: 31de670bd26beca979ebd75dcb0ce90c535a78c4
ramble: d33af765be716ae27ebbe65a4cc5553661fa92b1
spack: c2eef8bab26adb00b250992e29d697b4706356a0
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ packages:
buildable: false
cmake:
externals:
- spec: cmake@3.23.1
prefix: /usr/tce/packages/cmake/cmake-3.23.1
buildable: false
- spec: cmake@3.26.3
prefix: /usr/tce/packages/cmake/cmake-3.26.3
buildable: false
gmake:
externals:
- spec: [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ packages:
buildable: false
cmake:
externals:
- spec: cmake@3.23.1
prefix: /usr/tce/packages/cmake/cmake-3.23.1
- spec: cmake@3.26.3
prefix: /usr/tce/packages/cmake/cmake-3.26.3
buildable: false
gmake:
externals:
Expand Down Expand Up @@ -48,6 +48,11 @@ packages:
prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.7-intel-classic-2021.6.0/
- spec: [email protected]
prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6
cub:
buildable: false
externals:
- spec: [email protected]
prefix: /usr/tce/packages/cuda/cuda-11.8.0/
cuda:
buildable: false
externals:
Expand Down
Loading

0 comments on commit e48400c

Please sign in to comment.