add option to skip prefetches for method...
authorbdemsky <bdemsky>
Fri, 21 Mar 2008 21:24:15 +0000 (21:24 +0000)
committerbdemsky <bdemsky>
Fri, 21 Mar 2008 21:24:15 +0000 (21:24 +0000)
Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply.java
Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/MethodDescriptor.java
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/buildscript

index 6d7de25002ae8416bd2b879117a0fbeb811ef9c1..f35dbb25d79b0200dc30117fa08b13397ea8179e 100644 (file)
@@ -44,17 +44,17 @@ public class MatrixMultiply extends Thread{
        }
 
        public static void main(String[] args) {
-               int mid1 = (128<<24)|(195<<16)|(175<<8)|70;
+               int mid1 = (128<<24)|(195<<16)|(175<<8)|73;
                int mid2 = (128<<24)|(195<<16)|(175<<8)|69;
                int mid3 = (128<<24)|(195<<16)|(175<<8)|71;
-               int NUM_THREADS = 2;
+               int NUM_THREADS = 1;
                int i, j, p, q, r;
                MatrixMultiply[] mm;
                MatrixMultiply tmp;
                MMul matrix;
 
                atomic {
-                       matrix = global new MMul(800, 800, 800);
+                       matrix = global new MMul(400, 400, 400);
                        matrix.setValues();
                        matrix.transpose();
                }
@@ -64,8 +64,7 @@ public class MatrixMultiply extends Thread{
                }
 
                atomic {
-                       mm[0] = global new MatrixMultiply(matrix,0,0,799,300);
-                       mm[1] = global new MatrixMultiply(matrix,0,301,799,799);
+                       mm[0] = global new MatrixMultiply(matrix,0,0,399,399);
                }
 
                atomic {
index 1910ce11f16b528d4d5325aa1e0b747ccbab53c2..c426454016f62b9c944ed5212326d1e57c186aeb 100644 (file)
@@ -1,6 +1,6 @@
 MAINCLASS=MatrixMultiply
 SRC=${MAINCLASS}.java
-FLAGS=-dsm -prefetch -nooptimize -debug -mainclass ${MAINCLASS} -o ${MAINCLASS}
+FLAGS=-dsm -prefetch -optimize -profile -debug -mainclass ${MAINCLASS} -o ${MAINCLASS}
 default:
        ../../../buildscript ${FLAGS} ${SRC}
 clean:
index ca41c728624f9ceb0c3bbfad37adae3b6f67bfdd..c7c7e61c7e7f7f848cf2ed5690ee2cf1cec339ed 100644 (file)
@@ -1422,7 +1422,8 @@ public class BuildCode {
            generateFlatFlagActionNode(fm, lb, (FlatFlagActionNode) fn, output);
            return;
        case FKind.FlatPrefetchNode:
-           generateFlatPrefetchNode(fm,lb, (FlatPrefetchNode) fn, output);
+           if (!state.excprefetch.contains(fm.getMethod().getClassMethodName()))
+               generateFlatPrefetchNode(fm,lb, (FlatPrefetchNode) fn, output);
            return;
        }
        throw new Error();
index 1f781f3fce3d63157925bea63c873f597adbd186..6091ea5a16a9228eb9c128100e4f84a27e62e003 100644 (file)
@@ -84,6 +84,10 @@ public class MethodDescriptor extends Descriptor {
        return thisvd;
     }
 
+    public String getClassMethodName() {
+       return cd+"."+name;
+    }
+
     public String getSafeMethodDescriptor() {
        String st="";
        for(int i=0;i<numParameters();i++) {
index f67a6e56c7917cb7c40f07282e7d5f7373e89b2f..679d93f8ece5e58b1d272edd61918f313af6d420 100644 (file)
@@ -16,6 +16,7 @@ public class State {
        this.arraytonumber=new Hashtable();
        this.tagmap=new Hashtable();
        this.selfloops=new HashSet();
+       this.excprefetch=new HashSet();
     }
 
     public void addParseNode(ParseNode parsetree) {
@@ -61,6 +62,7 @@ public class State {
     public String main;
 
     public HashSet selfloops;
+    public HashSet excprefetch;
     public SymbolTable classes;
     public SymbolTable tasks;
     public Set parsetrees;
index 4f22f88b9d414c1ec3e71ff68db58217c0aaa166..b8f2b039e8454e7647e6d621655f7d6ae3d03aa3 100644 (file)
@@ -59,6 +59,8 @@ public class Main {
              IR.Flat.BuildCode.PREFIX=args[++i]+"/";
          else if (option.equals("-selfloop"))
              state.selfloops.add(args[++i]);
+         else if (option.equals("-excprefetch"))
+             state.excprefetch.add(args[++i]);
          else if (option.equals("-classlibrary"))
              ClassLibraryPrefix=args[++i]+"/";
          else if (option.equals("-mainclass"))
index 3ff1fd5de872d8e8c6efd0e0d75a593e953611c6..b817220029a201ddf3fea3c73b5bd6cd557dad33 100755 (executable)
@@ -8,6 +8,7 @@ echo -dmalloc link in dmalloc
 echo -recover compile task code
 echo -specdir directory
 echo -selfloop task - this task cannot self loop forever
+echo -excprefetch methoddescriptor - exclude prefetches for this method
 echo -taskstate do task state analysis
 echo -tagstate do tag state analysis
 echo -scheduling do task scheduling
@@ -69,6 +70,10 @@ elif [[ $1 = '-selfloop' ]]
 then
 JAVAOPTS="$JAVAOPTS -selfloop $2"
 shift
+elif [[ $1 = '-excprefetch' ]]
+then
+JAVAOPTS="$JAVAOPTS -excprefetch $2"
+shift
 elif [[ $1 = '-dsm' ]]
 then
 JAVAOPTS="$JAVAOPTS -dsm"