/** 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();
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}
}
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);
}
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;
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];