GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit b4d26c06 authored by John Zhang's avatar John Zhang

sunflow: adjust workload

- generated larger resolution frames for default and large size
- add API to adjust error threshold for large resolutions
parent 0dc90ade
Pipeline #2942 passed with stage
in 82 minutes and 38 seconds
......@@ -15,19 +15,10 @@
<property name="bm-url" value="${sourceforge.dl.url}/sunflow/sunflow-src/v${bm-version}"/>
<property name="bm-bin-url" value="${sourceforge.dl.url}/sunflow/sunflow-bin/v${bm-version}"/>
<property name="bm-src" value="${bm-name}-src-v${bm-version}.zip"/>
<property name="bm-bin" value="${bm-name}-bin-v${bm-version}.zip"/>
<import file="../common.xml"/>
<target name="source" depends="common.source">
<antcall target="check-source">
<param name="target-dir" value="${bm-downloads}"/>
<param name="target-url" value="${bm-bin-url}"/>
<param name="target-file" value="${bm-bin}"/>
</antcall>
</target>
<target name="unpack" depends="unzip"/>
<target name="unpack" depends="unzip, patch"/>
<target name="bm-build" depends="janino">
<mkdir dir="${bm-build-dir}/build"/>
......@@ -36,21 +27,12 @@
debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="bm-data">
<unzip src="${bm-downloads}/${bm-bin}" dest="${bm-build-dir}"/>
<unjar src="${bm-build-dir}/${bm-name}/${bm-name}.jar" dest="${bm-build-dir}">
<patternset>
<include name="resources/golden_*.png"/>
</patternset>
</unjar>
</target>
<target name="jar" depends="bm-data">
<target name="jar">
<jar destfile="${bm-jars}/${bm-name}-${bm-version}.jar">
<fileset dir="${bm-build-dir}/build">
<include name="**/*.class"/>
</fileset>
<fileset dir="${bm-build-dir}">
<fileset dir="${bm-data}">
<include name="resources/golden_*.png"/>
</fileset>
</jar>
......
......@@ -31,7 +31,7 @@ public class Sunflow extends org.dacapo.harness.Benchmark {
this.method = clazz.getMethod("kernelMain");
this.beginMethod = clazz.getMethod("kernelBegin");
this.endMethod = clazz.getMethod("kernelEnd");
this.constructor = clazz.getConstructor(int.class, boolean.class, boolean.class, boolean.class, int.class);
this.constructor = clazz.getConstructor(int.class, boolean.class, boolean.class, boolean.class, int.class, int.class);
}
/** Do one-time prep such as unziping data. In our case, do nothing. */
......@@ -49,7 +49,10 @@ public class Sunflow extends org.dacapo.harness.Benchmark {
String[] args = config.preprocessArgs(size, scratch);
useBenchmarkClassLoader();
try {
sunflow = constructor.newInstance(Integer.parseInt(args[0]), false, false, false, config.getThreadCount(size));
sunflow = constructor.newInstance(Integer.parseInt(args[0]),
false, false, false,
config.getThreadCount(size),
Integer.parseInt(args[1]));
beginMethod.invoke(sunflow);
} finally {
revertClassLoader();
......
......@@ -3,18 +3,18 @@ benchmark sunflow
thread-model per_cpu
jars "sunflow-0.07.2.jar", "janino-2.5.15.jar";
size small args "32"
size small args "32", "6"
thread-limit 32
output stdout digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size default args "256"
thread-limit 256
size default args "1024", "30"
thread-limit 1024
output stdout digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size large args "512"
thread-limit 512
size large args "4096", "80"
thread-limit 4096
output stdout digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
......
diff -ru sunflow-orig/src/org/sunflow/Benchmark.java sunflow/src/org/sunflow/Benchmark.java
--- sunflow-orig/src/org/sunflow/Benchmark.java 2007-01-28 01:10:58.000000000 +1100
+++ sunflow/src/org/sunflow/Benchmark.java 2018-08-02 16:36:39.000000000 +1000
@@ -41,16 +41,11 @@
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Benchmark options:");
- System.out.println(" -regen Regenerate reference images for a variety of sizes");
+ System.out.println(" -regen [resolution] Regenerate reference images for a variety of sizes");
System.out.println(" -bench [threads] [resolution] Run a single iteration of the benchmark using the specified thread count and image resolution");
System.out.println(" Default: threads=0 (auto-detect cpus), resolution=256");
} else if (args[0].equals("-regen")) {
- int[] sizes = { 32, 64, 96, 128, 256, 384, 512 };
- for (int s : sizes) {
- // run a single iteration to generate the reference image
- Benchmark b = new Benchmark(s, true, false, true);
- b.kernelMain();
- }
+ new Benchmark(Integer.parseInt(args[1]), true, false, true).kernelMain();
} else if (args[0].equals("-bench")) {
int threads = 0, resolution = 256;
if (args.length > 1)
@@ -100,6 +95,11 @@
}
}
+ public Benchmark(int resolution, boolean showOutput, boolean showBenchmarkOutput, boolean saveOutput, int threads, int errorThreshold) {
+ this(resolution, showOutput, showBenchmarkOutput, saveOutput, threads);
+ this.errorThreshold = errorThreshold;
+ }
+
public void execute() {
// 10 iterations maximum - 10 minute time limit
BenchmarkFramework framework = new BenchmarkFramework(10, 600);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment