From: jzhou Date: Thu, 2 Jul 2009 23:35:24 +0000 (+0000) Subject: Changes of benchmarks regarding tilera version X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83dd61abe62efe9b6c9796590295a64c9a3e9dd7;p=IRC.git Changes of benchmarks regarding tilera version --- diff --git a/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java b/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java index 5c08c45f..d8d0a14d 100644 --- a/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java +++ b/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java @@ -1,10 +1,10 @@ task t1(StartupObject s{initialstate}) { //System.printString("task t1\n"); - int N_sim=1200; + int N_sim=1200 * 6; int N_samp=8; - int N_ch=16; - int N_col=128; + int N_ch=62 * 2; //16; + int N_col=128 * 6; int i,j; for(j = 0; j < N_ch; j++) { diff --git a/Robust/src/Benchmarks/Scheduling/Fractal/Fractal.java b/Robust/src/Benchmarks/Scheduling/Fractal/Fractal.java index 744fdbcd..75f406eb 100644 --- a/Robust/src/Benchmarks/Scheduling/Fractal/Fractal.java +++ b/Robust/src/Benchmarks/Scheduling/Fractal/Fractal.java @@ -3,16 +3,24 @@ task t1(StartupObject s{initialstate}) { //System.printString("task t1\n"); - int width = 160; - int height = 160; - int group = 16; + int width = 62 * 15 * 2; + int height = 62 * 16; + int group = 62 * 2; - int h = height / group; + //int h = height / group; + //Random rnd = new Random(); + //int maxint = (~0x1) + 1; + int red = 255; //(int)(((float)rnd.nextInt()/maxint)*255); + int green = 237; //(int)(((float)rnd.nextInt()/maxint)*255); + int blue = 100; //(int)(((float)rnd.nextInt()/maxint)*255); for(int i = 0; i < group; i++) { Fractal fratal = new Fractal(i, group, width, - height){run}; + height, + red, + green, + blue){run}; } Image image = new Image(group){!finish}; @@ -62,7 +70,10 @@ public class Fractal { public Fractal(int index, int group, int width, - int height) { + int height, + int red, + int green, + int blue) { this.id = index; this.group = group; this.AppletWidth = width; @@ -74,9 +85,9 @@ public class Fractal { this.alen = (float)3.0;//this.amax - this.amin; this.blen = (float)3.0;//this.bmax - this.bmin; this.alpha = 0xff; - this.red = 0xff; - this.green = 0xff; - this.blue = 0xff; + this.red = red; + this.green = green; + this.blue = blue; this.times = 255; int length = this.AppletWidth * this.AppletHeight / this.group; this.pixels = new int[length]; @@ -85,11 +96,6 @@ public class Fractal { while (incr < length) { ps[incr++] = this.alpha<<24 | 0x00<<16 | 0x00<<8 | 0xff; } - Random rnd = new Random(); - int maxint = (1<<32) - 1; - red = (int)(((float)rnd.nextInt()/maxint)*255); - green = (int)(((float)rnd.nextInt()/maxint)*255); - blue = (int)(((float)rnd.nextInt()/maxint)*255); } public void run () { @@ -136,10 +142,10 @@ public class Fractal { if(iteration<=times & iteration>0) { scaleda=(int)((a - amin)*appletWidth/(amax - amin)); scaledb=(int)((b - bmin)*appletHeight/(bmax - bmin)); - int index = (scaledb * appletWidth + scaleda - id) / group; - if(index < length) { + int index = ((scaledb - id) / group) * appletWidth + scaleda; //(scaledb * appletWidth + scaleda - id) / group; + //if(index < length) { ps[index] = alpha<<24 | red<<16 | iteration<<8 | blue; - } + //} } } } diff --git a/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/JGFMonteCarloBench.java b/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/JGFMonteCarloBench.java index b4d71b64..1d6cb0de 100644 --- a/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/JGFMonteCarloBench.java +++ b/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/JGFMonteCarloBench.java @@ -24,8 +24,8 @@ task t1(StartupObject s{initialstate}) { //System.printString("task t1\n"); int datasize = 1000; //should be times of 2 - int nruns = 16 * 16; - int group = 16; + int nruns = 62 * 7 * 2; //16 * 16; + int group = 62 * 2; // 16; AppDemo ad = new AppDemo(datasize, nruns, group){merge}; diff --git a/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/RatePath.java b/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/RatePath.java index cad1bd6a..a18046fd 100644 --- a/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/RatePath.java +++ b/Robust/src/Benchmarks/Scheduling/JGFMonteCarlo/RatePath.java @@ -30,7 +30,7 @@ * * * @author H W Yau - * @version $Revision: 1.2 $ $Date: 2009/02/13 21:37:19 $ + * @version $Revision: 1.3 $ $Date: 2009/07/02 23:35:24 $ */ public class RatePath extends PathId { @@ -365,7 +365,7 @@ public class RatePath extends PathId { // Now create an array to store the rates data. int minimumdate = MINIMUMDATE; float epsilon = EPSILON; - int nLines = 200; + int nLines = 1000; //200; int year = 88; int month = 10; int day = 3; @@ -389,8 +389,8 @@ public class RatePath extends PathId { /*for(int di = 0; di < 9; di++) { aDate = aDate * 10 + (int)date[di]; }*/ - for(int k = 0; k < 40; k++ ) { - for(int j = 0; j < 5; j++) { + for(int k = 0; k < 20; /*40;*/ k++ ) { + for(int j = 0; j < 50; /*5;*/ j++) { /*String date = "19"+String.valueOf(year); if(month < 10) { date += "0"; diff --git a/Robust/src/Benchmarks/Scheduling/JGFSeries/JGFSeriesBench.java b/Robust/src/Benchmarks/Scheduling/JGFSeries/JGFSeriesBench.java index adb5e0ce..ff6941c1 100644 --- a/Robust/src/Benchmarks/Scheduling/JGFSeries/JGFSeriesBench.java +++ b/Robust/src/Benchmarks/Scheduling/JGFSeries/JGFSeriesBench.java @@ -23,11 +23,13 @@ task t1(StartupObject s{initialstate}) { //System.printString("task t1\n"); - int datasize = 16; - for(int i = 0; i < datasize; ++i) { - SeriesRunner sr = new SeriesRunner(i){!finish}; + int datasize = 62 * 2000; + int threadnum = 62; + int range = datasize / threadnum; + for(int i = 0; i < threadnum; ++i) { + SeriesRunner sr = new SeriesRunner(i, range){!finish}; } - + taskexit(s{!initialstate}); } diff --git a/Robust/src/Benchmarks/Scheduling/JGFSeries/SeriesRunner.java b/Robust/src/Benchmarks/Scheduling/JGFSeries/SeriesRunner.java index ec8513b6..84fa5036 100644 --- a/Robust/src/Benchmarks/Scheduling/JGFSeries/SeriesRunner.java +++ b/Robust/src/Benchmarks/Scheduling/JGFSeries/SeriesRunner.java @@ -38,46 +38,53 @@ public class SeriesRunner { flag finish; int id; + int range; - public SeriesRunner(int id){ + public SeriesRunner(int id, int range){ this.id=id; + this.range = range; } public void run() { - float pair[] = new float[2]; + float pair[][] = new float[2][range]; // Calculate the fourier series. Begin by calculating A[0]. if (id==0) { - pair[0] = TrapezoidIntegrate((float)0.0, //Lower bound. + pair[0][0] = TrapezoidIntegrate((float)0.0, //Lower bound. (float)2.0, // Upper bound. 1000, // # of steps. (float)0.0, // No omega*n needed. 0) / (float)2.0; // 0 = term A[0]. - pair[1] = 0; - } else { - // Calculate the fundamental frequency. - // ( 2 * pi ) / period...and since the period - // is 2, omega is simply pi. - float omega = (float) 3.1415926535897932; // Fundamental frequency. - + pair[1][0] = 0; + } + // Calculate the fundamental frequency. + // ( 2 * pi ) / period...and since the period + // is 2, omega is simply pi. + float omega = (float) 3.1415926535897932; // Fundamental frequency. + + int ilow = id*range; + if(id==0) ilow += 1; + int iupper = (id+1)*range; + for(int i = ilow; i < iupper; i++) { + int j = i-id*range; // Calculate A[i] terms. Note, once again, that we // can ignore the 2/period term outside the integral // since the period is 2 and the term cancels itself // out. - pair[0] = TrapezoidIntegrate((float)0.0, + pair[0][j] = TrapezoidIntegrate((float)0.0, (float)2.0, 1000, - omega * (float)id, + omega * (float)i, 1); // 1 = cosine term. // Calculate the B[i] terms. - pair[1] = TrapezoidIntegrate((float)0.0, + pair[1][j] = TrapezoidIntegrate((float)0.0, (float)2.0, 1000, - omega * (float)id, + omega * (float)i, 2); // 2 = sine term. } // validate - if(id < 4) { + if(id == 0) { float ref[][] = new float[4][2]; ref[0][0] = (float)2.87290112; ref[0][1] = (float)0.0; @@ -87,19 +94,21 @@ public class SeriesRunner { ref[2][1] = (float)-1.16458096; ref[3][0] = (float)0.15222694; ref[3][1] = (float)-0.81435320; - for (int j = 0; j < 2; j++){ - float error = Math.abs(pair[j] - ref[id][j]); - if (error > 1.0e-7 ){ - //System.printI(0xa7); - //System.printString("Validation failed for coefficient " + j + "," + id + "\n"); - //System.printString("Computed value = " + (int)(pair[j]*100000000) + "\n"); - //System.printString("Reference value = " + (int)(ref[id][j]*100000000) + "\n"); - //System.printI((int)(pair[j]*10000)); - //System.printI((int)(ref[id][j]*10000)); + for(int i = 0; i < 4; i++) { + for (int j = 0; j < 2; j++){ + float error = Math.abs(pair[j][i] - ref[i][j]); + if (error > 1.0e-7 ){ + //System.printI(0xa7); + //System.printString("Validation failed for coefficient " + j + "," + id + "\n"); + //System.printString("Computed value = " + (int)(pair[j]*100000000) + "\n"); + //System.printString("Reference value = " + (int)(ref[id][j]*100000000) + "\n"); + //System.printI((int)(pair[j]*10000)); + //System.printI((int)(ref[id][j]*10000)); + } + } } - } - } } + } /* * TrapezoidIntegrate diff --git a/Robust/src/Benchmarks/Scheduling/workload.txt b/Robust/src/Benchmarks/Scheduling/workload.txt new file mode 100644 index 00000000..9b563e57 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/workload.txt @@ -0,0 +1,105 @@ +JGFSeries: + Single: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int datasize = 62*2000; + int threadnum = 62; + ... + } + + Double: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int datasize = 62*2000 *2; + int threadnum = 62 * 2; + ... + } + + +FilterBank: + Single: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int N_sim=1200 * 6; + int N_samp=8; + int N_ch=62; + int N_col=128 * 6; + ... + } + + + Double: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int N_sim=1200 * 6; + int N_samp=8; + int N_ch=62 * 2; + int N_col=128 * 6; + ... + } + + +Fractal: + Single: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int width = 62 * 15; + int height = 62 * 17; + int group = 62; + ... + } + + Double: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int width = 62 * 15 * 2; + int height = 62 * 17; + int group = 62 * 2; + ... + } + + +JGFMonteCarlo: + Single: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int datasize = 1000; //should be times of 2 + int nruns = 62 * 7 ; + int group = 62; + ... + } + + in RatePath.java + private void readRatesFile(){ + // + // Now create an array to store the rates data. + ... + int nLines = 1000; + ... + } + + Double: + task t1(StartupObject s{initialstate}) { + //System.printString("task t1\n"); + + int datasize = 1000; //should be times of 2 + int nruns = 62 * 14 ; + int group = 62 * 2; + ... + } + + in RatePath.java + private void readRatesFile(){ + // + // Now create an array to store the rates data. + ... + int nLines = 1000; + ... + }