From: adash Date: Wed, 23 Dec 2009 17:46:08 +0000 (+0000) Subject: other bug fixes X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=11755eb8a72401fd8b1b83bd9785dd918ebe5cb9;p=IRC.git other bug fixes --- diff --git a/Robust/src/Runtime/DSTM/interface/prefetch.c b/Robust/src/Runtime/DSTM/interface/prefetch.c index 52c71711..63df5e5b 100644 --- a/Robust/src/Runtime/DSTM/interface/prefetch.c +++ b/Robust/src/Runtime/DSTM/interface/prefetch.c @@ -9,28 +9,6 @@ extern sockPoolHashTable_t *transPResponseSocketPool; extern pthread_mutex_t prefetchcache_mutex; extern prehashtable_t pflookup; -//#define LOGTIMES -#ifdef LOGTIMES -extern char bigarray1[6*1024*1024]; -extern unsigned int bigarray2[6*1024*1024]; -extern unsigned int bigarray3[6*1024*1024]; -extern long long bigarray4[6*1024*1024]; -extern int bigarray5[6*1024*1024]; -extern int bigindex1; -#define LOGTIME(x,y,z,a,b) {\ - int tmp=bigindex1; \ - bigarray1[tmp]=x; \ - bigarray2[tmp]=y; \ - bigarray3[tmp]=z; \ - bigarray4[tmp]=a; \ - bigarray5[tmp]=b; \ - bigindex1++; \ -} -#else -#define LOGTIME(x,y,z,a,b) -//log(eventname, oid, type, time, unqiue id) -#endif - // Function for new prefetch call void rangePrefetch(unsigned int oid, short numoffset, short *offsets) { /* Allocate memory in prefetch queue and push the block there */ @@ -42,7 +20,6 @@ void rangePrefetch(unsigned int oid, short numoffset, short *offsets) { ((unsigned int *)node)[0] = oid; index = index + (sizeof(unsigned int)); *((short *)(node+index)) = numoffset; - LOGTIME('R',oid,numoffset,0,0); index = index + (sizeof(short)); memcpy(node+index, offsets, numoffset * sizeof(short)); movehead(qnodesize); @@ -55,9 +32,7 @@ void *transPrefetchNew() { int count = numavailable(); /* Check tuples if they are found locally */ - LOGTIME('Z',0,0,0,0); perMcPrefetchList_t* pilehead = processLocal(node,count); - LOGTIME('Y',0,0,0,0); if (pilehead!=NULL) { @@ -80,7 +55,7 @@ void *transPrefetchNew() { } perMcPrefetchList_t *processLocal(char *ptr, int numprefetches) { - int i,j; + int j; /* Initialize */ perMcPrefetchList_t *head = NULL; @@ -95,24 +70,23 @@ perMcPrefetchList_t *processLocal(char *ptr, int numprefetches) { int countInvalidObj=-1; objheader_t * header = searchObjInv(oid, top, &countInvalidObj); - //printf("%u %x\n", oid, header); if (header==NULL) { - LOGTIME('b',oid,0,0,countInvalidObj); //forward prefetch - int machinenum = lhashSearch(oid); - insertPrefetch(machinenum, oid, numoffset, offsetarray, &head); + if(oid!=0) { + int machinenum = lhashSearch(oid); + insertPrefetch(machinenum, oid, numoffset, offsetarray, &head); + } + //update ptr + ptr=((char *)&offsetarray[numoffset])+sizeof(int); continue; } dfsList[0]=oid; dfsList[1]=0; - LOGTIME('B',oid,TYPE(header),0,countInvalidObj); //Start searching the dfsList for(top=0; top>=0;) { oid=getNextOid(header, offsetarray, dfsList, top, &countInvalidObj); - LOGTIME('O',oid,0,0,countInvalidObj); - int isLastOffset=0; if (oid&1) { int oldisField=TYPE(header) < NUMCLASSES; top+=2; @@ -120,21 +94,19 @@ perMcPrefetchList_t *processLocal(char *ptr, int numprefetches) { dfsList[top+1]=0; header=searchObjInv(oid, top, &countInvalidObj); if (header==NULL) { - LOGTIME('c',oid,top,0,countInvalidObj); //forward prefetch int machinenum = lhashSearch(oid); - if (oldisField&&(dfsList[top-1]!=GET_RANGE(offsetarray[top+1]))) + if (oldisField&&(dfsList[top-1]!=GET_RANGE(offsetarray[top+1]))) { insertPrefetch(machinenum, oid, 2+numoffset-top, &offsetarray[top-2], &head); - else + } else { insertPrefetch(machinenum, oid, numoffset-top, &offsetarray[top], &head); + } } else if (top=0;) { @@ -206,22 +180,20 @@ perMcPrefetchList_t *processRemote(unsigned int oid, short * offsetarray, int s dfsList[top+1]=0; header=searchObj(oid); if (header==NULL) { - LOGTIME('h',oid,top,0,0); //forward prefetch //int machinenum = lhashSearch(oid); - //if (oldisField&&(dfsList[top-1]!=GET_RANGE(offsetarray[top+1]))) + if (oldisField&&(dfsList[top-1]!=GET_RANGE(offsetarray[top+1]))) { // insertPrefetch(machinenum, oid, 2+numoffset-top, &offsetarray[top-2], &head); - //else + } else { // insertPrefetch(machinenum, oid, numoffset-top, &offsetarray[top], &head); + } } else { sendOidFound(header, oid, sd, buffer, &bufoffset); - LOGTIME('H',oid,TYPE(header),0,top); if (top