Skip to content

Commit f6a3dbe

Browse files
michaelmckinsey1Michael Richard MckinseyMichael Richard MckinseyMichael Richard MckinseyMckinsey
authored
Run Pre-built Binary (#616)
* New package manager and enable appending path: - 'environment-modules' package manager as alternative to spack - Enable appending to path in execute_experiment job file * Only setup spack if package manager is spack * Refactor compute_spack_section into generalized compute_package_section * Update legacy CI * Remove instances of compute_spack_section * Update documentation and enumerate appending to non-path variable * update correct value for env_vars * Add comments to helper * Update new experiment * black * Fix unit tests * Remove downstream check and rename function * Remove argument from function * Add dryrun CI * Add docs page for running a binary --------- Co-authored-by: Michael Richard Mckinsey <[email protected]> Co-authored-by: Michael Richard Mckinsey <[email protected]> Co-authored-by: Michael Richard Mckinsey <[email protected]> Co-authored-by: Mckinsey <[email protected]> Co-authored-by: pearce8 <[email protected]>
1 parent 56e1f61 commit f6a3dbe

33 files changed

+285
-134
lines changed

Diff for: .github/workflows/docs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
run: |
2525
pip install -r .github/workflows/requirements/docs.txt
2626
# create a dummy workspace to get a working ramble
27-
bin/benchpark setup experiments/saxpy systems/generic-x86 /tmp/workspace
27+
bin/benchpark experiment init --dest=saxpy saxpy
28+
bin/benchpark system init --dest=generic-x86 generic-x86
29+
bin/benchpark setup saxpy generic-x86 /tmp/workspace
2830
# this is gross and we should better setup ramble for people or make it a Spack package
2931
pip install -r /tmp/workspace/ramble/requirements.txt
3032

Diff for: .github/workflows/run.yml

+23
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,29 @@ jobs:
9292
--unsigned \
9393
--update-index ci-buildcache \
9494
$(spack find --format '/{hash}')
95+
96+
- name: Test Execution Using Binary
97+
run: |
98+
OUTPUT=$(spack find --paths saxpy)
99+
SAXPY_PATH=$(echo "$OUTPUT" | grep 'saxpy@' | awk '{print $2}')/bin/saxpy
100+
echo "Extracted Path: $SAXPY_PATH"
101+
102+
./bin/benchpark experiment init --dest=saxpy/binary saxpy+openmp package_manager="environment-modules" append_path="$SAXPY_PATH"
103+
./bin/benchpark setup saxpy/openmp generic-x86 workspace-binary/
104+
105+
./workspace-binary/ramble/bin/ramble \
106+
--disable-progress-bar \
107+
--workspace-dir \
108+
/home/runner/work/benchpark/benchpark/workspace-binary/saxpy/openmp/generic-x86/workspace \
109+
workspace setup
110+
./workspace-binary/ramble/bin/ramble \
111+
--disable-progress-bar \
112+
--workspace-dir \
113+
/home/runner/work/benchpark/benchpark/workspace-binary/saxpy/openmp/generic-x86/workspace \
114+
on \
115+
--executor '{execute_experiment}' \
116+
--where '{n_nodes} == 1'
117+
95118
dryrunexperiments:
96119
runs-on: ubuntu-22.04
97120
steps:

Diff for: docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
analyze-experiment
4040
modifiers
4141
set-of-experiments
42+
run-binary
4243

4344
.. toctree::
4445
:maxdepth: 1

Diff for: docs/run-binary.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. Copyright 2023 Lawrence Livermore National Security, LLC and other
2+
Benchpark Project Developers. See the top-level COPYRIGHT file for details.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
6+
=================================
7+
Running a Binary Using Benchpark
8+
=================================
9+
10+
If you have a pre-built binary of your application, you can use it in your Benchpark experiment using the `environment-modules` package manager.
11+
When initializing your experiment, provide the path to the binary, and use specify `environment-modules` as the package manager.
12+
The steps for initializing the system and setting up the experiment remain the same as before.
13+
14+
Example running the `osu-micro-benchmarks` workload `osu_latency` on the `ruby` system::
15+
16+
benchpark experiment init --dest=osumb osu-micro-benchmarks \
17+
package_manager="environment-modules" \
18+
workload="osu_latency" \
19+
append_path="osu-micro-benchmarks/mpi/pt2pt"
20+
benchpark system init --dest=ruby llnl-cluster cluster=ruby
21+
benchpark setup ./osumb/ ./ruby/ osumb-ruby/

Diff for: experiments/ad/experiment.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def compute_applications_section(self):
2424
self.add_experiment_variable("n_ranks", 1, True)
2525
self.add_experiment_variable("n_threads_per_proc", 1, True)
2626

27-
def compute_spack_section(self):
27+
def compute_package_section(self):
2828
# get package version
2929
app_version = self.spec.variants["version"][0]
3030

@@ -36,6 +36,7 @@ def compute_spack_section(self):
3636

3737
# set package spack specs
3838
# empty package_specs value implies external package
39-
# self.add_spack_spec(system_specs["mpi"])
40-
41-
self.add_spack_spec(self.name, [f"ad@{app_version}", system_specs["compiler"]])
39+
# self.add_package_spec(system_specs["mpi"])
40+
self.add_package_spec(
41+
self.name, [f"ad@{app_version}", system_specs["compiler"]]
42+
)

Diff for: experiments/amg2023/experiment.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def compute_applications_section(self):
133133
elif self.spec.satisfies("+cuda") or self.spec.satisfies("+rocm"):
134134
self.add_experiment_variable("n_gpus", n_resources, True)
135135

136-
def compute_spack_section(self):
136+
def compute_package_section(self):
137137
# get package version
138138
app_version = self.spec.variants["version"][0]
139139

@@ -145,20 +145,20 @@ def compute_spack_section(self):
145145
system_specs["lapack"] = "lapack"
146146
system_specs["blas"] = "blas"
147147

148-
# set package spack specs
149-
# empty package_specs value implies external package
150-
self.add_spack_spec(system_specs["mpi"])
151-
152148
if self.spec.satisfies("+cuda"):
153149
system_specs["cuda_version"] = "{default_cuda_version}"
154150
system_specs["cuda_arch"] = "{cuda_arch}"
155151
elif self.spec.satisfies("+rocm"):
156152
system_specs["rocm_arch"] = "{rocm_arch}"
157153

154+
# set package spack specs
155+
# empty package_specs value implies external package
156+
self.add_package_spec(system_specs["mpi"])
157+
158158
# empty package_specs value implies external package
159-
self.add_spack_spec(system_specs["blas"])
160-
self.add_spack_spec(system_specs["lapack"])
159+
self.add_package_spec(system_specs["blas"])
160+
self.add_package_spec(system_specs["lapack"])
161161

162-
self.add_spack_spec(
162+
self.add_package_spec(
163163
self.name, [f"amg2023@{app_version} +mpi", system_specs["compiler"]]
164164
)

Diff for: experiments/babelstream/experiment.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def compute_applications_section(self):
5353
if self.spec.satisfies("+cuda") or self.spec.satisfies("+rocm"):
5454
self.add_experiment_variable("n_gpus", n_resources, True)
5555

56-
def compute_spack_section(self):
56+
def compute_package_section(self):
5757
# get package version
5858
app_version = self.spec.variants["version"][0]
5959

@@ -69,7 +69,7 @@ def compute_spack_section(self):
6969
system_specs["rocm_arch"] = "{rocm_arch}"
7070

7171
# set package spack specs
72-
self.add_spack_spec(system_specs["mpi"])
73-
self.add_spack_spec(
72+
self.add_package_spec(system_specs["mpi"])
73+
self.add_package_spec(
7474
self.name, [f"babelstream@{app_version}", system_specs["compiler"]]
7575
)

Diff for: experiments/genesis/experiment.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def compute_applications_section(self):
4848
self.add_experiment_variable("omp_num_threads", ["12"])
4949
self.add_experiment_variable("arch", "OpenMP")
5050

51-
def compute_spack_section(self):
51+
def compute_package_section(self):
5252
# get package version
5353
app_version = self.spec.variants["version"][0]
5454

@@ -58,12 +58,13 @@ def compute_spack_section(self):
5858
system_specs["lapack"] = "lapack"
5959

6060
# if package_spec left empty spack will use external
61-
self.add_spack_spec(system_specs["mpi"])
62-
self.add_spack_spec(system_specs["lapack"])
61+
self.add_package_spec(system_specs["mpi"])
62+
self.add_package_spec(system_specs["lapack"])
6363

64-
self.add_spack_spec(
64+
self.add_package_spec(
6565
self.name, [f"genesis@{app_version} +mpi", system_specs["compiler"]]
6666
)
67-
self.add_spack_spec(
68-
system_specs["lapack"], [system_specs["lapack"], system_specs["compiler"]]
67+
self.add_package_spec(
68+
system_specs["lapack"],
69+
[system_specs["lapack"], system_specs["compiler"]],
6970
)

Diff for: experiments/gpcnet/experiment.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def compute_applications_section(self):
3232
elif self.spec.satisfies("workload=network_load_test"):
3333
self.add_experiment_variable("n_nodes", "10")
3434

35-
def compute_spack_section(self):
35+
def compute_package_section(self):
3636
# get package version
3737
app_version = self.spec.variants["version"][0]
3838

@@ -43,8 +43,8 @@ def compute_spack_section(self):
4343
system_specs["mpi"] = "default-mpi"
4444

4545
# empty package_specs value implies external package
46-
self.add_spack_spec(system_specs["mpi"])
46+
self.add_package_spec(system_specs["mpi"])
4747

48-
self.add_spack_spec(
48+
self.add_package_spec(
4949
self.name, [f"gpcnet@{app_version} +mpi", system_specs["compiler"]]
5050
)

Diff for: experiments/gromacs/experiment.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def compute_applications_section(self):
8686
for k, v in other_input_variables.items():
8787
self.add_experiment_variable(k, v)
8888

89-
def compute_spack_section(self):
89+
def compute_package_section(self):
9090
# get package version
9191
app_version = self.spec.variants["version"][0]
9292

@@ -100,11 +100,11 @@ def compute_spack_section(self):
100100

101101
# set package spack specs
102102
# empty package_specs value implies external package
103-
self.add_spack_spec(system_specs["mpi"])
103+
self.add_package_spec(system_specs["mpi"])
104104
# empty package_specs value implies external package
105-
self.add_spack_spec(system_specs["blas"])
105+
self.add_package_spec(system_specs["blas"])
106106
# empty package_specs value implies external package
107-
self.add_spack_spec(system_specs["lapack"])
107+
self.add_package_spec(system_specs["lapack"])
108108

109109
spack_specs = "+mpi~hwloc"
110110
spack_specs += "+sycl" if self.spec.satisfies("+rocm") else "~sycl"
@@ -115,7 +115,7 @@ def compute_spack_section(self):
115115
else:
116116
spack_specs += " gpu-aware-mpi=off "
117117

118-
self.add_spack_spec(
118+
self.add_package_spec(
119119
self.name,
120120
[f"gromacs@{app_version} {spack_specs}", system_specs["compiler"]],
121121
)

Diff for: experiments/hpcg/experiment.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def compute_applications_section(self):
7979

8080
self.add_experiment_variable("iterations", "60", False)
8181

82-
def compute_spack_section(self):
82+
def compute_package_section(self):
8383
# get package version
8484
app_version = self.spec.variants["version"][0]
8585

@@ -91,9 +91,9 @@ def compute_spack_section(self):
9191

9292
# set package spack specs
9393
# empty package_specs value implies external package
94-
self.add_spack_spec(system_specs["mpi"])
95-
# self.add_spack_spec(system_specs["blas"])
94+
self.add_package_spec(system_specs["mpi"])
95+
# self.add_package_spec(system_specs["blas"])
9696

97-
self.add_spack_spec(
97+
self.add_package_spec(
9898
self.name, [f"hpcg@{app_version}", system_specs["compiler"]]
9999
)

Diff for: experiments/hpl/experiment.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def compute_applications_section(self):
9898
problem_size = scaled_variables["Ns"]
9999
self.add_experiment_variable("Ns", problem_size, True)
100100

101-
def compute_spack_section(self):
101+
def compute_package_section(self):
102102
# get package version
103103
app_version = self.spec.variants["version"][0]
104104

@@ -111,7 +111,9 @@ def compute_spack_section(self):
111111

112112
# set package spack specs
113113
# empty package_specs value implies external package
114-
self.add_spack_spec(system_specs["mpi"])
115-
self.add_spack_spec(system_specs["blas"])
114+
self.add_package_spec(system_specs["mpi"])
115+
self.add_package_spec(system_specs["blas"])
116116

117-
self.add_spack_spec(self.name, [f"hpl@{app_version}", system_specs["compiler"]])
117+
self.add_package_spec(
118+
self.name, [f"hpl@{app_version}", system_specs["compiler"]]
119+
)

Diff for: experiments/ior/experiment.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def compute_applications_section(self):
7878
"n_ranks", "{sys_cores_per_node} * {n_nodes}", True
7979
)
8080

81-
def compute_spack_section(self):
81+
def compute_package_section(self):
8282
# get package version
8383
app_version = self.spec.variants["version"][0]
8484

@@ -89,6 +89,8 @@ def compute_spack_section(self):
8989
system_specs["mpi"] = "default-mpi"
9090

9191
# set package spack specs
92-
self.add_spack_spec(system_specs["mpi"])
92+
self.add_package_spec(system_specs["mpi"])
9393

94-
self.add_spack_spec(self.name, [f"ior@{app_version}", system_specs["compiler"]])
94+
self.add_package_spec(
95+
self.name, [f"ior@{app_version}", system_specs["compiler"]]
96+
)

Diff for: experiments/kripke/experiment.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def compute_applications_section(self):
136136
elif self.spec.satisfies("+rocm"):
137137
self.add_experiment_variable("arch", "HIP")
138138

139-
def compute_spack_section(self):
139+
def compute_package_section(self):
140140
# get package version
141141
app_version = self.spec.variants["version"][0]
142142

@@ -153,8 +153,8 @@ def compute_spack_section(self):
153153

154154
# set package spack specs
155155
# empty package_specs value implies external package
156-
self.add_spack_spec(system_specs["mpi"])
156+
self.add_package_spec(system_specs["mpi"])
157157

158-
self.add_spack_spec(
158+
self.add_package_spec(
159159
self.name, [f"kripke@{app_version} +mpi", system_specs["compiler"]]
160160
)

Diff for: experiments/laghos/experiment.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def compute_applications_section(self):
5959
num_resources = scaled_variables["n_nodes"]
6060
self.add_experiment_variable(device, num_resources, True)
6161

62-
def compute_spack_section(self):
62+
def compute_package_section(self):
6363
# get package version
6464
app_version = self.spec.variants["version"][0]
6565

@@ -71,21 +71,21 @@ def compute_spack_section(self):
7171
system_specs["lapack"] = "lapack"
7272
system_specs["blas"] = "blas"
7373

74-
# set package spack specs
75-
# empty package_specs value implies external package
76-
self.add_spack_spec(system_specs["mpi"])
77-
7874
if self.spec.satisfies("+cuda"):
7975
system_specs["cuda_version"] = "{default_cuda_version}"
8076
system_specs["cuda_arch"] = "{cuda_arch}"
8177
elif self.spec.satisfies("+rocm"):
8278
system_specs["rocm_arch"] = "{rocm_arch}"
8379

80+
# set package spack specs
81+
# empty package_specs value implies external package
82+
self.add_package_spec(system_specs["mpi"])
83+
8484
# empty package_specs value implies external package
85-
self.add_spack_spec(system_specs["blas"])
86-
self.add_spack_spec(system_specs["lapack"])
87-
self.add_spack_spec(system_specs["mpi"])
85+
self.add_package_spec(system_specs["blas"])
86+
self.add_package_spec(system_specs["lapack"])
87+
self.add_package_spec(system_specs["mpi"])
8888

89-
self.add_spack_spec(
89+
self.add_package_spec(
9090
self.name, [f"laghos@{app_version} +metis", system_specs["compiler"]]
9191
)

Diff for: experiments/lammps/experiment.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def compute_applications_section(self):
9191
False,
9292
)
9393

94-
def compute_spack_section(self):
94+
def compute_package_section(self):
9595
# get package version
9696
app_version = self.spec.variants["version"][0]
9797

@@ -102,20 +102,20 @@ def compute_spack_section(self):
102102
system_specs["mpi"] = "default-mpi"
103103
system_specs["blas"] = "blas"
104104

105-
# set package spack specs
106-
# empty package_specs value implies external package
107-
self.add_spack_spec(system_specs["mpi"])
108-
109105
if self.spec.satisfies("+cuda"):
110106
system_specs["cuda_version"] = "{default_cuda_version}"
111107
system_specs["cuda_arch"] = "{cuda_arch}"
112108
elif self.spec.satisfies("+rocm"):
113109
system_specs["rocm_arch"] = "{rocm_arch}"
114110

111+
# set package spack specs
112+
# empty package_specs value implies external package
113+
self.add_package_spec(system_specs["mpi"])
114+
115115
# empty package_specs value implies external package
116-
self.add_spack_spec(system_specs["blas"])
116+
self.add_package_spec(system_specs["blas"])
117117

118-
self.add_spack_spec(
118+
self.add_package_spec(
119119
self.name,
120120
[
121121
f"lammps@{app_version} +mpi+opt+manybody+molecule+kspace+rigid+kokkos+asphere+dpd-basic+dpd-meso+dpd-react+dpd-smooth+reaxff lammps_sizes=bigbig ",

0 commit comments

Comments
 (0)