more changes
authorbdemsky <bdemsky>
Tue, 25 Mar 2008 02:13:14 +0000 (02:13 +0000)
committerbdemsky <bdemsky>
Tue, 25 Mar 2008 02:13:14 +0000 (02:13 +0000)
Robust/src/Analysis/Prefetch/PrefetchAnalysis.java
Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/Main/Main.java

index 3e808081babf2fd24bf23dd0a6d5731c271a658d..f72517a50c0f6133e499c0e6f45c7805033acbaa 100644 (file)
@@ -102,20 +102,21 @@ public class PrefetchAnalysis {
 
        /** This function calls analysis for every method in a class */
        private void doMethodAnalysis(ClassDescriptor cn) {
-               Iterator methodit=cn.getMethods();
-               while(methodit.hasNext()) {
-                       Hashtable<FlatNode, HashSet<PrefetchPair>> newprefetchset = new Hashtable<FlatNode, HashSet<PrefetchPair>>();
-                       MethodDescriptor md=(MethodDescriptor)methodit.next();
-                       FlatMethod fm=state.getMethodFlat(md);
-                       doFlatNodeAnalysis(fm);
-                       doInsPrefetchAnalysis(fm, newprefetchset);
-                       if(newprefetchset.size() > 0) {
-                               addFlatPrefetchNode(newprefetchset);
-                       }
-                       newprefetchset = null;
-               }
+           for (Iterator methodit=cn.getMethods();methodit.hasNext();) {
+               MethodDescriptor md=(MethodDescriptor)methodit.next();
+               if (state.excprefetch.contains(md.getClassMethodName()))
+                   continue; //Skip this method
+               Hashtable<FlatNode, HashSet<PrefetchPair>> newprefetchset = new Hashtable<FlatNode, HashSet<PrefetchPair>>();
+               FlatMethod fm=state.getMethodFlat(md);
+               doFlatNodeAnalysis(fm);
+               doInsPrefetchAnalysis(fm, newprefetchset);
+               if(newprefetchset.size() > 0) {
+                   addFlatPrefetchNode(newprefetchset);
+               }
+               newprefetchset = null;
+           }
        }
-
+    
        /** This function calls analysis for every node in a method */
        private void doFlatNodeAnalysis(FlatMethod fm) {
                tovisit = fm.getNodeSet(); 
index f37a045996bd5ec30d7b67e2db1b931ae38db834..2995827f49b673471a3049c770c7fd9378f1731f 100644 (file)
@@ -1,6 +1,6 @@
 MAINCLASS=MatrixMultiply
 SRC=${MAINCLASS}.java
-FLAGS=-dsm -prefetch -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8
+FLAGS=-dsm -prefetch -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.5
 FLAGS2=-dsm -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS}NP
 default:
        ../../../buildscript ${FLAGS2} ${SRC}
index 19e39ccf808a0179bf1d025aa1aa54ab8467e3db..5515266dead98e32ccfd6ae23820a23bffe953b1 100644 (file)
@@ -1435,16 +1435,11 @@ public class BuildCode {
     }
  
     public void generateFlatPrefetchNode(FlatMethod fm, LocalityBinding lb, FlatPrefetchNode fpn, PrintWriter output) {
-       Vector oids = new Vector();
-       Vector fieldoffset = new Vector();
-       Vector endoffset = new Vector();
-       int tuplecount = 0;  //Keeps track of number of prefetch tuples that need to be generated
-       
        if (state.PREFETCH) {
-           output.println("{");
-           output.println("/* prefetch */");
-           output.println("void * prefptr;");
-           output.println("int tmpindex;");
+           Vector oids = new Vector();
+           Vector fieldoffset = new Vector();
+           Vector endoffset = new Vector();
+           int tuplecount = 0;  //Keeps track of number of prefetch tuples that need to be generated
            for(Iterator it = fpn.hspp.iterator();it.hasNext();) {
                PrefetchPair pp = (PrefetchPair) it.next();
                Integer statusbase = locality.getNodePreTempInfo(lb,fpn).get(pp.base);
@@ -1460,8 +1455,10 @@ public class BuildCode {
            }
            if (tuplecount==0)
                return;
-           
-           
+           output.println("{");
+           output.println("/* prefetch */");
+           output.println("void * prefptr;");
+           output.println("int tmpindex;");
            /*Create C code for oid array */
            output.print("   unsigned int oidarray_[] = {");
            boolean needcomma=false;
index b06f3154498f2eab83d6933bcac46aea91f78560..ef0c3d1a197713d5f0a4f2902d284482a94d19c6 100644 (file)
@@ -65,9 +65,9 @@ public class Main {
              ClassLibraryPrefix=args[++i]+"/";
          else if (option.equals("-mainclass"))
              state.main=args[++i];
-         else if (option.equals("-trueprob"))
+         else if (option.equals("-trueprob")) {
              state.TRUEPROB=Double.parseDouble(args[++i]);
-         else if (option.equals("-printflat"))
+         else if (option.equals("-printflat"))
              State.PRINTFLAT=true;
          else if (option.equals("-struct"))
              state.structfile=args[++i];