Node2.java \
EVector.java
-FLAGS=-dsm -prefetch -optimize -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -debug -mainclass ${MAINCLASS} -trueprob 0.91
-FLAGS1=-dsm -prefetch -dsmcaching -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.91
-FLAGS2=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS} -trueprob 0.91
-FLAGS3=-dsm -optimize -mainclass ${MAINCLASS}
+FLAGS=-dsm -prefetch -optimize -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -debug -mainclass ${MAINCLASS} -trueprob 0.85
+FLAGS1=-dsm -prefetch -dsmcaching -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.85
+FLAGS2=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS} -trueprob 0.85
+FLAGS3=-dsm -optimize -mainclass ${MAINCLASS} -trueprob 0.85
default:
# ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC}
}
public void init(particle[] one, int mdsize) {
- for (lg=0; lg<=1; lg++) {
- for (i=0; i<mm; i++) {
- for (j=0; j<mm; j++) {
- for (k=0; k<mm; k++) {
+ int id=this.id;
+ for (int lg=0; lg<=1; lg++) {
+ for (int i=0; i<mm; i++) {
+ for (int j=0; j<mm; j++) {
+ for (int k=0; k<mm; k++) {
one[ijk] = new particle((i*a+lg*a*0.5),(j*a+lg*a*0.5),(k*a),
xvelocity,yvelocity,zvelocity,sh_force,sh_force2,id,one);
ijk = ijk + 1;
}
}
- for (lg=1; lg<=2; lg++) {
- for (i=0; i<mm; i++) {
- for (j=0; j<mm; j++) {
- for (k=0; k<mm; k++) {
+ for (int lg=1; lg<=2; lg++) {
+ for (int i=0; i<mm; i++) {
+ for (int j=0; j<mm; j++) {
+ for (int k=0; k<mm; k++) {
one[ijk] = new particle((i*a+(2-lg)*a*0.5),(j*a+(lg-1)*a*0.5),
(k*a+a*0.5),xvelocity,yvelocity,zvelocity,sh_force,sh_force2,id,one);
ijk = ijk + 1;
random randnum = new random(iseed,v1,v2);
- for (i=0; i<mdsize; i+=2) {
+ for (int i=0; i<mdsize; i+=2) {
r = randnum.seed();
one[i].xvelocity = r*randnum.v1;
one[i+1].xvelocity = r*randnum.v2;
}
- for (i=0; i<mdsize; i+=2) {
+ for (int i=0; i<mdsize; i+=2) {
r = randnum.seed();
one[i].yvelocity = r*randnum.v1;
one[i+1].yvelocity = r*randnum.v2;
}
- for (i=0; i<mdsize; i+=2) {
+ for (int i=0; i<mdsize; i+=2) {
r = randnum.seed();
one[i].zvelocity = r*randnum.v1;
one[i+1].zvelocity = r*randnum.v2;
ekin = 0.0;
sp = 0.0;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
sp = sp + one[i].xvelocity;
}
sp = sp / mdsize;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
one[i].xvelocity = one[i].xvelocity - sp;
ekin = ekin + one[i].xvelocity*one[i].xvelocity;
}
sp = 0.0;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
sp = sp + one[i].yvelocity;
}
sp = sp / mdsize;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
one[i].yvelocity = one[i].yvelocity - sp;
ekin = ekin + one[i].yvelocity*one[i].yvelocity;
}
sp = 0.0;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
sp = sp + one[i].zvelocity;
}
sp = sp / mdsize;
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
one[i].zvelocity = one[i].zvelocity - sp;
ekin = ekin + one[i].zvelocity*one[i].zvelocity;
}
sc = h * Math.sqrt(tref/ts);
- for(i=0;i<mdsize;i++) {
+ for(int i=0;i<mdsize;i++) {
one[i].xvelocity = one[i].xvelocity * sc;
one[i].yvelocity = one[i].yvelocity * sc;
}
+ public void doinit(int mdsize) {
+ for(int j=0;j<3;j++) {
+ double[] sh=sh_force[j];
+ for (int i=0;i<mdsize;i++) {
+ sh[i] = 0.0;
+ }
+ }
+ }
+
+
+ public void doinit2(int mdsize) {
+ for(int k=0;k<3;k++) {
+ double[] sh=sh_force[k];
+ double [][] sha=sh_force2[k];
+ for(int j=0;j<nthreads;j++) {
+ double[] sha2=sha[j];
+ for(int i=0;i<mdsize;i++) {
+ sh[i] += sha2[i];
+ }
+ }
+ }
+
+ for(int k=0;k<3;k++) {
+ double [][] sh1=sh_force2[k];
+ for(int j=0;j<nthreads;j++) {
+ double[] sh2=sh1[j];
+ for(int i=0;i<mdsize;i++) {
+
+
+ sh2[i] = 0.0;
+ }
+ }
+ }
+
+ for(int j=1;j<nthreads;j++) {
+ mymd.epot[0].d += mymd.epot[j].d;
+ mymd.vir[0].d += mymd.vir[j].d;
+ }
+ for(int j=1;j<nthreads;j++) {
+ mymd.epot[j].d = mymd.epot[0].d;
+ mymd.vir[j].d = mymd.vir[0].d;
+ }
+ for(int j=0;j<nthreads;j++) {
+ mymd.interactions += mymd.interacts[j].i;
+ }
+
+ for (int j=0;j<3;j++) {
+ double sh[]=sh_force[j];
+ for (int i=0;i<mdsize;i++) {
+ sh[i] = sh[i] * hsq2;
+ }
+ }
+}
+
public void run() {
/* Parameter determination */
int movemx=50;
Barrier barr=new Barrier("128.195.175.79");
particle[] one;
+ int id;
atomic {
+ id=this.id;
mdsize = mymd.PARTSIZE;
one=new particle[mdsize];
l = mymd.LENGTH;
for (int move=0;move<movemx;move++) {
atomic {
/* move the particles and update velocities */
- for (i=0;i<mdsize;i++) {
+ for (int i=0;i<mdsize;i++) {
one[i].domove(side,i);
}
}
atomic {
if(id==0) {
- for(j=0;j<3;j++) {
- for (i=0;i<mdsize;i++) {
- sh_force[j][i] = 0.0;
- }
- }
+ doinit(mdsize);
}
mymd.epot[id].d = 0.0;
atomic {
/* compute forces */
- for (i=0+id;i<mdsize;i+=nthreads) {
+ for (int i=0+id;i<mdsize;i+=nthreads) {
one[i].force(side,rcoff,mdsize,i,xx,yy,zz,mymd);
}
}
/* update force arrays */
atomic {
if(id == 0) {
- for(int k=0;k<3;k++) {
- for(i=0;i<mdsize;i++) {
- for(j=0;j<nthreads;j++) {
- sh_force[k][i] += sh_force2[k][j][i];
- }
- }
- }
-
- for(int k=0;k<3;k++) {
- for(i=0;i<mdsize;i++) {
- for(j=0;j<nthreads;j++) {
- sh_force2[k][j][i] = 0.0;
- }
- }
- }
-
- for(j=1;j<nthreads;j++) {
- mymd.epot[0].d += mymd.epot[j].d;
- mymd.vir[0].d += mymd.vir[j].d;
- }
- for(j=1;j<nthreads;j++) {
- mymd.epot[j].d = mymd.epot[0].d;
- mymd.vir[j].d = mymd.vir[0].d;
- }
- for(j=0;j<nthreads;j++) {
- mymd.interactions += mymd.interacts[j].i;
- }
-
- for (j=0;j<3;j++) {
- for (i=0;i<mdsize;i++) {
- sh_force[j][i] = sh_force[j][i] * hsq2;
- }
- }
+ doinit2(mdsize);
}
}
atomic {
/*scale forces, update velocities */
sum = 0.0;
- for (i=0;i<mdsize;i++) {
+ for (int i=0;i<mdsize;i++) {
sum = sum + one[i].mkekin(hsq2,i);
}
/* average velocity */
- for (i=0;i<mdsize;i++) {
+ for (int i=0;i<mdsize;i++) {
velt = one[i].velavg(vaverh,h);
if(velt > vaverh) { count = count + 1.0; }
vel = vel + velt;
if((move < istop) && (((move+1) % irep) == 0)) {
sc = Math.sqrt(tref / (tscale*ekin));
- for (i=0;i<mdsize;i++) {
+ for (int i=0;i<mdsize;i++) {
one[i].dscal(sc,1);
}
ekin = tref / tscale;
Barrier.enterBarrier(barr);
}
- Barrier.enterBarrier(barr);
//if (id == 0) JGFInstrumentor.stopTimer("Section3:MolDyn:Run", instr.timers);
}
double fxi,fyi,fzi;
double rd,rrd,rrd2,rrd3,rrd4,rrd6,rrd7,r148;
double forcex,forcey,forcez;
-
+ int id=this.id;
sideh = 0.5*side;
rcoffs = rcoff*rcoff;
DoubleWrapper.java \
IntWrapper.java \
MDWrap.java
-FLAGS=-dsm -dsmcaching -prefetch -excprefetch particle.force -excprefetch particle.domove -excprefetch particle.mkekin -excprefetch TournamentBarrier.DoBarrier -excprefetch JGFMolDynBench.JGFvalidate -excprefetch JGFMolDynBench.JGFapplication -optimize -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8
+FLAGS=-dsm -dsmcaching -prefetch -optimize -excprefetch particle.force -excprefetch particle.domove -excprefetch particle.mkekin -excprefetch TournamentBarrier.DoBarrier -excprefetch JGFMolDynBench.JGFvalidate -excprefetch JGFMolDynBench.JGFapplication -excprefetch JGFMolDynBench.JGFinitialise -excprefetch mdRunner.init -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.75
FLAGS2=-dsm -optimize -mainclass ${MAINCLASS} -o ${MAINCLASS}NP
default:
- ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC}
+ ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NPNC ${SRC}
../../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC}
- cp ${MAINCLASS}NP.bin ${MAINCLASS}1NP.bin
+ cp ${MAINCLASS}NPNC.bin ${MAINCLASS}1NPNC.bin
cp ${MAINCLASS}P.bin ${MAINCLASS}1.bin
- cp ${MAINCLASS}NP.bin ${MAINCLASS}2NP.bin
+ cp ${MAINCLASS}NPNC.bin ${MAINCLASS}2NPNC.bin
cp ${MAINCLASS}P.bin ${MAINCLASS}2.bin
- cp ${MAINCLASS}NP.bin ${MAINCLASS}3NP.bin
+ cp ${MAINCLASS}NPNC.bin ${MAINCLASS}3NPNC.bin
cp ${MAINCLASS}P.bin ${MAINCLASS}3.bin
- cp ${MAINCLASS}NP.bin ${MAINCLASS}4NP.bin
+ cp ${MAINCLASS}NPNC.bin ${MAINCLASS}4NPNC.bin
cp ${MAINCLASS}P.bin ${MAINCLASS}4.bin
clean:
JGFTimer.java \
SORRunner.java \
SORWrap.java
-FLAGS=-dsm -prefetch -dsmcaching -optimize -excprefetch JGFSORBench.JGFSORBench -excprefetch JGFSORBenchSizeA.main -excprefetch JGFSORBench.RandomMatrix -excprefetch JGFSORBench.init_sync -excprefetch JGFSORBench.JGFkernel -mainclass ${MAINCLASS} -trueprob 0.73
+FLAGS=-dsm -prefetch -dsmcaching -optimize -excprefetch JGFSORBench.JGFSORBench -excprefetch JGFSORBenchSizeA.main -excprefetch JGFSORBench.RandomMatrix -excprefetch JGFSORBench.init_sync -excprefetch JGFSORBench.JGFkernel -mainclass ${MAINCLASS} -trueprob 0.72
FLAGS1=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS}
FLAGS2=-dsm -optimize -mainclass ${MAINCLASS}
MatrixMultiply:MM200:1 200 30:2 200 30:3 200 30:4 200 30:mmver200
MatrixMultiply:MatrixMultiply:1 600:2 600:3 600:4 600:mmver600
Em3d:Em3d/dsm:-T 1 -N 4000 -d 130 -p -i 3:-T 2 -N 4000 -d 130 -p -i 3:-T 3 -N 4000 -d 130 -p -i 3:-T 4 -N 4000 -d 130 -p -i 3:em3dver40001303
-Em3d:Em3d/dsm:-T 1 -N 4000 -d 130 -p -i 100000:-T 2 -N 4000 -d 130 -p -i 100000:-T 3 -N 4000 -d 130 -p -i 100000:-T 4 -N 4000 -d 130 -p -i 100000:em3dver4000130100000
+Em3d:Em3d/dsm:-T 1 -N 4000 -d 130 -p -i 6:-T 2 -N 4000 -d 130 -p -i 6:-T 3 -N 4000 -d 130 -p -i 6:-T 4 -N 4000 -d 130 -p -i 6:em3dver40001306
+Em3d:Em3d/dsm:-T 1 -N 6000 -d 250 -p -i 6:-T 2 -N 6000 -d 250 -p -i 6:-T 3 -N 6000 -d 250 -p -i 6:-T 4 -N 6000 -d 250 -p -i 6:em3dver60002506
+Em3d:Em3d/dsm:-T 1 -N 6000 -d 200 -p -i 6:-T 2 -N 6000 -d 200 -p -i 6:-T 3 -N 6000 -d 200 -p -i 6:-T 4 -N 6000 -d 200 -p -i 6:em3dver60002006
+Em3d:Em3d/dsm:-T 1 -N 6000 -d 200 -p -i 10:-T 2 -N 6000 -d 200 -p -i 10:-T 3 -N 6000 -d 200 -p -i 10:-T 4 -N 6000 -d 200 -p -i 10:em3dver600020010
+Em3d:Em3d/dsm:-T 1 -N 8000 -d 270 -p -i 6:-T 2 -N 8000 -d 270 -p -i 6:-T 3 -N 8000 -d 270 -p -i 6:-T 4 -N 8000 -d 270 -p -i 6:em3dver80002706
+Em3d:Em3d/dsm:-T 1 -N 8000 -d 270 -p -i 10:-T 2 -N 8000 -d 270 -p -i 10:-T 3 -N 8000 -d 270 -p -i 10:-T 4 -N 8000 -d 270 -p -i 10:em3dver800027010
+Em3d:Em3d/dsm:-T 1 -N 10000 -d 400 -p -i 150:-T 2 -N 10000 -d 400 -p -i 150:-T 3 -N 10000 -d 400 -p -i 150:-T 4 -N 10000 -d 400 -p -i 150:em3dver10000400150
+Em3d:Em3d/dsm:-T 1 -N 10000 -d 800 -p -i 15:-T 2 -N 10000 -d 800 -p -i 15:-T 3 -N 10000 -d 800 -p -i 15:-T 4 -N 10000 -d 800 -p -i 15:em3dver1000080015
+Em3d:Em3d/dsm:-T 1 -N 10000 -d 1000 -p -i 15:-T 2 -N 10000 -d 1000 -p -i 15:-T 3 -N 10000 -d 1000 -p -i 15:-T 4 -N 10000 -d 1000 -p -i 15:em3dver10000100015
+Em3d:Em3d/dsm:-T 1 -N 20000 -d 800 -p -i 15:-T 2 -N 20000 -d 800 -p -i 15:-T 3 -N 20000 -d 800 -p -i 15:-T 4 -N 20000 -d 800 -p -i 15:em3dver2000080015
+Em3d:Em3d/dsm:-T 1 -N 20000 -d 600 -p -i 15:-T 2 -N 20000 -d 600 -p -i 15:-T 3 -N 20000 -d 600 -p -i 15:-T 4 -N 20000 -d 600 -p -i 15:em3dver2000060015
+Em3d:Em3d/dsm:-T 1 -N 20000 -d 1000 -p -i 15:-T 2 -N 20000 -d 1000 -p -i 15:-T 3 -N 20000 -d 1000 -p -i 15:-T 4 -N 20000 -d 1000 -p -i 15:em3dver20000100015
Chase:Chase:::::chase
Array:Array:::::array
function localrun {
i=0;
- while [ $i -lt $1 ]; do
- /usr/bin/time -f "%e" ./${NONPREFETCH} master $ARGS1 2>> ${LOGDIR}/${NONPREFETCH}_local_${EXTENSION}.txt
- sleep 4
- i=`expr $i + 1`
- done
+#while [ $i -lt $1 ]; do
+# /usr/bin/time -f "%e" ./${NONPREFETCH} master $ARGS1 2>> ${LOGDIR}/${NONPREFETCH}_local_${EXTENSION}.txt
+# sleep 4
+# i=`expr $i + 1`
+# done
i=0;
while [ $i -lt $1 ]; do
/usr/bin/time -f "%e" ./${NONPREFETCH_NONCACHE} master $ARGS1 2>> ${LOGDIR}/${NONPREFETCH_NONCACHE}_local_${EXTENSION}.txt
localrun 3
echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
- oneremote 3 1 $NONPREFETCH_NONCACHE
+# oneremote 1 1 $NONPREFETCH_NONCACHE
echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
- oneremote 3 1 $NONPREFETCH
+# oneremote 1 1 $NONPREFETCH
echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
- oneremote 3 1 $PREFETCH
+# oneremote 1 1 $PREFETCH
echo "---------- Running two threads $BMDIR non-prefetch + non-cache on 2 machines ---------- "
run 3 2 $NONPREFETCH_NONCACHE2
echo "---------- Running two threads $BMDIR non-prefetch on 2 machines ---------- "
- run 3 2 $NONPREFETCH2
+# run 3 2 $NONPREFETCH2
echo "---------- Running two threads $BMDIR prefetch on 2 machines ---------- "
run 3 2 $PREFETCH2
echo "---------- Running three threads $BMDIR non-prefetch + non-cache on 3 machines ---------- "
run 3 3 $NONPREFETCH_NONCACHE3
echo "---------- Running three threads $BMDIR non-prefetch on 3 machines ---------- "
- run 3 3 $NONPREFETCH3
+# run 3 3 $NONPREFETCH3
echo "---------- Running three threads $BMDIR prefetch on 3 machines ---------- "
run 3 3 $PREFETCH3
echo "---------- Running four threads $BMDIR non-prefetch + non-cache on 4 machines ---------- "
run 3 4 $NONPREFETCH_NONCACHE4
echo "---------- Running four threads $BMDIR non-prefetch on 4 machines ---------- "
- run 3 4 $NONPREFETCH4
+# run 3 4 $NONPREFETCH4
echo "---------- Running four threads $BMDIR prefetch on 4 machines ---------- "
run 3 4 $PREFETCH4
}
benchmarks='array chase mmver200 mmver600'
-#benchmarks='em3dver40001303 sorverD'
+#benchmarks='em3dver10000100015'
+#benchmarks='moldynverA'
+#benchmarks='sorverD' //8000 X 8000 matrix
echo "---------- Clean old files ---------- "
rm runlog/*
MethodDescriptor md=lb.getMethod();
FlatMethod fm=state.getMethodFlat(md);
if (!md.getModifiers().isNative()) {
- System.out.println("***"+fm);
generateFlatMethod(fm, lb, outmethod);
}
}
//we have a type
ClassDescriptor cd=typeutil.getClass(min.getBaseName().getSymbol());
if (cd==null)
- throw new Error(min.getBaseName()+" undefined");
+ throw new Error("md = "+ md.toString()+ " "+min.getBaseName()+" undefined");
typetolookin=new TypeDescriptor(cd);
}
} else if ((md instanceof MethodDescriptor)&&min.getMethodName().equals("super")) {
} else {
if(getOperationMode(siteid) != 0) {
evalPrefetch[siteid].uselesscount--;
- if(evalPrefetch[siteid].uselesscount <= 0)
+ if(evalPrefetch[siteid].uselesscount <= 0) {
evalPrefetch[siteid].operMode = 0;
+ }
}
}
}
short status = *((short *) &readBuffer[0]);
switch (status) {
case INVALIDATE_OBJS:
- if((retval = invalidateFromPrefetchCache(readBuffer))!= 0) {
+ if((retval = invalidateFromPrefetchCache(readBuffer))!= 0) {
printf("Error: In invalidateFromPrefetchCache() at %s, %d\n", __FILE__, __LINE__);
break;
}
if(mid != myIpAddr) {
/* Read objects sent */
int numObjsRecv = *((short *)(buffer+offset)) / sizeof(unsigned int);
+ offset += sizeof(short);
int i;
for(i = 0; i < numObjsRecv; i++) {
unsigned int oid;
oid = *((unsigned int *)(buffer+offset));
objheader_t *header;
/* Lookup Objects in prefetch cache and remove them */
- if((header = prehashSearch(oid)) != NULL) {
+ if(((header = prehashSearch(oid)) != NULL)) {
prehashRemove(oid);
}
offset += sizeof(unsigned int);
#define LISTEN_PORT 2156
#define UDP_PORT 2158
//Prefetch tuning paramters
-#define RETRYINTERVAL 7 //N
-#define SHUTDOWNINTERVAL 4 //M
+#define RETRYINTERVAL 20//N
+#define SHUTDOWNINTERVAL 3 //M
#include <stdlib.h>
#include <stdio.h>
int *count; /* Variable to count responses from all participants to the TRANS_REQUEST protocol */
char *replyctrl; /* Shared ctrl message that stores the reply to be sent to participants, filled by decideResponse() */
char *replyretry; /* Shared variable that keep track if coordinator needs retry */
- transrecord_t *rec; /* To send modified objects */
+ transrecord_t *rec; /* Shared variable transaction record send to all thread data */
} thread_data_array_t;
objheader_t *objheader;
if((objheader = prehashSearch(oid)) != NULL) {
prehashRemove(oid);
-#ifdef CHECKTA
- printf("%s() clearing Look up table for oid = %x\n", __func__, oid);
-#endif
}
}
}
pthread_mutexattr_t qlockattr;
pthread_cond_t qcond;
-
-#define QSIZE 1000000 //1 MB
+#define QSIZE 2048 //2 KB
void queueInit(void) {
/* Intitialize primary queue */
/* Global Variables */
extern int classsize[];
pfcstats_t *evalPrefetch;
+extern int numprefetchsites; //Global variable containing number of prefetch sites
extern pthread_mutex_t mainobjstore_mutex;// Mutex to lock main Object store
objstr_t *prefetchcache; //Global Prefetch cache
pthread_mutex_t prefetchcache_mutex;// Mutex to lock Prefetch Cache
numbytes = send(fd, buffer, size, MSG_NOSIGNAL);
if (numbytes == -1) {
perror("send");
- return;
+ exit(0);
}
buffer += numbytes;
size -= numbytes;
numbytes = recv(fd, buffer, size, 0);
if (numbytes == -1) {
perror("recv");
- return;
+ exit(0);
}
buffer += numbytes;
size -= numbytes;
/* Send Commit */
*(tdata->replyctrl) = TRANS_COMMIT;
*(tdata->replyretry) = 0;
+#ifdef CACHE
+#if 0
+ /* Turn prefetching on */
+ int i;
+ for (i=0; i<numprefetchsites; i++)
+ evalPrefetch[i].operMode = 1;
+#endif
+#endif
} else {
/* Send Abort in soft abort case followed by retry commiting transaction again*/
*(tdata->replyctrl) = TRANS_ABORT;
plistnode_t *pInsert(plistnode_t *pile, objheader_t *headeraddr, unsigned int mid, int num_objs) {
plistnode_t *ptr, *tmp;
int found = 0, offset = 0;
-
+
tmp = pile;
//Add oid into a machine that is already present in the pile linked list structure
while(tmp != NULL) {
if (tmp->mid == mid) {
int tmpsize;
-
+
if (STATUS(headeraddr) & NEW) {
- tmp->oidcreated[tmp->numcreated] = OID(headeraddr);
- tmp->numcreated++;
- GETSIZE(tmpsize, headeraddr);
- tmp->sum_bytes += sizeof(objheader_t) + tmpsize;
+ tmp->oidcreated[tmp->numcreated] = OID(headeraddr);
+ tmp->numcreated++;
+ GETSIZE(tmpsize, headeraddr);
+ tmp->sum_bytes += sizeof(objheader_t) + tmpsize;
}else if (STATUS(headeraddr) & DIRTY) {
- tmp->oidmod[tmp->nummod] = OID(headeraddr);
- tmp->nummod++;
- GETSIZE(tmpsize, headeraddr);
- tmp->sum_bytes += sizeof(objheader_t) + tmpsize;
+ tmp->oidmod[tmp->nummod] = OID(headeraddr);
+ tmp->nummod++;
+ GETSIZE(tmpsize, headeraddr);
+ tmp->sum_bytes += sizeof(objheader_t) + tmpsize;
} else {
- offset = (sizeof(unsigned int) + sizeof(short)) * tmp->numread;
- *((unsigned int *)(((char *)tmp->objread) + offset))=OID(headeraddr);
- offset += sizeof(unsigned int);
- *((short *)(((char *)tmp->objread) + offset)) = headeraddr->version;
- tmp->numread ++;
+ offset = (sizeof(unsigned int) + sizeof(short)) * tmp->numread;
+ *((unsigned int *)(((char *)tmp->objread) + offset))=OID(headeraddr);
+ offset += sizeof(unsigned int);
+ *((short *)(((char *)tmp->objread) + offset)) = headeraddr->version;
+ tmp->numread ++;
}
found = 1;
break;
#if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
if ! $NOJAVA
then
-if ! java -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+if ! java -Xms50m -Xmx200m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
$ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
$JAVAOPTS $SRCFILES
then exit $?