From 4982d28ecb1677fcb59a72b4da5dfaa82312f00a Mon Sep 17 00:00:00 2001 From: yeom Date: Fri, 12 Nov 2010 02:38:19 +0000 Subject: [PATCH] changes on MolDyn: increases workload and re-arranges unnecessary stall sites. --- .../Benchmarks/oooJava/moldyn/JGFMolDynBench.java | 15 +++++++++------ .../oooJava/moldyn/JGFMolDynBenchSizeB.java | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBench.java b/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBench.java index 75cd1d11..5f3b0946 100644 --- a/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBench.java +++ b/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBench.java @@ -259,7 +259,7 @@ class mdRunner { public void doinit(int mdsize) { for (int j = 0; j < 3; j++) { double[] sh = sh_force[j]; - for (int i = 0; i < mdsize; i++) { + for (int i = 0; i < sh.length; i++) { sh[i] = 0.0; } } @@ -357,7 +357,7 @@ class mdRunner { for (int move = 0; move < movemx; move++) { /* move the particles and update velocities */ - for (int i = 0; i < mdsize; i++) { + for (int i = 0; i < one.length; i++) { one[i].domove(side, i); } @@ -423,11 +423,12 @@ class mdRunner { } mymd.epot[0] =l_epot; +// System.out.println("SEQ_START"); mymd.vir[0] = l_vir; mymd.interactions = l_interacts; for (int k = 0; k < 3; k++) { - for (int j = 0; j < mdsize; j++) { + for (int j = 0; j < sh_force[k].length; j++) { sh_force[k][j] = sh_force[k][j] * hsq2; } } @@ -438,10 +439,12 @@ class mdRunner { // } /* scale forces, update velocities */ - sum = 0.0; - for (int i = 0; i < mdsize; i++) { - sum = sum + one[i].mkekin(hsq2, i); + double l_sum=0.0; + int maxIdx=one.length; + for (int i = 0; i < maxIdx; i++) { + l_sum = l_sum + one[i].mkekin(hsq2, i); } + sum=l_sum; ekin = sum / hsq; diff --git a/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBenchSizeB.java b/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBenchSizeB.java index 3331e9df..f7007ad5 100644 --- a/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBenchSizeB.java +++ b/Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBenchSizeB.java @@ -29,7 +29,7 @@ public class JGFMolDynBenchSizeB { System.printString("The no of threads has not been specified, defaulting to 1\n"); System.printString(" " + "\n"); nthreads = 1; - workload=100; + workload=300; } // JGFInstrumentor instr = new JGFInstrumentor(); -- 2.34.1