Skip to content

Commit 0e95395

Browse files
committed
apply comments
1 parent 1f4a931 commit 0e95395

File tree

3 files changed

+36
-1918
lines changed

3 files changed

+36
-1918
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/html/data.js

devops/scripts/benchmarks/benches/gromacs.py

Lines changed: 27 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,10 @@ def name(self):
3838
return "Gromacs Bench"
3939

4040
def benchmarks(self) -> list[Benchmark]:
41-
models_rf = [
42-
# "0001.5",
43-
# "0003",
44-
"0006",
45-
# "0012",
46-
# "0024",
47-
# "0048",
48-
# "0096",
49-
# "0192",
50-
# "0384",
51-
]
52-
benches_rf = [GromacsBenchmark(self, model, "rf") for model in models_rf]
53-
models_pme = [
54-
# "0001.5",
55-
# "0003",
56-
# "0006",
57-
# "0012",
58-
# "0024",
59-
# "0048",
60-
# "0096",
61-
"0192",
62-
# "0384",
41+
return [
42+
GromacsBenchmark(self, "0006", "pme"),
43+
GromacsBenchmark(self, "0192", "rf"),
6344
]
64-
benches_pme = [GromacsBenchmark(self, model, "pme") for model in models_pme]
65-
# Add more models as needed
66-
67-
return benches_rf + benches_pme
6845

6946
def setup(self):
7047
self.gromacs_src = git_clone(
@@ -97,20 +74,13 @@ def setup(self):
9774
f"cmake --build {self.gromacs_build_path} -j {options.build_jobs}",
9875
add_sycl=True,
9976
)
100-
self.download_and_extract_grappa()
101-
102-
def download_and_extract_grappa(self):
103-
grappa_tar_file = self.directory / self.grappa_file()
104-
105-
model = download(
77+
download(
10678
self.directory,
10779
self.grappa_url(),
108-
grappa_tar_file,
80+
self.directory / self.grappa_file(),
10981
checksum="cc02be35ba85c8b044e47d097661dffa8bea57cdb3db8b5da5d01cdbc94fe6c8902652cfe05fb9da7f2af0698be283a2",
11082
untar=True,
11183
)
112-
if options.verbose:
113-
print(f"Grappa tar file downloaded and extracted to {model}")
11484

11585
def teardown(self):
11686
pass
@@ -125,14 +95,32 @@ def __init__(self, suite, model, type):
12595
self.grappa_dir = suite.grappa_dir
12696
self.gmx_path = suite.gromacs_build_path / "bin" / "gmx"
12797

98+
if self.type == "pme":
99+
self.extra_args = [
100+
"-pme",
101+
"gpu",
102+
"-pmefft",
103+
"gpu",
104+
"-notunepme",
105+
]
106+
else:
107+
self.extra_args = []
108+
128109
def name(self):
129110
return f"gromacs-{self.model}-{self.type}"
130111

131112
def setup(self):
132-
model_dir = self.grappa_dir / self.model
133113
if self.type != "rf" and self.type != "pme":
134114
raise ValueError(f"Unknown benchmark type: {self.type}")
135115

116+
if not self.gmx_path.exists():
117+
raise FileNotFoundError(f"gmx executable not found at {self.gmx_path}")
118+
119+
model_dir = self.grappa_dir / self.model
120+
121+
if not model_dir.exists():
122+
raise FileNotFoundError(f"Model directory not found: {model_dir}")
123+
136124
cmd_list = [
137125
str(self.gmx_path),
138126
"grompp",
@@ -153,14 +141,8 @@ def setup(self):
153141
)
154142

155143
def run(self, env_vars):
156-
if not self.gmx_path.exists():
157-
raise FileNotFoundError(f"gmx executable not found at {self.gmx_path}")
158-
159144
model_dir = self.grappa_dir / self.model
160145

161-
if not model_dir.exists():
162-
raise FileNotFoundError(f"Model directory not found: {model_dir}")
163-
164146
env_vars.update(
165147
{
166148
"SYCL_CACHE_PERSISTENT": "1",
@@ -169,17 +151,6 @@ def run(self, env_vars):
169151
)
170152

171153
# Run benchmark
172-
if self.type == "pme":
173-
pme_cmd_list = [
174-
"-pme",
175-
"gpu",
176-
"-pmefft",
177-
"gpu",
178-
"-notunepme",
179-
]
180-
else:
181-
pme_cmd_list = []
182-
183154
command = [
184155
str(self.gmx_path),
185156
"mdrun",
@@ -201,7 +172,7 @@ def run(self, env_vars):
201172
"100",
202173
"-pin",
203174
"on",
204-
] + pme_cmd_list
175+
] + self.extra_args
205176

206177
mdrun_output = self.run_bench(
207178
command,
@@ -212,11 +183,11 @@ def run(self, env_vars):
212183
time = self._extract_execution_time(mdrun_output)
213184

214185
if options.verbose:
215-
print(f"[{self.name()}-RF] Time: {time:.3f} seconds")
186+
print(f"[{self.name()}] Time: {time:.3f} seconds")
216187

217188
return [
218189
Result(
219-
label=f"{self.name()}-{self.type}",
190+
label=f"{self.name()}",
220191
value=time,
221192
unit="s",
222193
command=" ".join(map(str, command)),

0 commit comments

Comments
 (0)