From: bdemsky Date: Sun, 1 Aug 2010 04:06:27 +0000 (+0000) Subject: new benchmark X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d310a4a3c4e6b49cfb86317fc1a308810c7297d6;p=IRC.git new benchmark --- diff --git a/Robust/src/Benchmarks/oooJava/sor/JGFInstrumentor.java b/Robust/src/Benchmarks/oooJava/sor/JGFInstrumentor.java new file mode 100644 index 00000000..bfacd31f --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/sor/JGFInstrumentor.java @@ -0,0 +1,200 @@ +/************************************************************************** + * * + * Java Grande Forum Benchmark Suite - Thread Version 1.0 * + * * + * produced by * + * * + * Java Grande Benchmarking Project * + * * + * at * + * * + * Edinburgh Parallel Computing Centre * + * * + * email: epcc-javagrande@epcc.ed.ac.uk * + * * + * * + * This version copyright (c) The University of Edinburgh, 1999. * + * All rights reserved. * + * * + **************************************************************************/ +import java.util.*; +public class JGFInstrumentor{ + + protected HashMap timers; + protected HashMap data; + + public JGFInstrumentor() { + timers = new HashMap(); + data = new HashMap(); + } + + public static void addTimer (String name, HashMap timers){ + + if (timers.containsKey(name)) { + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists"); + } + else { + timers.put(name, new JGFTimer(name)); + } + } + + public static void addTimer (String name, String opname, HashMap timers){ + + if (timers.containsKey(name)) { + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists"); + } + else { + timers.put(name, new JGFTimer(name,opname)); + } + + } + + public static void addTimer (String name, String opname, int size, HashMap timers){ + + if (timers.containsKey(name)) { + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists"); + } + else { + timers.put(name, new JGFTimer(name,opname,size)); + } + + } + + public static void startTimer(String name, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).start(); + } + else { + System.printString("JGFInstrumentor.startTimer: failed - timer " + name + + " does not exist"); + } + + } + + public static void stopTimer(String name, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).stop(); + } + else { + System.printString("JGFInstrumentor.stopTimer: failed - timer " + name + + " does not exist"); + } + } + + public static void addOpsToTimer(String name, double count, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).addops(count); + } + else { + System.printString("JGFInstrumentor.addOpsToTimer: failed - timer " + name + + " does not exist"); + } + } + + public static void addTimeToTimer(String name, double added_time, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).addtime(added_time); + } + else { + System.printString("JGFInstrumentor.addTimeToTimer: failed - timer " + name + + " does not exist"); + } + + + + } + + public static double readTimer(String name, HashMap timers){ + double time; + if (timers.containsKey(name)) { + time = ((JGFTimer) timers.get(name)).time; + } + else { + System.printString("JGFInstrumentor.readTimer: failed - timer " + name + + " does not exist"); + time = 0.0; + } + return time; + } + + public static void resetTimer(String name, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).reset(); + } + else { + System.printString("JGFInstrumentor.resetTimer: failed - timer " + name + + " does not exist"); + } + } + + public static void printTimer(String name, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).print(); + } + else { + System.printString("JGFInstrumentor.printTimer: failed - timer " + name + + " does not exist"); + } + } + + public static void printperfTimer(String name, HashMap timers){ + if (timers.containsKey(name)) { + ((JGFTimer) timers.get(name)).printperf(); + } + else { + System.printString("JGFInstrumentor.printTimer: failed - timer " + name + + " does not exist"); + } + } + + public static void storeData(String name, Object obj, HashMap data){ + data.put(name,obj); + } + + public static void retrieveData(String name, Object obj, HashMap data){ + obj = data.get(name); + } + + public static void printHeader(int section, int size,int nthreads) { + + String header, base; + + header = ""; + base = "Java Grande Forum Thread Benchmark Suite - Version 1.0 - Section "; + + if (section == 1) + { + header = base + "1"; + } + else if (section == 2) + { + if (size == 0) + header = base + "2 - Size A"; + else if (size == 1) + header = base + "2 - Size B"; + else if (size == 2) + header = base + "2 - Size C"; + } + else if (section == 3) + { + if (size == 0) + header = base + "3 - Size A"; + else if (size == 1) + header = base + "3 - Size B"; + } + + System.printString(header); + + if (nthreads == 1) { + System.printString("Executing on " + nthreads + " thread"); + } + else { + System.printString("Executing on " + nthreads + " threads"); + } + + System.printString(""); + } +} diff --git a/Robust/src/Benchmarks/oooJava/sor/JGFSORBench.java b/Robust/src/Benchmarks/oooJava/sor/JGFSORBench.java new file mode 100644 index 00000000..c5d8c780 --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/sor/JGFSORBench.java @@ -0,0 +1,101 @@ +/************************************************************************** + * * + * Java Grande Forum Benchmark Suite - Thread Version 1.0 * + * * + * produced by * + * * + * Java Grande Benchmarking Project * + * * + * at * + * * + * Edinburgh Parallel Computing Centre * + * * + * email: epcc-javagrande@epcc.ed.ac.uk * + * * + * * + * This version copyright (c) The University of Edinburgh, 2001. * + * All rights reserved. * + * * + **************************************************************************/ +public class JGFSORBench { + + int size; + int[] datasizes; + int JACOBI_NUM_ITER; + long RANDOM_SEED; + public int nthreads; + public double Gtotal; + + public JGFSORBench(int nthreads){ + this.nthreads = nthreads; + datasizes = new int[4]; + datasizes[0] = 1000; + datasizes[1] = 1500; + datasizes[2] = 2000; + datasizes[3] = 8000; + JACOBI_NUM_ITER = 100; + RANDOM_SEED = 10101010; + Gtotal = 0.0; + } + + public void JGFsetsize(int size){ + this.size = size; + } + + public static void JGFkernel(JGFSORBench sor) { + int numthreads, datasize; + double[][] G; + int num_iterations; + long RANDOM_SEED; + + numthreads = sor.nthreads; + datasize = sor.datasizes[sor.size]; + G = new double[datasize][]; + num_iterations = sor.JACOBI_NUM_ITER; + RANDOM_SEED = sor.RANDOM_SEED; + + double omega = 1.25; + double omega_over_four = omega * 0.25; + double one_minus_omega = 1.0 - omega; + + // update interior points + // + //spawn threads + + SORWrap[] thobjects = new SORWrap[numthreads]; + + for(int i=0;i Mm1) iupper = Mm1+1; + if (tmpid == (numthreads-1)) iupper = Mm1+1; + G[0]=new double[N]; + for(int i=ilow;i4 and added q + + double [] Gi = G[i]; + double [] Gim1 = G[i-1]; + + if(i == 1) { + double [] Gip1 = G[i+1]; + + sese first { + for (int j=1; j4 + + double [] Gi = G[i]; + double [] Gim1 = G[i-1]; + + if(i == 1) { + } else if (i == Mm1) { + + double [] Gim2 = G[i-2]; + + sese three { + for (int j=1; j