state.excprefetch.add(args[++i]);
else if (option.equals("-classlibrary"))
ClassLibraryPrefix=args[++i]+"/";
+ else if(option.equals("-numcore")) {
+ ++i;
+ state.CORENUM = Integer.parseInt(args[i]);
+ }
else if (option.equals("-mainclass"))
state.main=args[++i];
else if (option.equals("-trueprob")) {
state.OWNERSHIP=true;
else if (option.equals("-optional"))
state.OPTIONAL=true;
- /*else if (option.equals("-raw"))
- state.RAW=true;*/
+ else if (option.equals("-raw"))
+ state.RAW=true;
else if (option.equals("-scheduling"))
state.SCHEDULING=true;
else if (option.equals("-thread"))
readSourceFile(state, ClassLibraryPrefix+"HashEntry.java");
readSourceFile(state, ClassLibraryPrefix+"Integer.java");
readSourceFile(state, ClassLibraryPrefix+"StringBuffer.java");
+ //if(!state.RAW) {
readSourceFile(state, ClassLibraryPrefix+"FileInputStream.java");
readSourceFile(state, ClassLibraryPrefix+"InputStream.java");
readSourceFile(state, ClassLibraryPrefix+"OutputStream.java");
readSourceFile(state, ClassLibraryPrefix+"FileOutputStream.java");
readSourceFile(state, ClassLibraryPrefix+"File.java");
- readSourceFile(state, ClassLibraryPrefix+"Math.java");
readSourceFile(state, ClassLibraryPrefix+"InetAddress.java");
readSourceFile(state, ClassLibraryPrefix+"SocketInputStream.java");
readSourceFile(state, ClassLibraryPrefix+"SocketOutputStream.java");
+ //}
+ readSourceFile(state, ClassLibraryPrefix+"Math.java");
readSourceFile(state, ClassLibraryPrefix+"gnu/Random.java");
readSourceFile(state, ClassLibraryPrefix+"Vector.java");
readSourceFile(state, ClassLibraryPrefix+"Enumeration.java");
-
if (state.TASK) {
readSourceFile(state, ClassLibraryPrefix+"Object.java");
readSourceFile(state, ClassLibraryPrefix+"TagDescriptor.java");
} else if (state.DSM) {
readSourceFile(state, ClassLibraryPrefix+"ThreadDSM.java");
readSourceFile(state, ClassLibraryPrefix+"ObjectJavaDSM.java");
+ readSourceFile(state, ClassLibraryPrefix+"Barrier.java");
} else {
if (state.THREAD) {
readSourceFile(state, ClassLibraryPrefix+"Thread.java");
BuildFlat bf=new BuildFlat(state,tu);
bf.buildFlat();
SafetyAnalysis sa=null;
+ PrefetchAnalysis pa=null;
if (state.TAGSTATE) {
CallGraph callgraph=new CallGraph(state);
//int newRate = tint;
//int newRate = (j+1)%2+1;
int newRate = 1;
+ String cdname = cd.getSymbol();
+ if((cdname.equals("SeriesRunner")) ||
+ (cdname.equals("MDRunner"))) {
+ newRate = 16;
+ } else if(cdname.equals("SentenceParser")) {
+ newRate = 4;
+ } /*else if(cdname.equals("ReduceWorker")) {
+ newRate = 3;
+ }*/
/*do {
tint = r.nextInt()%100;
} while(tint <= 0);
/*do {
tint = r.nextInt()%10;
} while(tint <= 0);*/
- tint = 1;
+ tint = 3;
((FEdge)it_edges.next()).setExeTime(tint);
}
}
scheduleAnalysis.preSchedule();
scheduleAnalysis.scheduleAnalysis();
//scheduleAnalysis.setCoreNum(scheduleAnalysis.getSEdges4Test().size());
- scheduleAnalysis.setCoreNum(1);
- //scheduleAnalysis.setCoreNum(2);
+ scheduleAnalysis.setCoreNum(state.CORENUM);
scheduleAnalysis.schedule();
//simulate these schedulings
}
System.out.print("Selected schedulings with least exectution time " + processTime + ": \n\t");
for(int i = 0; i < selectedScheduling.size(); i++) {
- System.out.print(selectedScheduling.elementAt(i) + ", ");
+ System.out.print((selectedScheduling.elementAt(i) + 1) + ", ");
}
System.out.println();
}
if(state.MULTICORE) {
- it_scheduling = scheduleAnalysis.getSchedulingsIter();
- Vector<Schedule> scheduling = (Vector<Schedule>)it_scheduling.next();
- BuildCodeMultiCore bcm=new BuildCodeMultiCore(state, bf.getMap(), tu, sa, scheduling, scheduleAnalysis.getCoreNum());
+ //it_scheduling = scheduleAnalysis.getSchedulingsIter();
+ //Vector<Schedule> scheduling = (Vector<Schedule>)it_scheduling.next();
+ Vector<Schedule> scheduling = scheduleAnalysis.getSchedulings().elementAt(selectedScheduling.elementAt(0));
+ BuildCodeMultiCore bcm=new BuildCodeMultiCore(state, bf.getMap(), tu, sa, scheduling, scheduleAnalysis.getCoreNum(), pa);
bcm.buildCode();
}
}
if (state.DSM) {
CallGraph callgraph=new CallGraph(state);
if (state.PREFETCH) {
- PrefetchAnalysis pa=new PrefetchAnalysis(state, callgraph, tu);
+ //speed up prefetch generation using locality analysis results
+ LocalityAnalysis la=new LocalityAnalysis(state, callgraph, tu);
+ pa=new PrefetchAnalysis(state, callgraph, tu, la);
}
+
LocalityAnalysis la=new LocalityAnalysis(state, callgraph, tu);
GenerateConversions gc=new GenerateConversions(la, state);
- BuildCode bc=new BuildCode(state, bf.getMap(), tu, la);
+ BuildCode bc=new BuildCode(state, bf.getMap(), tu, la, pa);
bc.buildCode();
} else {
- BuildCode bc=new BuildCode(state, bf.getMap(), tu, sa);
+ BuildCode bc=new BuildCode(state, bf.getMap(), tu, sa, pa);
bc.buildCode();
}
}
int allocationDepth = 3;
OwnershipAnalysis oa =
new OwnershipAnalysis( state, callGraph, allocationDepth );
+ //This was breaking the compile
+ // oa.writeAllAliases( "identifiedAliases.txt" );
}
System.exit(0);