FLAGS7 = -dsm -prefetch -dsmcaching -optimize -mainclass ${MAINCLASS4}
FLAGS8 = -dsm -dsmcaching -optimize -mainclass ${MAINCLASS4}
+simple:
+ ../../../buildscript -dsm -dsmcaching -optimize -mainclass Simple -o Simple Simple.java
+
default:
../../../buildscript ${FLAGS2} -o ${NAME1}NP ${SRC1}
cp ${NAME1}NP.bin ${NAME1}1NP.bin
FLAGSSTATS=-mainclass ${MAINCLASS} -singleTM -optimize -debug -joptimize -32bit -abcclose -dcopts -transstats -arraypad -stmstats
stmlock:
- ../../../buildscript ${FLAGSSTATS} -o STATS${MAINCLASS} ${SRC}
+ ../../../buildscript ${FLAGSSTATS} -abrt 0 -o STATS${MAINCLASS} ${SRC}
prep:
int arrysize;
int loopsize;
int lsize1, lsize2;
+ int prob; //prob to choose if short or long transaction
int threadid;
intwrapper[] mainobj;
Random rand;
}
- public SingleObjectMod(int nthreads, int arrysize, int loopsize, int lsize1, int lsize2, int threadid, intwrapper[] mainobj, Random rand) {
+ public SingleObjectMod(int nthreads, int arrysize, int loopsize, int lsize1, int lsize2, int prob, int threadid, intwrapper[] mainobj, Random rand) {
this.nthreads = nthreads;
this.arrysize = arrysize;
this.loopsize = loopsize;
this.lsize1 = lsize1;
this.lsize2 = lsize2;
+ this.prob = prob;
this.threadid = threadid;
this.mainobj = mainobj;
this.rand = rand;
if(i < args.length) {
som.lsize2 = new Integer(args[i++]).intValue();
}
+ } else if(arg.equals("-p")) {
+ if(i < args.length) {
+ som.prob = new Integer(args[i++]).intValue();
+ }
} else {
System.out.println("Incorrect argument");
- System.out.println("usage: ./SingleObjectMod -t <threads> -size <array size> -l <loopsize> -l1 <inner loopsize2> -l2 <inner loopsize2>\n");
+ System.out.println("usage: ./SingleObjectMod -t <threads> -size <array size> -l <loopsize> -l1 <inner loopsize2> -l2 <inner loopsize2> -p <prob distribution>\n");
}
}
}
stop = loopsize;
else
stop = start + partitionSize;
+ LogTime[] lt = new LogTime[8*(stop-start)];
+ for(int i = 0; i<8*(stop-start); i++) {
+ lt[i] = new LogTime();
+ }
+
+ int eventcount=0;
//System.out.println("Start = " + start+ " stop= " + stop + " partitionSize= " + partitionSize+ " loopsize= " + loopsize + " lsize1= " + lsize1 + " lsize2= " + lsize2);
+ rand.random_seed(0);
+ int l1, l2;
+ //Time at Point1
+ lt[eventcount].event = 1;
+ lt[eventcount++].time = System.getticks();
+
for(int i = start; i < stop; i++) {
+ //Time at Point2
+ lt[eventcount].event = 2;
+ lt[eventcount++].time = System.getticks();
+
+ int distribution = (int)(rand.random_generate() % 100);
+
+ //90% long transactions
+ if(distribution < prob) {
+ l1=l2=lsize1;
+ } else {
+ //10% short transactions
+ l1=l2=lsize2;
+ }
+
+ /*
+ //50% distribution
+ int l3= (int)(rand.random_generate() % 2);
+ if(l3==0) {
+ l1=l2=lsize2;
+ }
+ if(l3==1) {
+ l1=l2=lsize1;
+ }
+ */
+
int count;
+
+ //Time at point3
+ lt[eventcount].event = 3;
+ lt[eventcount++].time = System.getticks();
+
atomic {
+ //Time at Point4
+ lt[eventcount].event = 4;
+ lt[eventcount++].time = System.getticks();
+
index = (int)(rand.random_generate() % arrysize);
// Do computation 1
- for(int j = 0; j<lsize1; j++) {
- count+=j*j;
+ for(int j = 0; j<l1; j++) {
+ count+=j*j*j;
}
+
+ //Time at Point5
+ lt[eventcount].event = 5;
+ lt[eventcount++].time = System.getticks();
+
// Only read values from an object
val = mainobj[index];
+
+ //Time at Point6
+ lt[eventcount].event = 6;
+ lt[eventcount++].time = System.getticks();
+
// Do computation 2
- for(int j = 0; j<lsize2; j++) {
- count+=val*j;
+ for(int j = 0; j<l2; j++) {
+ count+=val*j*j;
}
+ //Time at Point7
+ lt[eventcount].event = 7;
+ lt[eventcount++].time = System.getticks();
+
// Write values
mainobj[index] = count;
}
+ //Time at Point8
+ lt[eventcount].event = 8;
+ lt[eventcount++].time = System.getticks();
}
+ //Time at Point9
+ lt[eventcount].event = 9;
+ lt[eventcount++].time = System.getticks();
+
+ //Output to file
+ FileOutputStream fo = new FileOutputStream("test_"+threadid);
+ //test output to file
+ char a = 'a';
+ fo.write(a);
}
+ /*
+ * Convert int to a byte array
+ **/
+ public byte[] fillBytes(int key) {
+ byte[] b = new byte[4];
+ for(int i = 0; i < 4; i++){
+ int offset = (3-i) * 8;
+ b[i] = (byte) ((key >> offset) & 0xFF);
+ }
+ //
+ // Debug
+ // System.println("Sending b[0]= "+ (char) b[0]);
+ //
+ return b;
+ }
+
+
public static void main(String[] args) {
SingleObjectMod som = new SingleObjectMod();
SingleObjectMod.parseCmdLine(args, som);
som.mainobj = new intwrapper[som.arrysize];
+
Random rand = new Random();
rand.random_alloc();
SingleObjectMod[] mysom = new SingleObjectMod[nthreads];
for(int i = 0; i < nthreads; i++) {
- mysom[i] = new SingleObjectMod(nthreads, som.arrysize, som.loopsize, som.lsize1, som.lsize2, i, som.mainobj, rand);
+ mysom[i] = new SingleObjectMod(nthreads, som.arrysize, som.loopsize, som.lsize1, som.lsize2, som.prob, i, som.mainobj, rand);
}
for(int i = 0; i < nthreads; i++) {
System.exit(0);
}
}
+
+public class LogTime {
+ public int event;
+ public long time;
+
+ public LogTime() {
+ event = 0;
+ time = 0;
+ }
+}
##### Plot Execution time for 4 threads ########
-set title "Execution times for Microbenchmark numthreads= 4"
-set output "ExecTime4.eps"
-set ylabel 'Time in secs'
-set xlabel 'Desired abort rate for benchmark in %'
-set yrange [0.43:0.47]
-set style line 1 lt 2 lw 2 pt 3 ps 0.5
-plot 0.46 title 'No-lock base time' linewidth 2, \
- "run4.data" using 1:2 title 'exec time' linetype 3 linewidth 2
+#set title "Execution times for Microbenchmark numthreads= 4"
+#set output "ExecTime4.eps"
+#set ylabel 'Time in secs'
+#set xlabel 'Desired abort rate for benchmark in %'
+#set yrange [0.30:0.40]
+#set style line 1 lt 2 lw 2 pt 3 ps 0.5
+#plot 0.37 title 'No-lock base time' linewidth 2, \
+# "run4.data" using 1:2 title 'exec time' linetype 3 linewidth 2
#pause -1
##### Plot Target abort rate vs observed rate for 4 threads ########
-set title "Abort Rates for Microbenchmark(fudge factor= 3, numthreads= 4)"
-set output "AbortRate4.eps"
-set ylabel 'Observed Abort rate in %(numabort+numsoftabort)/numcommit'
-set xlabel 'Desired abort rate for benchmark in %'
-plot "run4.txt" using 1:2 with impulse title 'Base abort rate' linewidth 2, \
- "run4.data" using 1:3 title 'abort rate' linetype 3 linewidth 2
+#set title "Abort Rates for Microbenchmark(fudge factor= 3, numthreads= 4)"
+#set output "AbortRate4.eps"
+#set ylabel 'Observed Abort rate in %(numabort+numsoftabort)/numcommit'
+#set xlabel 'Desired abort rate for benchmark in %'
+#set yrange [0:70]
+#plot "run4.txt" using 1:2 with impulse title 'Base abort rate' linewidth 2, \
+# "run4.data" using 1:3 title 'abort rate' linetype 3 linewidth 2
#pause -1
##### Plot Execution time for 8 threads ########
set output "ExecTime8.eps"
set ylabel 'Time in secs'
set xlabel 'Desired abort rate for benchmark in %'
-set yrange [1.28:1.38]
+set yrange [0:3.5]
set style line 1 lt 2 lw 2 pt 3 ps 0.5
-plot 1.35 title 'No-lock base time' linewidth 2, \
+plot 2.98 title 'No-lock base time' linewidth 2, \
"run8.data" using 1:2 title 'exec time' linetype 3 linewidth 2
#pause -1
set output "AbortRate8.eps"
set ylabel 'Observed Abort rate in %(numabort+numsoftabort)/numcommit'
set xlabel 'Desired abort rate for benchmark in %'
+set yrange [0:70]
plot "run8.txt" using 1:2 with impulse title 'Base abort rate' linewidth 2, \
"run8.data" using 1:3 title 'abort rate' linetype 3 linewidth 2
../KMeans/Random.java \
../../../ClassLibrary/intwrapper.java
-FLAGSSTATS=-stmstats -mainclass ${MAINCLASS} -singleTM -optimize -debug -joptimize -64bit -abcclose -dcopts -transstats -arraypad
+FLAGSSTATS=-stmstats -mainclass ${MAINCLASS} -singleTM -optimize -debug -joptimize -64bit -abcclose -dcopts -transstats -arraypad
+FLAGS=-mainclass ${MAINCLASS} -singleTM -nooptimize -debug -joptimize -64bit -abcclose -dcopts -transstats -arraypad
+
+base:
+ ../../../buildscript ${FLAGS} ${SRC} -o STATS${MAINCLASS}NoLockBase
stmlock:
- ../../../buildscript ${FLAGSSTATS} ${SRC} -o STATS${MAINCLASS}
+ ../../../buildscript ${FLAGSSTATS} -abrt 10 ${SRC} -o STATS${MAINCLASS}10
+ ../../../buildscript ${FLAGSSTATS} -abrt 20 ${SRC} -o STATS${MAINCLASS}20
+ ../../../buildscript ${FLAGSSTATS} -abrt 30 ${SRC} -o STATS${MAINCLASS}30
+ ../../../buildscript ${FLAGSSTATS} -abrt 40 ${SRC} -o STATS${MAINCLASS}40
+ ../../../buildscript ${FLAGSSTATS} -abrt 45 ${SRC} -o STATS${MAINCLASS}45
+ ../../../buildscript ${FLAGSSTATS} -abrt 50 ${SRC} -o STATS${MAINCLASS}50
+ ../../../buildscript ${FLAGSSTATS} -abrt 55 ${SRC} -o STATS${MAINCLASS}55
+ ../../../buildscript ${FLAGSSTATS} -abrt 60 ${SRC} -o STATS${MAINCLASS}60
+ ../../../buildscript ${FLAGSSTATS} -abrt 65 ${SRC} -o STATS${MAINCLASS}65
+ ../../../buildscript ${FLAGSSTATS} -abrt 70 ${SRC} -o STATS${MAINCLASS}70
+ ../../../buildscript ${FLAGSSTATS} -abrt 80 ${SRC} -o STATS${MAINCLASS}80
+ ../../../buildscript ${FLAGSSTATS} -abrt 90 ${SRC} -o STATS${MAINCLASS}90
+ ../../../buildscript ${FLAGSSTATS} -abrt 100 ${SRC} -o STATS${MAINCLASS}100
+
clean:
rm -rf tmpbuilddirectory
#!/bin/sh
+function run {
+ echo ------------Running $1 --------------------
+ for file in `ls STATS*`
+ do
+ num=`echo $file | tr -d ".bin" | tr -d "STATSSingleObjectMod"`
+ echo $num
+ /usr/bin/time -f "%e" -o /tmp/time ./$file $1 -o > /tmp/out
+ t=`cat /tmp/time`
+ nTcommit=`grep TransCommit /tmp/out | awk '{print $3}'`
+ nTabort=`grep TransAbort /tmp/out | awk '{print $3}'`
+ nSftabort=`grep 'nSoftAbort ' /tmp/out | awk '{print $3}'`
+ p=`echo "$nTabort $nSftabort $nTcommit" | awk '{print (($1+$2)/($3))*100}'`
+ echo "$num $t $p $file" >> runlog/$2
+ done
+}
+
+echo "--------- Clean old files ----------"
+#rm runlog/*.txt
+#make base
+#make stmlock
+ARGS1="-t 8 -size 4 -l 100000 -l1 20000 -l2 40000"
+ARGS2="-t 8 -size 4 -l 100000 -l1 10000 -l2 20000"
+ARGS3="-t 8 -size 4 -l 100000 -l1 5000 -l2 10000"
+ARGS4="-t 8 -size 4 -l 100000 -l1 2500 -l2 5000"
+ARGS5="-t 8 -size 4 -l 100000 -l1 40000 -l2 20000"
+ARGS6="-t 8 -size 4 -l 100000 -l1 10000 -l2 5000"
+ARGS7="-t 8 -size 4 -l 100000 -l1 20000 -l2 10000"
+ARGS8="-t 1 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS38="-t 2 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS48="-t 4 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS58="-t 8 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS68="-t 10 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS78="-t 12 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS88="-t 16 -size 1 -l 100000 -l1 10000 -l2 10000"
+ARGS9="-t 8 -size 4 -l 100000 -l1 0 -l2 0"
+ARGS10="-t 8 -size 1 -l 100000 -l1 40000 -l2 40000 -p 90"
+ARGS11="-t 8 -size 1 -l 100000 -l1 10000 -l2 10000 -p 90"
+ARGS12="-t 8 -size 1 -l 100000 -l1 40000 -l2 10000 -p 90"
+ARGS13="-t 8 -size 4 -l 100000 -l1 10000 -l2 40000"
+ARGS14="-t 8 -size 4 -l 100000 -l1 10000 -l2 60000"
+ARGS15="-t 8 -size 4 -l 100000 -l1 80000 -l2 10000"
+ARGS16="-t 8 -size 4 -l 100000 -l1 70000 -l2 10000"
+ARGS17="-t 8 -size 4 -l 100000 -l1 70000 -l2 70000"
+ARGS18="-t 1 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS19="-t 2 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS20="-t 4 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS21="-t 8 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS22="-t 12 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS23="-t 16 -size 1 -l 100000 -l1 1 -l2 1"
+ARGS24="-t 1 -size 1 -l 1 -l1 1 -l2 1"
+ARGS25="-t 1 -size 1 -l 1 -l1 0 -l2 0"
+ARGS26="-t 1 -size 1 -l 100000 -l1 0 -l2 0"
+ARGS27="-t 2 -size 1 -l 100000 -l1 0 -l2 0"
+ARGS28="-t 4 -size 1 -l 100000 -l1 0 -l2 0"
+ARGS29="-t 8 -size 1 -l 100000 -l1 0 -l2 0"
+
+#run "$ARGS1" l1_20000_l2_40000.txt
+#run "$ARGS2" l1_10000_l2_20000.txt
+#run "$ARGS3" l1_5000_l2_10000.txt
+#run "$ARGS4" l1_2500_l2_5000.txt
+#run "$ARGS5" l1_40000_l2_20000.txt
+#run "$ARGS6" l1_10000_l2_5000.txt
+#run "$ARGS7" l1_20000_l2_10000.txt
+#run "$ARGS8" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS38" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS48" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS58" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS68" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS78" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS88" lockunlock_l_100000_l1_10000_l2_10000.txt
+#run "$ARGS9" l1_0_l2_0.txt
+run "$ARGS10" l1_40000_l2_40000.txt
+run "$ARGS11" l1_10000_l2_10000.txt
+run "$ARGS12" l1_40000_l2_10000.txt
+#run "$ARGS13" l1_10000_l2_40000.txt
+#run "$ARGS14" l1_10000_l2_60000.txt
+#run "$ARGS15" l1_10000_l2_80000.txt
+#run "$ARGS16" l1_10000_l2_70000.txt
+#run "$ARGS17" l1_70000_l2_70000.txt
+#run "$ARGS18" t_1_l1_1_l2_1.txt
+#run "$ARGS19" t_2_l1_1_l2_1.txt
+#run "$ARGS20" t_4_l1_1_l2_1.txt
+#run "$ARGS21" t_8_l1_1_l2_1.txt
+#run "$ARGS22" t_12_l1_1_l2_1.txt
+#run "$ARGS23" t_16_l1_1_l2_1.txt
+#run "$ARGS24" t_1_l1_1_l2_1.txt
+#run "$ARGS25" t_1_l1_0_l2_0.txt
+#run "$ARGS26" l_100000_l1_0_l2_0.txt
+#run "$ARGS27" l_100000_l1_0_l2_0.txt
+#run "$ARGS28" l_100000_l1_0_l2_0.txt
+#run "$ARGS29" l_100000_l1_0_l2_0.txt
+
+
+## --------- Cut the first line from the .txt files generated above and plot them ---------
+#for file in `ls runlog/*.plt`
+#do
+#basetime=`cat $file | grep "NLkBas" | cut -f2 -d" "`
+# gnuplot $file
+#done
+
#high contention 4 threads
-ARGS4="-t 4 -size 5 -l 10000 -l1 100 -l2 50000"
+#ARGS4="-t 4 -size 5 -l 10000 -l1 100 -l2 50000"
+#ARGS4="-t 4 -size 4 -l 10000 -l1 10000 -l2 10000" #44.1% abort
#high contention 8 threads
-ARGS8="-t 8 -size 10 -l 100000 -l1 100 -l2 50000"
-for file in `ls STATS*`
-do
- num=`echo $file | tr -d ".bin" | tr -d "STATSSingleObjectMod"`
- echo $num
-# /usr/bin/time -f "%e" -o /tmp/time ./$file $ARGS4 -o > /tmp/out
- /usr/bin/time -f "%e" -o /tmp/time ./$file $ARGS8 -o > /tmp/out
- t=`cat /tmp/time`
- nTcommit=`grep TransCommit /tmp/out | awk '{print $3}'`
- nTabort=`grep TransAbort /tmp/out | awk '{print $3}'`
- nSftabort=`grep 'nSoftAbort ' /tmp/out | awk '{print $3}'`
- p=`echo "$nTabort $nSftabort $nTcommit" | awk '{print (($1+$2)/$3)*100}'`
- echo "$num $t $p $file" >> data.file
-done
+#ARGS8="-t 8 -size 4 -l 100000 -l1 0 -l2 0"
+#ARGS8="-t 8 -size 4 -l 100000 -l1 20000 -l2 40000"
+#-t 8 -size 4 -l 100000 -l1 10000 -l2 20000"
+#-t 8 -size 4 -l 100000 -l1 5000 -l2 10000"
+#-t 8 -size 4 -l 100000 -l1 2500 -l2 5000"
+#-t 8 -size 4 -l 100000 -l1 40000 -l2 20000"
+#-t 8 -size 4 -l 100000 -l1 10000 -l2 5000"
+#-t 8 -size 4 -l 100000 -l1 20000 -l2 10000"
+#-t 8 -size 4 -l 100000 -l1 10000 -l2 10000"
+#ARGS8="-t 8 -size 4 -l 10000 -l1 0 -l2 0"
+#ARGS8="-t 8 -size 6 -l 10000 -l1 5000 -l2 5000" #55.79% abort
+#for file in `ls STATS*`
+#do
+# num=`echo $file | tr -d ".bin" | tr -d "STATSSingleObjectMod"`
+# echo $num
+## /usr/bin/time -f "%e" -o /tmp/time ./$file $ARGS4 -o > /tmp/out
+# /usr/bin/time -f "%e" -o /tmp/time ./$file $1 -o > /tmp/out
+# t=`cat /tmp/time`
+# nTcommit=`grep TransCommit /tmp/out | awk '{print $3}'`
+# nTabort=`grep TransAbort /tmp/out | awk '{print $3}'`
+# nSftabort=`grep 'nSoftAbort ' /tmp/out | awk '{print $3}'`
+# p=`echo "$nTabort $nSftabort $nTcommit" | awk '{print (($1+$2)/($1+$2+$3))*100}'`
+# echo "$num $t $p $file" >> data.file
+#done
}
public static native long currentTimeMillis();
+
+ public static native long microTimes();
+
+ public static native long getticks();
public static native void printString(String s);
System.printString(""+o+"\n");
}
+ public static void println(long o) {
+ System.printString(""+o+"\n");
+ }
+
public static void print(String s) {
System.printString(s);
}
System.printString(""+o);
}
+ public static void print(long o) {
+ System.printString(""+o);
+ }
+
public static void error() {
System.printString("Error (Use Breakpoint on ___System______error method for more information!)\n");
}
item=next;
}
queue->head=queue->tail=NULL;
- return NULL;
+ return;
}
#ifdef DEBUG_QUEUE
#endif
#ifdef STMSTATS
+int timeInMS ()
+{
+ struct timeval t;
+
+ gettimeofday(&t, NULL);
+ return (
+ (int)t.tv_sec * 1000000 +
+ (int)t.tv_usec
+ );
+}
/* Thread variable for locking/unlocking */
__thread threadrec_t *trec;
__thread struct objlist * lockedobjs;
#ifdef STMDEBUG
#define DEBUGSTM(x...) printf(x);
#else
-#define DEBUGSTM(x...)
+#define DEBUGSTM(x...);
+#endif
+
+#ifdef STATDEBUG
+#define DEBUGSTATS(x...) printf(x);
+#else
+#define DEBUGSTATS(x...);
#endif
//#ifdef FASTMEMCPY
DEBUGSTM("ABORTSTATS: oid= %x, type= %2d, transAbortProb= %2.2f, ObjAbortProb= %2.2f, Typenumaccess= %3d, avgtranssize = %2d, ObjabortCount= %2d, ObjaccessCount= %3d\n", OID(x), TYPE(x), transAbortProbForObj, ObjAbortProb, typesCausingAbort[TYPE(x)].numaccess, avgTransSize, x->abortCount, x->accessCount);
/* Condition for locking objects */
if (((ObjAbortProb*100) >= transAbortProbForObj) && (x->riskyflag != 1)) {
- DEBUGSTM("AFTER LOCK ABORTSTATS: oid= %x, type= %2d, transAbortProb= %2.2f, ObjAbortProb= %2.2f, Typenumaccess= %3d, avgtranssize = %2d, ObjabortCount= %2d, ObjaccessCount= %3d\n", OID(x), TYPE(x), transAbortProbForObj, ObjAbortProb, typesCausingAbort[TYPE(x)].numaccess, avgTransSize, x->abortCount, x->accessCount);
+ DEBUGSTATS("AFTER LOCK ABORTSTATS: oid= %x, type= %2d, transAbortProb= %2.2f, ObjAbortProb= %2.2f, Typenumaccess= %3d, avgtranssize = %2d, ObjabortCount= %2d, ObjaccessCount= %3d\n", OID(x), TYPE(x), transAbortProbForObj, ObjAbortProb, typesCausingAbort[TYPE(x)].numaccess, avgTransSize, x->abortCount, x->accessCount);
//makes riskflag sticky
pthread_mutex_lock(&lockedobjstore);
if (objlockscope->offset<MAXOBJLIST) {
int transCommit(void (*commitmethod)(void *, void *, void *), void * primitives, void * locals, void * params) {
#else
int transCommit() {
+#endif
+#ifdef TRANSSTATS
+ numTransCommit++;
#endif
int softaborted=0;
do {
}
if(finalResponse == TRANS_COMMIT) {
#ifdef TRANSSTATS
- numTransCommit++;
+ //numTransCommit++;
if (softaborted) {
nSoftAbortCommit++;
}
return hardabort;
}
+
/**
* needLock
* params: Object header, ptr to garbage collector
} objtypestat_t;
/* Variables for probability model */
-#define PERCENT_ALLOWED_ABORT 60
#define FACTOR 3
#endif
float instfailurechance=0;
int numfailures;
int instaccum=0;
+typedef unsigned long long ticks;
#ifdef DMALLOC
#include "dmalloc.h"
#endif
return retval;
}
+long long CALL00(___System______microTimes____) {
+ struct timeval tv;
+ long long retval;
+ gettimeofday(&tv, NULL);
+ retval = tv.tv_sec; /* seconds */
+ retval*=1000000; /* microsecs */
+ retval+= (tv.tv_usec); /* adjust microseconds & add them in */
+ return retval;
+}
+
+long long CALL00(___System______getticks____) {
+ unsigned a, d;
+ asm("cpuid");
+ asm volatile("rdtsc" : "=a" (a), "=d" (d));
+ return (((ticks)a) | (((ticks)d) << 32));
+}
+
void CALL01(___System______printString____L___String___,struct ___String___ * ___s___) {
struct ArrayObject * chararray=VAR(___s___)->___value___;
int i;
elif [[ $1 = '-stmdebug' ]]
then
EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
+elif [[ $1 = '-statdebug' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DSTATDEBUG"
elif [[ $1 = '-stmstats' ]]
then
EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
then
JAVAOPTS="$JAVAOPTS -outputdir $2"
shift
+elif [[ $1 = '-abrt' ]]
+then
+ABRT="PERCENT_ALLOWED_ABORT=$2"
+EXTRAOPTIONS="$EXTRAOPTIONS -D$ABRT"
+shift
else
SRCFILES="$SRCFILES $1"
fi