set terminal postscript enhanced eps color
set style data linespoints
-set style fill solid border -1
-set ylabel 'Time in secs'
+set style fill solid
set grid ytics
-set xrange [0:10]
##### Plot Execution time for 4 threads ########
-set xtics ("5" 0, "100" 1, "360" 2, "560" 3, "760" 4, "7600" 5 , "66000" 6, "76000" 7, "660000" 8, "760000" 9)
-#set title "Execution times for Microbenchmark"
-#set output "ExecTime.eps"
-#set ylabel 'Time in secs'
-#set xlabel 'Desired abort rate for benchmark in %'
-#plot 0.82 title 'No-lock base time', \
-# "data1.file" using 2 title 'exec time'
+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
+#pause -1
##### Plot Target abort rate vs observed rate for 4 threads ########
-set title "Abort Rates for Microbenchmark"
-set output "AbortRate.eps"
+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 13.172 title 'Base abort rate', \
- "data1.file" using 3 title 'abort rate'
+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 title "Execution times for Microbenchmark numthreads= 8"
+set output "ExecTime8.eps"
+set ylabel 'Time in secs'
+set xlabel 'Desired abort rate for benchmark in %'
+set yrange [1.28:1.38]
+set style line 1 lt 2 lw 2 pt 3 ps 0.5
+plot 1.35 title 'No-lock base time' linewidth 2, \
+ "run8.data" using 1:2 title 'exec time' linetype 3 linewidth 2
#pause -1
+##### Plot Target abort rate vs observed rate for 8 threads ########
+set title "Abort Rates for Microbenchmark(fudge factor= 3, numthreads= 8)"
+set output "AbortRate8.eps"
+set ylabel 'Observed Abort rate in %(numabort+numsoftabort)/numcommit'
+set xlabel 'Desired abort rate for benchmark in %'
+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
+
+#pause -1
**/
INLINE void getTransSize(objheader_t *header , int *isObjTypeTraverse) {
(typesCausingAbort[TYPE(header)]).numabort++;
- if(isObjTypeTraverse[TYPE(header)] != 1)
+ if(isObjTypeTraverse[TYPE(header)] != 1) {
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1; //should this count be kept per object
+ }
isObjTypeTraverse[TYPE(header)]=1;
}
#define DEBUGSTMSTAT(args...)
* Increments the abort count for each object
**/
void ABORTCOUNT(objheader_t * x) {
- float transAbortProb = (PERCENT_ALLOWED_ABORT*FACTOR)/(float)typesCausingAbort[TYPE(x)].numaccess;
+ int avgTransSize = typesCausingAbort[TYPE(x)].numaccess / typesCausingAbort[TYPE(x)].numtrans;
+ float transAbortProbForObj = (PERCENT_ALLOWED_ABORT*FACTOR)/(float) avgTransSize;
float ObjAbortProb = x->abortCount/(float) (x->accessCount);
- DEBUGSTM("ABORTSTATS: oid= %x, transAbortProb= %3.2f, ObjAbortProb= %3.2f, numaccess= %3d, type= %2d, abortCount= %3d, accessCount= %3d\n", OID(x), transAbortProb, ObjAbortProb, typesCausingAbort[TYPE(x)].numaccess, TYPE(x), x->abortCount, x->accessCount);
+ 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 > transAbortProb) && (x->riskyflag != 1)) {
+ 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);
//makes riskflag sticky
pthread_mutex_lock(&lockedobjstore);
if (objlockscope->offset<MAXOBJLIST) {
ObjSeqId = headeraddr->accessCount;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
getTotalAbortCount(i+1, size, (void *)(curr->next), numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
ObjSeqId = headeraddr->accessCount;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
//(typesCausingAbort[TYPE(header)])++;
#endif
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
#endif
#if defined(STMSTATS)||defined(SOFTABORT)
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
getReadAbortCount(i+1, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
- DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("RD Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
return TRANS_ABORT;
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
getReadAbortCount(i+1, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
- DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u, oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("RD Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
return TRANS_ABORT;
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
#endif
#if defined(STMSTATS)||defined(SOFTABORT)
if(getReadAbortCount(i+1, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse))
softabort=0;
#endif
- DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("RD Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
if (softabort)
//if(getTotalAbortCount2((void *) curr->next, numoidrdlocked, oidrdlocked, oidrdversion))
// softabort=0;
#endif
- DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("WR Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
if (softabort)
//if(getTotalAbortCount2((void *) curr->next, numoidrdlocked, oidrdlocked, oidrdversion))
//softabort=0;
#endif
- DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("WR Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
if (softabort)
ObjSeqId = headeraddr->accessCount;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
getTotalAbortCount2((void *) curr->next, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
- DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("WR Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
return TRANS_ABORT;
ObjSeqId = headeraddr->accessCount;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
#endif
#if defined(STMSTATS)||defined(SOFTABORT)
if(getTotalAbortCount2((void *) curr->next, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse))
softabort=0;
#endif
- DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("WR Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
if (softabort)
ObjSeqId = headeraddr->accessCount;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
#endif
#if defined(STMSTATS)||defined(SOFTABORT)
if(getTotalAbortCount2((void *) curr->next, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse))
softabort=0;
#endif
- DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("WR Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("WR Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
if (softabort)
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
getReadAbortCount(i+1, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
- DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("RD Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
return TRANS_ABORT;
header->abortCount++;
getReadAbortCount(i+1, numoidrdlocked, oidrdlocked, oidrdversion, oidrdage, ObjSeqId, header, objtypetraverse);
#endif
- DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version);
+ DEBUGSTM("RD Abort: rd: %u wr: %u tot: %u type: %u ver: %u oid: %x\n", numoidrdlocked, numoidwrlocked, c_numelements, TYPE(header), header->version, OID(header));
DEBUGSTMSTAT("RD Abort: Access Count: %u AbortCount: %u type: %u ver: %u \n", header->accessCount, header->abortCount, TYPE(header), header->version);
freearrays;
return TRANS_ABORT;
header->abortCount++;
(typesCausingAbort[TYPE(header)]).numabort++;
(typesCausingAbort[TYPE(header)]).numaccess+=c_numelements;
+ (typesCausingAbort[TYPE(header)]).numtrans+=1;
objtypetraverse[TYPE(header)]=1;
#endif
#if defined(STMSTATS)||defined(SOFTABORT)