Skip to content

Commit

Permalink
Merge branch 'develop' into feature/refactor-constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
pearce8 authored Mar 9, 2024
2 parents 018c482 + ec5f3f0 commit daf069f
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fetch-depth: 0

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
Expand Down
64 changes: 50 additions & 14 deletions bin/benchpark
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
# SPDX-License-Identifier: Apache-2.0

import argparse
from contextlib import contextmanager
import os
import pathlib
import shlex
import shutil
import subprocess
import sys
import yaml

DEBUG = False

Expand Down Expand Up @@ -185,10 +187,12 @@ def run_command(command_str, env=None):

# Note: it would be nice to vendor spack.llnl.util.link_tree, but that
# involves pulling in most of llnl/util/ and spack/util/
def symlink_tree(src, dst):
def symlink_tree(src, dst, include_fn=None):
"""Like ``cp -R`` but instead of files, create symlinks"""
src = os.path.abspath(src)
dst = os.path.abspath(dst)
# By default, we include all filenames
include_fn = include_fn or (lambda f: True)
for x in [src, dst]:
if not os.path.isdir(x):
raise ValueError(f"Not a directory: {x}")
Expand All @@ -197,11 +201,30 @@ def symlink_tree(src, dst):
dst_dir = pathlib.Path(dst) / relative_src_dir
dst_dir.mkdir(parents=True, exist_ok=True)
for x in files:
if not include_fn(x):
continue
dst_symlink = dst_dir / x
src_file = os.path.join(src_subdir, x)
os.symlink(src_file, dst_symlink)


@contextmanager
def working_dir(location):
initial_dir = os.getcwd()
try:
os.chdir(location)
yield
finally:
os.chdir(initial_dir)


def git_clone_commit(url, commit, destination):
run_command(f"git clone -c feature.manyFiles=true {url} {destination}")

with working_dir(destination):
run_command(f"git checkout {commit}")


def benchpark_setup_handler(args):
"""
experiments_root/
Expand Down Expand Up @@ -257,13 +280,22 @@ def benchpark_setup_handler(args):
configs_src_dir = source_dir / "configs" / str(system)
experiment_src_dir = source_dir / "experiments" / benchmark
modifier_config_dir = source_dir / "modifiers" / modifier / "configs"

ramble_configs_dir.mkdir(parents=True)
ramble_spack_experiment_configs_dir.mkdir(parents=True)

symlink_tree(configs_src_dir, ramble_configs_dir)
symlink_tree(experiment_src_dir, ramble_configs_dir)
symlink_tree(modifier_config_dir, ramble_configs_dir)
symlink_tree(source_dir / "configs" / "common", ramble_spack_experiment_configs_dir)
def include_fn(fname):
# Only include .yaml and .tpl files
# Always exclude files that start with "."
if fname.startswith("."):
return False
if fname.endswith(".yaml") or fname.endswith(".tpl"):
return True
return False

symlink_tree(configs_src_dir, ramble_configs_dir, include_fn)
symlink_tree(experiment_src_dir, ramble_configs_dir, include_fn)
symlink_tree(modifier_config_dir, ramble_configs_dir, include_fn)
symlink_tree(source_dir / "configs" / "common", ramble_spack_experiment_configs_dir, include_fn)

spack_location = experiments_root / "spack"
ramble_location = experiments_root / "ramble"
Expand All @@ -274,12 +306,16 @@ def benchpark_setup_handler(args):

initializer_script = experiments_root / "setup.sh"

checkout_versions_location = source_dir / "checkout-versions.yaml"
with open(checkout_versions_location, "r") as yaml_file:
data = yaml.safe_load(yaml_file)
ramble_commit = data["versions"]["ramble"]
spack_commit = data["versions"]["spack"]

if not spack_location.exists():
print(f"Cloning spack into {spack_location}")
run_command(
"git clone --depth=1 -c feature.manyFiles=true "
"https://github.com/spack/spack.git "
f"{spack_location}"
git_clone_commit(
"https://github.com/spack/spack.git", spack_commit, spack_location
)

env = {"SPACK_DISABLE_LOCAL_CONFIG": "1"}
Expand All @@ -291,10 +327,10 @@ def benchpark_setup_handler(args):

if not ramble_location.exists():
print(f"Cloning ramble into {ramble_location}")
run_command(
"git clone --depth=1 -c feature.manyFiles=true "
"https://github.com/GoogleCloudPlatform/ramble.git "
f"{ramble_location}"
git_clone_commit(
"https://github.com/GoogleCloudPlatform/ramble.git",
ramble_commit,
ramble_location,
)

run_command(f"{ramble_exe} repo add --scope=site {source_dir}/repo")
Expand Down
8 changes: 8 additions & 0 deletions checkout-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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

versions:
ramble: 3d6d2670435c704ca815ae13abe49b10c5111638
spack: 31de670bd26beca979ebd75dcb0ce90c535a78c4
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@
# SPDX-License-Identifier: Apache-2.0

compilers:
- compiler:
spec: [email protected]
modules: []
paths:
cc: /opt/FJSVxtclanga/tcsds-1.2.38/bin/fcc
cxx: /opt/FJSVxtclanga/tcsds-1.2.38/bin/FCC
f77: /opt/FJSVxtclanga/tcsds-1.2.38/bin/frt
fc: /opt/FJSVxtclanga/tcsds-1.2.38/bin/frt
flags: {}
operating_system: rhel8
target: aarch64
environment:
set:
fcc_ENV: -Nclang
FCC_ENV: -Nclang
prepend_path:
PATH: /opt/FJSVxtclanga/tcsds-1.2.38/bin
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.38/lib64
extra_rpaths: []
- compiler:
spec: [email protected]
modules: []
Expand All @@ -43,83 +24,27 @@ compilers:
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.36/lib64
extra_rpaths: []
- compiler:
spec: [email protected]
modules: []
paths:
cc: /opt/FJSVxtclanga/tcsds-1.2.35/bin/fcc
cxx: /opt/FJSVxtclanga/tcsds-1.2.35/bin/FCC
f77: /opt/FJSVxtclanga/tcsds-1.2.35/bin/frt
fc: /opt/FJSVxtclanga/tcsds-1.2.35/bin/frt
flags: {}
operating_system: rhel8
target: aarch64
environment:
set:
fcc_ENV: -Nclang
FCC_ENV: -Nclang
prepend_path:
PATH: /opt/FJSVxtclanga/tcsds-1.2.35/bin
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.35/lib64
extra_rpaths: []
- compiler:
spec: [email protected]
modules: []
spec: [email protected]
paths:
cc: /opt/FJSVxtclanga/tcsds-1.2.34/bin/fcc
cxx: /opt/FJSVxtclanga/tcsds-1.2.34/bin/FCC
f77: /opt/FJSVxtclanga/tcsds-1.2.34/bin/frt
fc: /opt/FJSVxtclanga/tcsds-1.2.34/bin/frt
flags: {}
operating_system: rhel8
target: aarch64
cc: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/clang
cxx: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/clang++
f77: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/flang
fc: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/flang
flags:
cflags: {"-msve-vector-bits=scalable"}
cxxflags: {"-msve-vector-bits=scalable"}
ldflags: {"-fuse-ld=lld -lelf -ldl"}
environment:
set:
fcc_ENV: -Nclang
FCC_ENV: -Nclang
prepend_path:
PATH: /opt/FJSVxtclanga/tcsds-1.2.34/bin
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.34/lib64
extra_rpaths: []
- compiler:
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
f77: /usr/bin/gfortran
fc: /usr/bin/gfortran
OMPI_CC: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/clang
OMPI_CXX: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/clang++
OMPI_FC: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/flang
OMPI_F77: /vol0004/apps/oss/llvm-v15.0.3/compute_node/bin/flang
append_path:
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.36/lib64
operating_system: rhel8
target: aarch64
modules: []
environment:
unset: []
extra_rpaths: []
flags: {}
spec: [email protected]
- compiler:
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
f77: /usr/bin/gfortran
fc: /usr/bin/gfortran
operating_system: rhel8
target: x86_64
modules: []
environment:
unset: []
extra_rpaths: []
flags: {}
spec: [email protected]
- compiler:
spec: [email protected]
paths:
cc: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-skylake_avx512/gcc-8.4.1/gcc-12.2.0-bjidm56oz6mejysl3wvjr3mbn7sqk3ec/bin/gcc
cxx: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-skylake_avx512/gcc-8.4.1/gcc-12.2.0-bjidm56oz6mejysl3wvjr3mbn7sqk3ec/bin//g++
f77: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-skylake_avx512/gcc-8.4.1/gcc-12.2.0-bjidm56oz6mejysl3wvjr3mbn7sqk3ec/bin/gfortran
fc: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-skylake_avx512/gcc-8.4.1/gcc-12.2.0-bjidm56oz6mejysl3wvjr3mbn7sqk3ec/bin/gfortran
flags: {}
operating_system: rhel8
target: x86_64
modules: []
environment: {}
extra_rpaths: []
- compiler:
spec: [email protected]
Expand All @@ -128,9 +53,19 @@ compilers:
cxx: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/g++
f77: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/gfortran
fc: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/gfortran
flags: {}
flags:
ldflags: {"-lelf -ldl"}
environment:
set:
OMPI_CC: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/gcc
OMPI_CXX: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/g++
OMPI_FC: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/gfortran
OMPI_F77: /vol0004/apps/oss/spack-v0.19/opt/spack/linux-rhel8-a64fx/gcc-8.5.0/gcc-12.2.0-sxcx7kmt3qiktffgzzvrj2wmup3g32bc/bin/gfortran
OPAL_PREFIX: /vol0004/apps/oss/mpigcc/fjmpi-gcc12
append_path:
LD_LIBRARY_PATH: /opt/FJSVxtclanga/tcsds-1.2.36/lib64
operating_system: rhel8
target: aarch64
modules: []
environment: {}
extra_rpaths: []

Loading

0 comments on commit daf069f

Please sign in to comment.