lss.i_stop = stop;
}
+
/* =============================================================================
* createTaskList
* -- baseLogLikelihoods and taskListPtr are updated
#!/bin/bash
cd KMeans
-make &
+make
cd ..
cd SSCA2
-make &
+make
cd ..
cd Labyrinth3D
-make &
+make
cd ..
cd Genome
-make &
+make
cd ..
cd Intruder
-make &
+make
cd ..
cd Bayes
-make &
+make
cd ..
cd Vacation
-make &
+make
cd ..
cd Yada
-make &
+make
cd ..
cd LeeRouting
-make &
+make
cd ..
\ No newline at end of file
/** Boolean flag which indicates whether compiler is compiling a task-based
* program. */
+ public boolean COREPROF=false;
public boolean WEBINTERFACE=false;
public boolean MINIMIZE=false;
public boolean TASK=false;
} else if (option.equals("-methodeffects")) {
state.METHODEFFECTS=true;
+
+ } else if (option.equals("-coreprof")) {
+ state.COREPROF=true;
} else if (option.equals("-ooojava")) {
state.OOOJAVA = true;
./ourjavac -cp ../cup:.:$(CLASSPATH) Main/Main.java
wc:
- wc Interface/*.java Analysis/*/*.java IR/*.java IR/*/*.java Lex/*.java Util/*.java ClassLibrary/*.java
+ wc Interface/*.java Analysis/*/*.java IR/*.java IR/*/*.java Lex/*.java Util/*.java ClassLibrary/*.java Main/*.java
wcrun:
- wc Runtime/*.[c,h] Runtime/DSTM/interface/*.[c,h] Runtime/STM/*.[c,h]
+ wc Runtime/*.[c,h] Runtime/DSTM/interface*/*.[c,h] Runtime/STM/*.[c,h]
Parse/Parser.java Parse/Sym.java: Parse/java14.cup
cd Parse && \
--- /dev/null
+#include "runtime.h"
+#include "coreprof.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "mlp_lock.h"
+
+__thread struct coreprofmonitor * cp_events;
+struct coreprofmonitor * cp_eventlist=NULL;
+static volatile int cp_threadcount=0;
+__thread int threadnum;
+
+//Need to have global lock before calling this method
+void createprofiler() {
+ struct coreprofmonitor *event=calloc(1, sizeof(struct coreprofmonitor));
+ //add new eventmonitor to list
+ struct coreprofmonitor *tmp;
+
+ //add ourself to the list
+ do {
+ tmp=cp_eventlist;
+ event->next=tmp;
+ } while(CAS(&cp_eventlist, tmp, event)!=tmp);
+
+ int ourcount=atomic_inc(&cp_threadcount);
+ cp_threadnum=ourcount;
+
+ //point thread lock variable to eventmonitor
+ cp_events=event;
+ CPLOGEVENT((CP_START<<CP_BASE_SHIFT)|CP_BEGIN);
+}
+
+void cpwritedata(int fd, char * buffer, int count) {
+ int offset=0;
+ while(count>0) {
+ int size=write(fd, &buffer[offset], count);
+ offset+=size;
+ count-=size;
+ }
+}
+
+void dumpprofiler() {
+ int fd=open("logdata",O_RDWR|O_CREAT,S_IRWXU);
+ int count=0;
+ struct coreprofmonitor * ptr=cp_eventlist;
+ int VERSION=0;
+ //Write version number
+ cpwritedata(fd, &version, sizeof(int));
+ while(ptr!=NULL) {
+ count++;
+ if (ptr->index>CPMAXEVENTS) {
+ printf("ERROR: EVENT COUNT EXCEEDED\n");
+ }
+ ptr=ptr->next;
+ }
+
+ //Write the number of threads
+ cpwritedata(fd, (char *)&count, sizeof(int));
+
+ //Write the number of events for each thread
+ ptr=cp_eventlist;
+ while(ptr!=NULL) {
+ cpwritedata(fd, &ptr->index, sizeof(int));
+ ptr=ptr->next;
+ }
+
+ //Dump the data
+ ptr=cp_eventlist;
+ while(ptr!=NULL) {
+ cpwritedata(fd, (char *) ptr->value, sizeof(int)*ptr->index);
+ ptr=ptr->next;
+ }
+ close(fd);
+}
--- /dev/null
+#ifndef COREPROF_H
+#define COREPROF_H
+
+#ifndef CPMAXEVENTS
+#define CPMAXEVENTS (1024*1024*128)
+#endif
+
+#define CP_BEGIN 0
+#define CP_END 1
+#define CP_EVENT 2
+#define CP_MASK 3
+#define CP_BASE_SHIFT 2
+
+#define CP_MAIN 0
+
+struct coreprofmonitor {
+ int index;
+ struct coreprofmonitor * next;
+ unsigned int value[MAXEVENTS];
+};
+
+extern __thread int cp_threadnum;
+extern __thread struct coreprofmonitor * cp_events;
+extern struct coreprofmonitor * cp_eventlist;
+void createprofiler();
+void dumpprofiler();
+
+#define CPLOGTIME *((long long *)&cp_events->value[cp_events->index])=rdtsc(); \
+ cp_events->index+=2;
+
+#define CPLOGEVENT(x) { CP_events->value[cp_events->index++]=x; \
+ CPLOGTIME \
+ }
+#endif
echo "-numa numa aware"
echo "-eventmonitor turn on transaction event trace recording"
echo
+echo OOOJava options
+echo -coreprof turn on profiling API
+echo -ooojava numberofcores maxseseage
+echo -mlp <num cores> <max sese age> build mlp code
+echo -mlpdebug if mlp, report progress and interim results
+echo
echo DSM options
echo -dsm distributed shared memory
echo -abortreaders abort readers immediately
echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
echo -printscheduling print out scheduling graphs
echo -printschedulesim print out scheduling simulator result graphs
-echo -abcclose close the array boundary check
echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
echo
echo Other options
+echo -abcclose turnoff array boundary checks
echo -builddir setup different build directory
echo -robustroot set up the ROBUSTROOT to directory other than default one
echo -readset turn on readset
}
tmpbuilddirectory="tmpbuilddirectory"
+COREPROF=false;
NUMA=false;
SANDBOX=false;
ABORTREADERS=false;
shift
shift
+elif [[ $1 = '-coreprof' ]]
+then
+COREPROF=true
+JAVAOPTS="$JAVAOPTS -coreprof"
+EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF"
+shift
+shift
+
elif [[ $1 = '-mlp' ]]
then
MLP_ON=true
FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
fi
+if $COREPROF
+then
+FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
+fi
+
if $MLP_ON
then
FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"