Skip to content

Commit 4227406

Browse files
portantewebbnh
andauthored
pbench-specjbb2005 now handles commented props
If the `SPECjbb.props` file has a commented out line we now ignore it, and ensure the requested behaviors take effect by appending them to the end of the file. Co-authored-by: Webb Scales <[email protected]>
1 parent 37e772f commit 4227406

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

agent/bench-scripts/pbench-specjbb2005

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,16 @@ fi
276276
trap "interrupt" INT QUIT TERM
277277

278278
# edit the jbb properties file to match user's options
279-
> ${benchmark_run_dir}/SPECjbb.props.sed
280-
printf "s/input.jvm_instances=.*/input.jvm_instances=$nr_jvms/\n" >> ${benchmark_run_dir}/SPECjbb.props.sed
281-
printf "s/input.measurement_seconds=.*/input.measurement_seconds=$runtime/\n" >> ${benchmark_run_dir}/SPECjbb.props.sed
282-
printf "s/input.starting_number_warehouses=.*/input.starting_number_warehouses=$start_warehouses/\n" >> ${benchmark_run_dir}/SPECjbb.props.sed
283-
printf "s/input.increment_number_warehouses=.*/input.increment_number_warehouses=$inc_warehouses/\n" >> ${benchmark_run_dir}/SPECjbb.props.sed
284-
printf "s/input.ending_number_warehouses=.*/input.ending_number_warehouses=$stop_warehouses/\n" >> ${benchmark_run_dir}/SPECjbb.props.sed
285-
sed -f ${benchmark_run_dir}/SPECjbb.props.sed ${specjbb2005_dir}/SPECjbb.props > ${benchmark_run_dir}/SPECjbb.props
279+
cp ${specjbb2005_dir}/SPECjbb.props ${benchmark_run_dir}/SPECjbb.props
286280
if [ $? -ne 0 ]; then
287281
printf "\t${benchmark}: unable to create the SPECjbb.props file (\"${benchmark_run_dir}/SPECjbb.props\")\n\n"
288282
exit 1
289283
fi
284+
printf "input.jvm_instances=$nr_jvms\n" >> ${benchmark_run_dir}/SPECjbb.props
285+
printf "input.measurement_seconds=$runtime\n" >> ${benchmark_run_dir}/SPECjbb.props
286+
printf "input.starting_number_warehouses=$start_warehouses\n" >> ${benchmark_run_dir}/SPECjbb.props
287+
printf "input.increment_number_warehouses=$inc_warehouses\n" >> ${benchmark_run_dir}/SPECjbb.props
288+
printf "input.ending_number_warehouses=$stop_warehouses\n" >> ${benchmark_run_dir}/SPECjbb.props
290289
cp ${specjbb2005_dir}/SPECjbb_config.props ${benchmark_run_dir}/
291290
if [ $? -ne 0 ]; then
292291
printf "\t${benchmark}: unable to copy SPECjbb_config.props file from \"${specjbb2005_dir}\"\n\n"

agent/bench-scripts/test-bin/java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,32 @@ nr_jvms = None
2222
start = None
2323
inc = None
2424
stop = None
25+
runtime = None
2526
with open("SPECjbb.props", "r") as fp:
2627
for line in fp:
28+
if not line.startswith("input."):
29+
continue
30+
val_str = line.split("=", 1)[1]
31+
if val_str == "_bad_\n":
32+
continue
33+
val = int(val_str)
2734
if line.startswith("input.jvm_instances="):
28-
nr_jvms = int(line.split("=", 1)[1])
35+
nr_jvms = val
2936
if line.startswith("input.starting_number_warehouses="):
30-
start = int(line.split("=", 1)[1])
37+
start = val
3138
if line.startswith("input.increment_number_warehouses="):
32-
inc = int(line.split("=", 1)[1])
39+
inc = val
3340
if line.startswith("input.ending_number_warehouses="):
34-
stop = int(line.split("=", 1)[1])
41+
stop = val
42+
if line.startswith("input.measurement_seconds="):
43+
runtime = val
3544

3645
tgt_dir = "SPECjbbSingleJVM" if nr_jvms == 1 else f"SPECjbbMultiJVM.{jvm_id:03d}"
3746
res_dir = Path("results") / tgt_dir
3847
res_dir.mkdir()
3948
with open(res_dir / f"SPECjbb.{jvm_id:03d}.raw", "w") as fp:
4049
for i in range(start, stop + 1, inc):
4150
print("Timing Measurement began")
42-
fp.write(f"test{i} -- 42 * {i}\n")
51+
fp.write(f"test{i} -- 42 * {i} - {runtime}\n")
4352
print("Timing Measurement ended")
4453
sys.exit(0)

agent/bench-scripts/tests/pbench-specjbb2005/test-56.pre

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ _dir="${_testtmp}/specjbb2005"
99
mkdir ${_dir} || exit 1
1010
touch ${_dir}/SPECjbb.props || exit 1
1111
# 2. a properties file containing the 5 properties that will be replaced
12-
printf "input.jvm_instances=_replace_\n" >> ${_dir}/SPECjbb.props
13-
printf "input.measurement_seconds=_replace_\n" >> ${_dir}/SPECjbb.props
14-
printf "input.starting_number_warehouses=_replace_\n" >> ${_dir}/SPECjbb.props
15-
printf "input.increment_number_warehouses=_replace_\n" >> ${_dir}/SPECjbb.props
16-
printf "input.ending_number_warehouses=_replace_\n" >> ${_dir}/SPECjbb.props
12+
printf "input.jvm_instances=_bad_\n" >> ${_dir}/SPECjbb.props
13+
printf "input.measurement_seconds=_bad_\n" >> ${_dir}/SPECjbb.props
14+
printf "input.starting_number_warehouses=_bad_\n" >> ${_dir}/SPECjbb.props
15+
printf "input.increment_number_warehouses=_bad_\n" >> ${_dir}/SPECjbb.props
16+
printf "#input.ending_number_warehouses=_bad_\n" >> ${_dir}/SPECjbb.props
1717
# 3. a properties file for the configuration of SPECjbb, the contents of which
1818
# is ignored, but its presence is expected
1919
touch ${_dir}/SPECjbb_config.props || exit 1

agent/bench-scripts/tests/pbench-specjbb2005/test-56.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Timing Measurement ended
8181
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/8-warehouses:8/sample1/SPECjbb.raw
8282
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/8-warehouses:8/sample1/tools-default
8383
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/SPECjbb.props
84-
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/SPECjbb.props.sed
8584
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/SPECjbb_config.props
8685
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/jvm-1-worker.txt
8786
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-56_1900.01.01T00.00.00/metadata.log
@@ -181,3 +180,15 @@ iteration_name = 8-warehouses:8
181180
user_script = specjbb2005
182181

183182
--- specjbb2005_test-56_1900.01.01T00.00.00/metadata.log file contents
183+
+++ specjbb2005_test-56_1900.01.01T00.00.00/SPECjbb.props file contents
184+
input.jvm_instances=_bad_
185+
input.measurement_seconds=_bad_
186+
input.starting_number_warehouses=_bad_
187+
input.increment_number_warehouses=_bad_
188+
#input.ending_number_warehouses=_bad_
189+
input.jvm_instances=1
190+
input.measurement_seconds=30
191+
input.starting_number_warehouses=1
192+
input.increment_number_warehouses=1
193+
input.ending_number_warehouses=8
194+
--- specjbb2005_test-56_1900.01.01T00.00.00/SPECjbb.props file contents

agent/bench-scripts/tests/pbench-specjbb2005/test-57.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Timing Measurement ended
3636
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/3-warehouses:23/sample1/SPECjbb.raw
3737
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/3-warehouses:23/sample1/tools-default
3838
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/SPECjbb.props
39-
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/SPECjbb.props.sed
4039
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/SPECjbb_config.props
4140
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/jvm-1-worker.txt
4241
/var/tmp/pbench-test-bench/pbench-agent/specjbb2005_test-57_1900.01.01T00.00.00/jvm-2-worker.txt
@@ -94,3 +93,15 @@ iteration_name = 3-warehouses:23
9493
user_script = specjbb2005
9594

9695
--- specjbb2005_test-57_1900.01.01T00.00.00/metadata.log file contents
96+
+++ specjbb2005_test-57_1900.01.01T00.00.00/SPECjbb.props file contents
97+
input.jvm_instances=_bad_
98+
input.measurement_seconds=_bad_
99+
input.starting_number_warehouses=_bad_
100+
input.increment_number_warehouses=_bad_
101+
#input.ending_number_warehouses=_bad_
102+
input.jvm_instances=2
103+
input.measurement_seconds=30
104+
input.starting_number_warehouses=13
105+
input.increment_number_warehouses=5
106+
input.ending_number_warehouses=23
107+
--- specjbb2005_test-57_1900.01.01T00.00.00/SPECjbb.props file contents

agent/bench-scripts/unittests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ function _dump_logs {
160160
if [[ ! -z "${rundir}" ]]; then
161161
_dump_file ${rundir} metadata.log
162162
_dump_file ${rundir} user-benchmark-summary.json
163+
_dump_file ${rundir} SPECjbb.props
163164
(
164165
if cd ${_testdir}/${rundir} > /dev/null 2>&1 ;then
165166
for f in $(find . -name '*.cmd' 2> /dev/null | sort); do

0 commit comments

Comments
 (0)