struct lobjpointerblock {
void * lobjs[NUMLOBJPTRS];
- //void * dsts[NUMLOBJPTRS];
int lengths[NUMLOBJPTRS];
- //void * origs[NUMLOBJPTRS];
int hosts[NUMLOBJPTRS];
struct lobjpointerblock *next;
struct lobjpointerblock *prev;
gcspare=NULL;
} else {
tmp=RUNMALLOC_I(sizeof(struct pointerblock));
- } // if (gcspare!=NULL)
+ } // if (gcspare!=NULL)
gchead->next=tmp;
gchead=tmp;
gcheadindex=0;
RUNFREE(tmp);
} else {
gcspare=tmp;
- } // if (gcspare!=NULL)
+ } // if (gcspare!=NULL)
} // if (gctailindex==NUMPTRS)
return gctail->ptrs[gctailindex++];
} // void * gc_dequeue()
gclobjspare=NULL;
} else {
tmp=RUNMALLOC_I(sizeof(struct lobjpointerblock));
- } // if (gclobjspare!=NULL)
+ } // if (gclobjspare!=NULL)
gclobjhead->next=tmp;
tmp->prev = gclobjhead;
gclobjhead=tmp;
gclobjtailindex2=1;
} else {
gclobjtailindex2++;
- } // if (gclobjtailindex2==NUMLOBJPTRS)
+ } // if (gclobjtailindex2==NUMLOBJPTRS)
} // void * gc_lobjdequeue2()
inline int gc_lobjmoreItems2_I() {
gclobjtailindex2=NUMLOBJPTRS-1;
} else {
gclobjtailindex2--;
- } // if (gclobjtailindex2==NUMLOBJPTRS)
+ } // if (gclobjtailindex2==NUMLOBJPTRS)
} // void * gc_lobjdequeue3()
inline int gc_lobjmoreItems3_I() {
int elementsize=classsize[type];
int length=ao->___length___;
size=sizeof(struct ArrayObject)+length*elementsize;
- } // if(type < NUMCLASSES)
+ } // if(type < NUMCLASSES)
*ttype = type;
*tsize = size;
}
if(gccorestatus[i] != 0) {
allStall = false;
break;
- } // if(gccorestatus[i] != 0)
- } // for(i = 0; i < NUMCORES4GC; ++i)
+ } // if(gccorestatus[i] != 0)
+ } // for(i = 0; i < NUMCORES4GC; ++i)
return allStall;
}
if(gccorestatus[i] != 0) {
allStall = false;
break;
- } // if(gccorestatus[i] != 0)
- } // for(i = 0; i < NUMCORESACTIVE; ++i)
+ } // if(gccorestatus[i] != 0)
+ } // for(i = 0; i < NUMCORESACTIVE; ++i)
return allStall;
}
BAMBOO_DEBUGPRINT(0xee0a);
#endif
} // void checkMarkStatue()
-/*
-inline bool preGC() {
- // preparation for gc
- // make sure to clear all incoming msgs espacially transfer obj msgs
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec01);
-#endif
- int i;
- if((!waitconfirm) ||
- (waitconfirm && (numconfirm == 0))) {
- // send out status confirm msgs to all cores to check if there are
- // transfer obj msgs on-the-fly
- waitconfirm = true;
- numconfirm = NUMCORESACTIVE - 1;
- for(i = 1; i < NUMCORESACTIVE; ++i) {
- corestatus[i] = 1;
- // send status confirm msg to core i
- send_msg_1(i, STATUSCONFIRM, false);
- } // for(i = 1; i < NUMCORESACTIVE; ++i)
-
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec02);
-#endif
- while(true) {
- if(numconfirm == 0) {
- break;
- }
- } // wait for confirmations
- waitconfirm = false;
- numconfirm = 0;
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec03);
-#endif
- numsendobjs[BAMBOO_NUM_OF_CORE] = self_numsendobjs;
- numreceiveobjs[BAMBOO_NUM_OF_CORE] = self_numreceiveobjs;
- int sumsendobj = 0;
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec04);
-#endif
- for(i = 0; i < NUMCORESACTIVE; ++i) {
- sumsendobj += numsendobjs[i];
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xf000 + numsendobjs[i]);
-#endif
- } // for(i = 1; i < NUMCORESACTIVE; ++i)
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec05);
- BAMBOO_DEBUGPRINT_REG(sumsendobj);
-#endif
- for(i = 0; i < NUMCORESACTIVE; ++i) {
- sumsendobj -= numreceiveobjs[i];
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xf000 + numreceiveobjs[i]);
-#endif
- } // for(i = 1; i < NUMCORESACTIVE; ++i)
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec06);
- BAMBOO_DEBUGPRINT_REG(sumsendobj);
-#endif
- if(0 == sumsendobj) {
- return true;
- } else {
- // still have some transfer obj msgs on-the-fly, can not start gc
- return false;
- } // if(0 == sumsendobj)
- } else {
-#ifdef DEBUG
- BAMBOO_DEBUGPRINT(0xec07);
-#endif
- // previously asked for status confirmation and do not have all the
- // confirmations yet, can not start gc
- return false;
- } // if((!waitconfirm) ||
-} // bool preGC()*/
inline void initGC() {
int i;
gcmarkedptrbound = 0;
gcobj2map = 0;
gcmappedobj = 0;
- //gcismapped = false;
gcnumlobjs = 0;
gcmovestartaddr = 0;
gctomove = false;
#else
mgchashreset(gcpointertbl);
#endif
- //gcpointertbl = allocateMGCHash(20);
freeMGCHash(gcforwardobjtbl);
gcforwardobjtbl = allocateMGCHash(20, 3);
// initialize the mapping info related structures
if((BAMBOO_NUM_OF_CORE < NUMCORES4GC) && (gcsharedptbl != NULL)) {
// Never free the shared hash table, just reset it
- /*freeGCSharedHash(gcsharedptbl);
- gcsharedptbl = allocateGCSharedHash(20);*/
mgcsharedhashReset(gcsharedptbl);
}
- // Zero out the remaining bamboo_cur_msp
- // Only zero out the first 4 bytes of the remaining memory
- /*if((bamboo_cur_msp != 0)
- && (bamboo_smem_zero_top == bamboo_cur_msp)
- && (bamboo_smem_size > 0)) {
- *((int *)bamboo_cur_msp) = 0;
- }*/
#ifdef GC_PROFILE
gc_num_livespace = 0;
gc_num_freespace = 0;
gcheaptop = dst; // Note: record the start of cached lobjs with gcheaptop
// cache the largeObjs to the top of the shared heap
- //gclobjtail2 = gclobjtail;
- //gclobjtailindex2 = gclobjtailindex;
dst = gcbaseva + (BAMBOO_SHARED_MEM_SIZE);
while(gc_lobjmoreItems3_I()) {
gc_lobjdequeue3_I();
if((int)dst < (int)(gclobjtail2->lobjs[gclobjtailindex2])+size) {
memmove(dst, gclobjtail2->lobjs[gclobjtailindex2], size);
} else {
- //BAMBOO_WRITE_HINT_CACHE(dst, size);
memcpy(dst, gclobjtail2->lobjs[gclobjtailindex2], size);
}
#ifdef DEBUG
#endif
gcheaptop += size;
// cache the mapping info anyway
- //if(ptr != tmpheaptop) {
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop);
#else
mgchashInsert_I(gcpointertbl, ptr, tmpheaptop);
#endif
- //MGCHashadd_I(gcpointertbl, ptr, tmpheaptop);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- //}
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcdca);
BAMBOO_DEBUGPRINT_REG(ptr);
if((int)gcheaptop < (int)(tmpheaptop)+size) {
memmove(tmpheaptop, gcheaptop, size);
} else {
- //BAMBOO_WRITE_HINT_CACHE(tmpheaptop, size);
memcpy(tmpheaptop, gcheaptop, size);
}
// fill the remaining space with -2 padding
gcheaptop += size;
cpysize += isize;
// cache the mapping info anyway
- //if(ptr != tmpheaptop) {
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop);
#else
mgchashInsert_I(gcpointertbl, ptr, tmpheaptop);
#endif
- //MGCHashadd_I(gcpointertbl, ptr, tmpheaptop);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- //}
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcdcc);
BAMBOO_DEBUGPRINT_REG(ptr);
BAMBOO_DEBUGPRINT_REG(ptr);
BAMBOO_DEBUGPRINT_REG(tmpheaptop);
#endif
- } // if(host != BAMBOO_NUM_OF_CORE)
+ } // if(host != BAMBOO_NUM_OF_CORE)
tmpheaptop += isize;
// update bamboo_smemtbl
// check if this obj has been forwarded
if(!MGCHashcontains(gcforwardobjtbl, (int)objptr)) {
// send a msg to host informing that objptr is active
- send_msg_2(host, GCMARKEDOBJ, objptr, /*BAMBOO_NUM_OF_CORE,*/ false);
+ send_msg_2(host, GCMARKEDOBJ, objptr, false);
#ifdef GC_PROFILE
gc_num_forwardobj++;
#endif // GC_PROFILE
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
gc_enqueue_I(objptr);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- } // if(ISSHAREDOBJ(objptr))
+ } // if(ISSHAREDOBJ(objptr))
} // void markObj(void * objptr)
// enqueue root objs
(struct transObjInfo *)(item->objectptr);
markObj(totransobj->objptr);
item = getNextQueueItem(item);
- } // while(item != NULL)
+ } // while(item != NULL)
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe508);
gcself_numsendobjs, gcself_numreceiveobjs, false);
sendStall = true;
}
- } // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) ...
+ } // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) ...
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xed0a);
#endif
BAMBOO_DEBUGPRINT_REG(b);
BAMBOO_DEBUGPRINT_REG(*remain);
#endif
- } // if(memneed < remain)
+ } // if(memneed < remain)
gcmovepending--;
} // void compact2Heaptophelper_I(int, int*, int*, int*)
// find the current heap top and make them move to the heap top
int p;
int numblocks = gcfilledblocks[gctopcore];
- //BASEPTR(gctopcore, numblocks, &p);
p = gcloads[gctopcore];
int b;
BLOCKINDEX(p, &b);
// the top core is not free now
return;
}
- } // if((gccorestatus[i] != 0) && (gcrequiredmems[i] > 0))
+ } // if((gccorestatus[i] != 0) && (gcrequiredmems[i] > 0))
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- } // for(i = 0; i < NUMCORES4GC; i++)
+ } // for(i = 0; i < NUMCORES4GC; i++)
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xd106);
#endif
} // if(gcfilledblocks[i] < gcstopblock[i]) else ...
}
i++;
- } // if(nosparemem)
+ } // if(nosparemem)
if(!haspending) {
if(gccorestatus[j] != 0) {
// not finished, check if it has pending move requests
haspending = false;
noblock = true;
}
- } // for(i = 0; i < NUMCORES4GC; i++)
+ } // for(i = 0; i < NUMCORES4GC; i++)
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcccc);
BAMBOO_DEBUGPRINT_REG(hasrunning);
orig->ptr = orig->base; // set current ptr to out of boundary too
return false;
}
- //orig->bound = orig->base + BAMBOO_SMEM_SIZE;
orig->blockbase = orig->base;
orig->sblockindex = (orig->blockbase-gcbaseva)/BAMBOO_SMEM_SIZE;
sbchanged = true;
if((int)(orig->ptr) < (int)(to->ptr)+size) {
memmove(to->ptr, orig->ptr, size);
} else {
- //BAMBOO_WRITE_HINT_CACHE(to->ptr, size);
memcpy(to->ptr, orig->ptr, size);
}
// fill the remaining space with -2
#else
mgchashInsert_I(gcpointertbl, orig->ptr, to->ptr);
#endif
- //MGCHashadd_I(gcpointertbl, orig->ptr, to->ptr);
if(isremote) {
// add to the sharedptbl
if(gcsharedptbl != NULL) {
- //GCSharedHashadd_I(gcsharedptbl, orig->ptr, to->ptr);
mgcsharedhashInsert_I(gcsharedptbl, orig->ptr, to->ptr);
}
}
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- //}
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xcdce);
BAMBOO_DEBUGPRINT_REG(orig->ptr);
(to->offset) : (to->bound-BAMBOO_SMEM_SIZE+to->offset);
to->base = to->ptr;
to->offset = BAMBOO_CACHE_LINE_SIZE;
- to->ptr += to->offset; // for header
+ to->ptr += to->offset; // for header
to->top += to->offset;
if(gcdstcore == BAMBOO_NUM_OF_CORE) {
*localcompact = true;
#endif
// a shared obj ptr, change to new address
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-#ifdef GC_PROFILE
- //unsigned long long ttime = BAMBOO_GET_EXE_TIME();
-#endif
#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, objptr, &dstptr);
#else
dstptr = mgchashSearch(gcpointertbl, objptr);
-#endif
- //MGCHashget(gcpointertbl, objptr, &dstptr);
-#ifdef GC_PROFILE
- //flushstalltime += BAMBOO_GET_EXE_TIME()-ttime;
#endif
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
#ifdef DEBUG
#endif
if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) {
// error! the obj is right on this core, but cannot find it
- //BAMBOO_DEBUGPRINT(0xecec);
BAMBOO_DEBUGPRINT_REG(objptr);
BAMBOO_EXIT(0xb103);
- // assume that the obj has not been moved, use the original address
- //dstptr = objptr;
} else {
int hostc = hostcore(objptr);
-#ifdef GC_PROFILE
- //unsigned long long ttimet = BAMBOO_GET_EXE_TIME();
-#endif
// check the corresponsing sharedptbl
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- //struct GCSharedHash * sptbl = gcrpointertbls[hostcore(objptr)];
mgcsharedhashtbl_t * sptbl = gcrpointertbls[hostc];
if(sptbl != NULL) {
- //GCSharedHashget(sptbl, (int)objptr, &dstptr);
dstptr = mgcsharedhashSearch(sptbl, (int)objptr);
if(dstptr != NULL) {
#ifdef LOCALHASHTBL_TEST
}
}
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
-#ifdef GC_PROFILE
- //flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimet;
-#endif
if(dstptr == NULL) {
// still can not get the mapping info,
break;
}
}
-#ifdef GC_PROFILE
- //flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimet;
-#endif
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, objptr, &dstptr);
#else
dstptr = mgchashSearch(gcpointertbl, objptr);
#endif
- //MGCHashget(gcpointertbl, objptr, &dstptr);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
} // if(dstptr == NULL)
} // if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) else ...
#ifdef DEBUG
BAMBOO_DEBUGPRINT_REG(dstptr);
#endif
- } // if(NULL == dstptr)
- } // if(ISSHAREDOBJ(objptr))
- // if not a shared obj, return NULL to indicate no need to flush
+ } // if(NULL == dstptr)
+ } // if(ISSHAREDOBJ(objptr))
+ // if not a shared obj, return NULL to indicate no need to flush
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe404);
#endif
totransobj->objptr = dst;
}
item = getNextQueueItem(item);
- } // while(item != NULL)
+ } // while(item != NULL)
// enqueue lock related info
for(i = 0; i < runtime_locklen; ++i) {
}
} // for(i=1; i<=size; i++)
} // if (pointer==0) else if (((INTPTR)pointer)==1) else ()
- // restore the mark field, indicating that this obj has been flushed
+ // restore the mark field, indicating that this obj has been flushed
if(ISSHAREDOBJ(ptr)) {
((int *)(ptr))[6] = INIT;
}
}
} // for(i=1; i<=size; i++)
} // if (pointer==0) else if (((INTPTR)pointer)==1) else ()
- // restore the mark field, indicating that this obj has been flushed
+ // restore the mark field, indicating that this obj has been flushed
((int *)(ptr))[6] = INIT;
} // if(((int *)(ptr))[6] == COMPACTED)
} // while(gc_lobjmoreItems())
local_tbl=(unsigned int *)(
((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
- // TODO
// check the freqency, decide if this page is hot for the core
if(hotfreq < freq) {
hotfreq = freq;
local_tbl=(unsigned int *)(
((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
- // TODO
// check the freqency, decide if this page is hot for the core
if(hotfreq < freq) {
hotfreq = freq;
hotestcore = i;
}
- // TODO
- /*if(page_sva == 0x10e90000) {
- if(freq != 0) tprintf("0x10e90000 core %d, %d\n", i, freq);
- }*/
}
- // TODO
// Decide the cache strategy for this page
// If decide to adapt a new cache strategy, write into the shared block of
// the gcsharedsamplingtbl. The mem recording information that has been
core2heavypages[hotestcore][3*index+2] = totalfreq;
core2heavypages[hotestcore][3*index+1] = (unsigned long long)(tmp_p-1);
core2heavypages[hotestcore][0]++;
- // TODO
- /*if(page_sva == 0x10f10000) {
- int block = 0;
- BLOCKINDEX(page_sva, &block);
- int coren = gc_block2core[block%(NUMCORES4GC*2)];
- int coord_x = bamboo_cpu2coords[2*coren]+1;
- int coord_y = bamboo_cpu2coords[2*coren+1]+1;
- tprintf("+++ %x(%d-%d,%d) hotcore %d, total %d, hot %d, remote %d, index %d p %x\n", (int)page_sva, coren, coord_x, coord_y, hotestcore, totalfreq, hotfreq, remoteaccess, index, (int)(tmp_p-1));
- }*/
}
unsigned long long workload_threshold =
for(int i = 0; i < NUMCORESACTIVE; i++) {
int j = 1;
int index = (int)core2heavypages[i][0];
- if(workload[i] > workload_threshold/*GC_CACHE_ADAPT_OVERLOAD_THRESHOLD*/) {
+ if(workload[i] > workload_threshold) {
// sort according to the remoteaccess
gc_quicksort(&core2heavypages[i][0], 1, index, 0);
- while((workload[i] > workload_threshold/*GC_CACHE_ADAPT_OVERLOAD_THRESHOLD*/) && (j<index*3)) {
+ while((workload[i] > workload_threshold) && (j<index*3)) {
// hfh those pages with more remote accesses
bamboo_cache_policy_t policy = {0};
policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
local_tbl=(unsigned int *)(
((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
- // TODO
// check the freqency, decide if this page is hot for the core
if(hotfreq < freq) {
hotfreq = freq;
hotestcore = i;
}
- // TODO
- /*if(page_sva == 0x10e90000) {
- if(freq != 0) tprintf("0x10e90000 core %d, %d\n", i, freq);
- }*/
}
- // TODO
// Decide the cache strategy for this page
// If decide to adapt a new cache strategy, write into the shared block of
// the gcsharedsamplingtbl. The mem recording information that has been
core2heavypages[hotestcore][3*index+2] = totalfreq;
core2heavypages[hotestcore][3*index+1] = (unsigned long long)(tmp_p-1);
core2heavypages[hotestcore][0]++;
- // TODO
- /*if(page_sva == 0x10f10000) {
- int block = 0;
- BLOCKINDEX(page_sva, &block);
- int coren = gc_block2core[block%(NUMCORES4GC*2)];
- int coord_x = bamboo_cpu2coords[2*coren]+1;
- int coord_y = bamboo_cpu2coords[2*coren+1]+1;
- tprintf("+++ %x(%d-%d,%d) hotcore %d, total %d, hot %d, remote %d, index %d p %x\n", (int)page_sva, coren, coord_x, coord_y, hotestcore, totalfreq, hotfreq, remoteaccess, index, (int)(tmp_p-1));
- }*/
}
unsigned long long workload_threshold =
for(int i = 0; i < NUMCORESACTIVE; i++) {
int j = 1;
int index = (int)core2heavypages[i][0];
- if(workload[i] > workload_threshold/*GC_CACHE_ADAPT_OVERLOAD_THRESHOLD*/) {
+ if(workload[i] > workload_threshold) {
// sort according to the remoteaccess
gc_quicksort(&core2heavypages[i][0], 1, index, 0);
- while((workload[i] > workload_threshold/*GC_CACHE_ADAPT_OVERLOAD_THRESHOLD*/) && (j<index*3)) {
+ while((workload[i] > workload_threshold) && (j<index*3)) {
// hfh those pages with more remote accesses
bamboo_cache_policy_t policy = {0};
policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
// num_crowded <= GC_CACHE_ADAPT_CROWD_THRESHOLD and if there are enough
// items, it is always == GC_CACHE_ADAPT_CROWD_THRESHOLD
if(num_crowded > GC_CACHE_ADAPT_CROWD_THRESHOLD) {
-//inner_crowd:
// need to hfh these pages
// sort the pages according to remote access
gc_quicksort(&core2heavypages[i][0], j/3+1, j/3+num_crowded, 0);
- //while((num_crowded--) && (j < index*3)) {
- // h4h those pages with more remote accesses
- bamboo_cache_policy_t policy = {0};
- policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
- *((int*)core2heavypages[i][j]) = policy.word;
- workload[i] -= core2heavypages[i][j+1];
- t_workload -= core2heavypages[i][j+1];
- /*if((j/3+GC_CACHE_ADAPT_CROWD_THRESHOLD) < index) {
- t_workload +=
- core2heavypages[i][j+GC_CACHE_ADAPT_CROWD_THRESHOLD*3+1];
- }*/
- j += 3;
- threshold = GC_CACHE_ADAPT_ACCESS_THRESHOLD*workload[i]/100;
- /*if(t_workload <= threshold) {
- break;
- }
- }
- if((j < index*3) && (t_workload > threshold)) {
- num_crowded = ((index-j/3) > GC_CACHE_ADAPT_CROWD_THRESHOLD) ?
- (GC_CACHE_ADAPT_CROWD_THRESHOLD) : (index-j/3);*/
- goto inner_crowd;
-// }
+ // h4h those pages with more remote accesses
+ bamboo_cache_policy_t policy = {0};
+ policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
+ *((int*)core2heavypages[i][j]) = policy.word;
+ workload[i] -= core2heavypages[i][j+1];
+ t_workload -= core2heavypages[i][j+1];
+ j += 3;
+ threshold = GC_CACHE_ADAPT_ACCESS_THRESHOLD*workload[i]/100;
+ goto inner_crowd;
}
}
} // int cacheAdapt_policy_overload()
void cacheAdapt_master() {
-#ifdef GC_CACHE_ADAPT
- //gc_output_cache_sampling_r();
-#endif // GC_CACHE_ADAPT
+#ifdef GC_CACHE_ADAPT_SAMPLING_OUTPUT
+ gc_output_cache_sampling_r();
+#endif // GC_CACHE_ADAPT_SAMPLING_OUTPUT
int numchanged = 0;
// check the statistic data
// for each page, decide the new cache strategy
numchanged = cacheAdapt_policy_crowd();
#endif
*gccachepolicytbl = numchanged;
- // TODO
- //if(numchanged > 0) tprintf("=================\n");
}
// adapt the cache strategy for the mutator
// read out the policy
int page_index = *tmp_p;
bamboo_cache_policy_t policy = (bamboo_cache_policy_t)(*(tmp_p+1));
- // TODO
- /*if(BAMBOO_NUM_OF_CORE == 0) {
- tprintf("va: %x, policy: %d (%d,%d) \n",
- (int)(page_index*(BAMBOO_PAGE_SIZE)+gcbaseva), policy.cache_mode,
- policy.lotar_x, policy.lotar_y);
- }*/
// adapt the policy
bamboo_adapt_cache_policy(page_index*(BAMBOO_PAGE_SIZE)+gcbaseva,
policy, BAMBOO_PAGE_SIZE);
tmp_p += 2;
}
- //if(BAMBOO_NUM_OF_CORE == 0) tprintf("=================\n"); // TODO
}
void gc_output_cache_sampling() {
#ifdef GC_PROFILE
gc_profileItem();
#endif
-#ifdef GC_CACHE_ADAPT
- //gc_output_cache_sampling();
+#ifdef GC_CACHE_ADAPT_POLICY_OUTPUT
+ gc_output_cache_sampling();
#endif // GC_CACHE_ADAPT
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) Start mark phase \n", udn_tile_coord_x(),
// restore the gcstatus of all cores
// Note: all cores have to do mark including non-gc cores
gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
- for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
+ for(i = 1; i < NUMCORESACTIVE; ++i) {
gccorestatus[i] = 1;
// send GC start messages to all cores
send_msg_1(i, GCSTART, false);
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) prepare to cache large objs \n", udn_tile_coord_x(),
udn_tile_coord_y());
- //dumpSMem();
#endif
// cache all large objs
if(!cacheLObjs()) {
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) mark phase finished \n", udn_tile_coord_x(),
udn_tile_coord_y());
- //dumpSMem();
#endif
//int tmptopptr = 0;
//BASEPTR(gctopcore, 0, &tmptopptr);
BASEPTR(i, numpbc, &tmpcoreptr);
//send start compact messages to all cores
//TODO bug here, do not know if the direction is positive or negtive?
- if (tmpcoreptr < tmpheaptop /*tmptopptr*/) {
+ if (tmpcoreptr < tmpheaptop) {
gcstopblock[i] = numpbc + 1;
if(i != STARTUPCORE) {
send_msg_2(i, GCSTARTCOMPACT, numpbc+1, false);
} else {
gcblock2fill = numpbc+1;
- } // if(i != STARTUPCORE)
+ } // if(i != STARTUPCORE)
} else {
gcstopblock[i] = numpbc;
if(i != STARTUPCORE) {
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) prepare to move large objs \n", udn_tile_coord_x(),
udn_tile_coord_y());
- //dumpSMem();
#endif
// move largeObjs
moveLObjs();
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) compact phase finished \n", udn_tile_coord_x(),
udn_tile_coord_y());
- //dumpSMem();
#endif
RUNFREE(orig);
RUNFREE(to);
gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
// Note: all cores should flush their runtime data including non-gc
// cores
- for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
+ for(i = 1; i < NUMCORESACTIVE; ++i) {
// send start flush messages to all cores
gccorestatus[i] = 1;
send_msg_1(i, GCSTARTFLUSH, false);
#endif
// flush phase
flush(stackptr);
+
#ifdef GC_CACHE_ADAPT
// now the master core need to decide the new cache strategy
cacheAdapt_master();
gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
// Note: all cores should flush their runtime data including non-gc
// cores
- for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
+ for(i = 1; i < NUMCORESACTIVE; ++i) {
// send start flush messages to all cores
gccorestatus[i] = 1;
send_msg_1(i, GCSTARTPREF, false);
gc_profileEnd();
#endif
gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
- for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
+ for(i = 1; i < NUMCORESACTIVE; ++i) {
// send gc finish messages to all cores
send_msg_1(i, GCFINISH, false);
gccorestatus[i] = 1;
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) gc finished \n", udn_tile_coord_x(),
udn_tile_coord_y());
- //dumpSMem();
#endif
} // void gc_master(struct garbagelist * stackptr)
gc_profileStart();
#endif
pregccheck:
- //BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
gcnumsendobjs[0][BAMBOO_NUM_OF_CORE] = self_numsendobjs;
gcnumreceiveobjs[0][BAMBOO_NUM_OF_CORE] = self_numreceiveobjs;
int sumsendobj = 0;
}
#ifdef RAWPATH // TODO GC_DEBUG
printf("(%x,%x) start gc! \n", udn_tile_coord_x(), udn_tile_coord_y());
- //dumpSMem();
#endif
// Zero out the remaining bamboo_cur_msp
// Only zero out the first 4 bytes of the remaining memory
#endif
#ifdef GC_CACHE_ADAPT
#ifdef GC_CACHE_SAMPLING
- // disable the timer interrupt
- //bamboo_mask_timer_intr();
// get the sampling data
bamboo_output_dtlb_sampling();
#endif // GC_CACHE_SAMPLING
#endif
#ifdef GC_CACHE_ADAPT
#ifdef GC_CACHE_SAMPLING
- // disable the timer interrupt
- //bamboo_mask_timer_intr();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// get the sampling data
bamboo_output_dtlb_sampling();
#endif
#ifdef GC_CACHE_ADAPT
#ifdef GC_CACHE_SAMPLING
- // disable the timer interrupt
- //bamboo_mask_timer_intr();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// get the sampling data
bamboo_output_dtlb_sampling();
// output the profiling data
void gc_outputProfileData() {
-/*#ifdef USEIO
- int i,j;
- unsigned long long totalgc = 0;
-
- //printf("Start Time, End Time, Duration\n");
- // output task related info
- for(i = 0; i < gc_infoIndex; i++) {
- GCInfo * gcInfo = gc_infoArray[i];
- unsigned long long tmp = 0;
- for(j = 0; j < gcInfo->index; j++) {
- printf("%lld(%lld), ", gcInfo->time[j], (gcInfo->time[j]-tmp));
- tmp = gcInfo->time[j];
- }
- tmp = (tmp-gcInfo->time[0]);
- printf(" ++ %lld \n", tmp);
- totalgc += tmp;
- }
-
- if(gc_infoOverflow) {
- printf("Caution: gc info overflow!\n");
- }
-
- printf("\n\n total gc time: %lld \n", totalgc);
-#else*/
int i = 0;
int j = 0;
unsigned long long totalgc = 0;
#ifndef BAMBOO_MEMPROF
BAMBOO_DEBUGPRINT(0xeeee);
#endif
-//#endif
}
#endif // #ifdef GC_PROFILE
#else
// defaultly using local mode
bamboo_smem_mode = SMEMLOCAL;
- //bamboo_smem_mode = SMEMGLOBAL;
- //bamboo_smem_mode = SMEMFIXED;
#endif
} // void setupsmemmode(void)
#endif
outmsglast = 0;
outmsgleft = 0;
isMsgHanging = false;
- //isMsgSending = false;
smemflag = true;
bamboo_cur_msp = NULL;
gcflag = false;
gcprocessing = false;
gcphase = FINISHPHASE;
- //gcnumpre = 0;
gcprecheck = true;
gccurr_heaptop = 0;
gcself_numsendobjs = 0;
#else
gcpointertbl = mgchashCreate_I(2000, 0.75);
#endif
- //gcpointertbl = allocateMGCHash_I(20);
gcforwardobjtbl = allocateMGCHash_I(20, 3);
gcobj2map = 0;
gcmappedobj = 0;
- //gcismapped = false;
gcnumlobjs = 0;
gcheaptop = 0;
gctopcore = 0;
kk++;
}
t_size = tmp_k >> kk;
- gcsharedptbl = mgcsharedhashCreate_I(t_size,0.30);//allocateGCSharedHash_I(20);
+ gcsharedptbl = mgcsharedhashCreate_I(t_size,0.30);
} else {
gcsharedptbl = NULL;
}
BAMBOO_MEMSET_WH(gcrpointertbls, 0,
sizeof(mgcsharedhashtbl_t *)*NUMCORES4GC);
- //sizeof(struct RuntimeHash *)*NUMCORES4GC);
#ifdef SMEMM
gcmem_mixed_threshold = (unsigned int)((BAMBOO_SHARED_MEM_SIZE
-bamboo_reserved_smem*BAMBOO_SMEM_SIZE)*0.8);
#ifdef PROFILE
stall = false;
- //isInterrupt = true;
totalexetime = -1;
- //interrupttime = 0;
taskInfoIndex = 0;
taskInfoOverflow = false;
#ifdef PROFILE_INTERRUPT
#else
mgchashDelete(gcpointertbl);
#endif
- //freeMGCHash(gcpointertbl);
freeMGCHash(gcforwardobjtbl);
- // for mapping info structures
- //freeRuntimeHash(gcrcoretbl);
#else
freeRuntimeHash(lockRedirectTbl);
freeRuntimeHash(objRedirectLockTbl);
if(!isEmpty(&objqueue)) {
profileTaskStart("objqueue checking");
isChecking = true;
- } // if(!isEmpty(&objqueue))
+ } // if(!isEmpty(&objqueue))
#endif
#endif
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xf001);
#endif
-#ifdef PROFILE
- //isInterrupt = false;
-#endif
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xeee1);
#endif
} // while(qitem != NULL)
// try to execute active tasks already enqueued first
addNewItem_I(&objqueue, objInfo);
-#ifdef PROFILE
- //isInterrupt = true;
-#endif
objqueuebreak:
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
#ifdef DEBUG
#ifdef USEIO
totalexetime = BAMBOO_GET_EXE_TIME() - bamboo_start_time;
#else
-#ifdef PROFILE
- //BAMBOO_DEBUGPRINT_REG(interrupttime);
-#endif
BAMBOO_DEBUGPRINT(BAMBOO_GET_EXE_TIME() - bamboo_start_time);
//BAMBOO_DEBUGPRINT_REG(total_num_t6); // TODO for test
BAMBOO_DEBUGPRINT_REG(corenum);
BAMBOO_DEBUGPRINT(STARTUPCORE);
#endif
- //BAMBOO_DEBUGPRINT(BAMBOO_GET_EXE_TIME()); // TODO
// initialize runtime data structures
initruntimedata();
if(BAMBOO_NUM_OF_CORE > NUMCORESACTIVE - 1) {
// non-executing cores, only processing communications
activetasks = NULL;
-#ifdef PROFILE
- //isInterrupt = false;
-#endif
fakeExecution();
} else {
/* Create queue of active tasks */
return v;
}
-
-
/* This function updates the flag for object ptr. It or's the flag
with the or mask and and's it with the andmask. */
struct ___Object___ *ptr = (struct ___Object___ *)vptr;
{
- //struct QueueItem *tmpptr;
struct parameterwrapper * parameter=NULL;
int j;
int i;
goto nextloop; //that means the object has no tag
//but that param needs tag
else if(tagptr->type==TAGTYPE) { //one tag
- //struct ___TagDescriptor___ * tag=
- //(struct ___TagDescriptor___*) tagptr;
for(i=0; i<parameter->numbertags; i++) {
//slotid is parameter->tagarray[2*i];
int tagid=parameter->tagarray[2*i+1];
if (tagid!=tagptr->flag)
goto nextloop; /*We don't have this tag */
}
- } else { //multiple tags
+ } else { //multiple tags
struct ArrayObject * ao=(struct ArrayObject *) tagptr;
for(i=0; i<parameter->numbertags; i++) {
//slotid is parameter->tagarray[2*i];
struct ___Object___ *ptr = (struct ___Object___ *)vptr;
{
- //struct QueueItem *tmpptr;
struct parameterwrapper * parameter=NULL;
int j;
int i;
goto nextloop; //that means the object has no tag
//but that param needs tag
else if(tagptr->type==TAGTYPE) { //one tag
- //struct ___TagDescriptor___*tag=(struct ___TagDescriptor___*)tagptr;
for(i=0; i<parameter->numbertags; i++) {
//slotid is parameter->tagarray[2*i];
int tagid=parameter->tagarray[2*i+1];
#endif
{ // nonfixed size
if(size > 1) {
- msglength = msgdata[(msgdataindex+1)&(BAMBOO_MSG_BUF_MASK)/*%(BAMBOO_MSG_BUF_LENGTH)*/];
+ msglength = msgdata[(msgdataindex+1)&(BAMBOO_MSG_BUF_MASK)];
} else {
return -1;
}
}
INLINE void processmsg_transobj_I() {
-#ifdef PROFILE_INTERRUPT
- /*if(!interruptInfoOverflow) {
- InterruptInfo* intInfo = RUNMALLOC_I(sizeof(struct interrupt_info));
- interruptInfoArray[interruptInfoIndex] = intInfo;
- intInfo->startTime = BAMBOO_GET_EXE_TIME();
- intInfo->endTime = -1;
- }*/
-#endif
MSG_INDEXINC_I();
struct transObjInfo * transObj=RUNMALLOC_I(sizeof(struct transObjInfo));
int k = 0;
for(k = 0; k < transObj->length; ++k) {
transObj->queues[2*k] = msgdata[msgdataindex]; //[3+2*k];
MSG_INDEXINC_I();
-#ifdef DEBUG
-#ifndef CLOSE_PRINT
- //BAMBOO_DEBUGPRINT_REG(transObj->queues[2*k]);
-#endif
-#endif
transObj->queues[2*k+1] = msgdata[msgdataindex]; //[3+2*k+1];
MSG_INDEXINC_I();
-#ifdef DEBUG
-#ifndef CLOSE_PRINT
- //BAMBOO_DEBUGPRINT_REG(transObj->queues[2*k+1]);
-#endif
-#endif
}
// check if there is an existing duplicate item
{
}
}
#endif
-#ifdef PROFILE_INTERRUPT
- /*if(!interruptInfoOverflow) {
- interruptInfoArray[interruptInfoIndex]->endTime=BAMBOO_GET_EXE_TIME();
- interruptInfoIndex++;
- if(interruptInfoIndex == INTERRUPTINFOLENGTH) {
- interruptInfoOverflow = true;
- }
- }*/
-#endif
}
INLINE void processmsg_transtall_I() {
}
INLINE void processmsg_memrequest_I() {
-#ifdef PROFILE_INTERRUPT
- /*if(!interruptInfoOverflow) {
- InterruptInfo* intInfo = RUNMALLOC_I(sizeof(struct interrupt_info));
- interruptInfoArray[interruptInfoIndex] = intInfo;
- intInfo->startTime = BAMBOO_GET_EXE_TIME();
- intInfo->endTime = -1;
- }*/
-#endif
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
int data2 = msgdata[msgdataindex];
}
#endif
}
-#ifdef PROFILE_INTERRUPT
- /*if(!interruptInfoOverflow) {
- interruptInfoArray[interruptInfoIndex]->endTime=BAMBOO_GET_EXE_TIME();
- interruptInfoIndex++;
- if(interruptInfoIndex == INTERRUPTINFOLENGTH) {
- interruptInfoOverflow = true;
- }
- }*/
-#endif
}
INLINE void processmsg_memresponse_I() {
#ifdef MULTICORE_GC
// fill header to store the size of this mem block
BAMBOO_MEMSET_WH(data1, '\0', BAMBOO_CACHE_LINE_SIZE);
- //memset(data1, 0, BAMBOO_CACHE_LINE_SIZE);
(*((int*)data1)) = data2;
bamboo_smem_size = data2 - BAMBOO_CACHE_LINE_SIZE;
bamboo_cur_msp = data1 + BAMBOO_CACHE_LINE_SIZE;
}
INLINE void processmsg_gcmaprequest_I() {
-#ifdef GC_PROFILE
- //unsigned long long ttime = BAMBOO_GET_EXE_TIME();
-#endif
void * dstptr = NULL;
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
int data2 = msgdata[msgdataindex];
MSG_INDEXINC_I();
-#ifdef GC_PROFILE
- // TODO unsigned long long ttime = BAMBOO_GET_EXE_TIME();
-#endif
#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, data1, &dstptr);
#else
dstptr = mgchashSearch(gcpointertbl, data1);
-#endif
- //MGCHashget(gcpointertbl, data1, &dstptr);
-#ifdef GC_PROFILE
- // TODO flushstalltime += BAMBOO_GET_EXE_TIME() - ttime;
-#endif
-#ifdef GC_PROFILE
- // TODO unsigned long long ttimei = BAMBOO_GET_EXE_TIME();
#endif
if(NULL == dstptr) {
// no such pointer in this core, something is wrong
BAMBOO_DEBUGPRINT_REG(data2);
#endif
BAMBOO_EXIT(0xe01c);
- //assume that the object was not moved, use the original address
- /*if(isMsgSending) {
- cache_msg_3(msgdata[2], GCMAPINFO, msgdata[1], msgdata[1]);
- } else {
- send_msg_3(msgdata[2], GCMAPINFO, msgdata[1], msgdata[1]);
- }*/
} else {
// send back the mapping info, cache the msg first
if(BAMBOO_CHECK_SEND_MODE()) {
send_msg_3(data2, GCMAPINFO, data1, (int)dstptr, true);
}
}
-#ifdef GC_PROFILE
- // TODO flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimei;
- //num_mapinforequest_i++;
-#endif
}
INLINE void processmsg_gcmapinfo_I() {
-#ifdef GC_PROFILE
- //unsigned long long ttime = BAMBOO_GET_EXE_TIME();
-#endif
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
gcmappedobj = msgdata[msgdataindex]; // [2]
#else
mgchashInsert_I(gcpointertbl, data1, gcmappedobj);
#endif
- //MGCHashadd_I(gcpointertbl, data1, gcmappedobj);
if(data1 == gcobj2map) {
gcismapped = true;
}
-#ifdef GC_PROFILE
- //flushstalltime += BAMBOO_GET_EXE_TIME() - ttime;
-#endif
}
INLINE void processmsg_gcmaptbl_I() {
MSG_INDEXINC_I();
int data2 = msgdata[msgdataindex];
MSG_INDEXINC_I();
- gcrpointertbls[data2] = (mgcsharedhashtbl_t *)data1; //(struct GCSharedHash *)data1;
+ gcrpointertbls[data2] = (mgcsharedhashtbl_t *)data1;
}
INLINE void processmsg_gclobjinfo_I() {
#else
mgchashInsert_I(gcpointertbl, data1, data2);
#endif
- //MGCHashadd_I(gcpointertbl, data1, data2);
mgcsharedhashInsert_I(gcsharedptbl, data1, data2);
}
type = msgdata[msgdataindex]; //[0]
MSG_INDEXINC_I();
msgdatafull = false;
- // TODO
- //tprintf("msg type: %x\n", type);
switch(type) {
case TRANSOBJ: {
// receive a object transfer msg
break;
} // switch(type)
msglength = BAMBOO_MSG_BUF_LENGTH;
- // TODO
- //printf("++ msg: %x \n", type);
if((msgdataindex != msgdatalast) || (msgdatafull)) {
// still have available msg
int numenterflags) {
void * taskpointerarray[MAXTASKPARAMS];
int j;
- //int numparams=parameter->task->numParameters;
int numiterators=parameter->task->numTotal-1;
int retval=1;
tpd->parameterArray[j]=taskpointerarray[j];
}
/* Enqueue task */
- if (( /*!gencontains(failedtasks, tpd)&&*/
- !gencontains(activetasks,tpd))) {
+ if (!gencontains(activetasks,tpd)) {
genputtable(activetasks, tpd, tpd);
} else {
RUNFREE(tpd->parameterArray);
int numenterflags) {
void * taskpointerarray[MAXTASKPARAMS];
int j;
- //int numparams=parameter->task->numParameters;
int numiterators=parameter->task->numTotal-1;
int retval=1;
- //int addnormal=1;
- //int adderror=1;
struct taskdescriptor * task=parameter->task;
tpd->parameterArray[j]=taskpointerarray[j];
}
/* Enqueue task */
- if (( /*!gencontains(failedtasks, tpd)&&*/
- !gencontains(activetasks,tpd))) {
+ if (!gencontains(activetasks,tpd)) {
genputtable_I(activetasks, tpd, tpd);
} else {
RUNFREE(tpd->parameterArray);
#endif
/* See if there are any active tasks */
- //if (hashsize(activetasks)>0) {
int i;
#ifdef PROFILE
#ifdef ACCURATEPROFILE
profileTaskStart("tpd checking");
#endif
#endif
- //long clock1;
- //clock1 = BAMBOO_GET_EXE_TIME();
busystatus = true;
currtpd=(struct taskparamdescriptor *) getfirstkey(activetasks);
numparams=currtpd->task->numParameters;
numtotal=currtpd->task->numTotal;
- // clear the lockRedirectTbl
// (TODO, this table should be empty after all locks are released)
// reset all locks
- /*for(j = 0; j < MAXTASKPARAMS; j++) {
- runtime_locks[j].redirectlock = 0;
- runtime_locks[j].value = 0;
- }*/
// get all required locks
runtime_locklen = 0;
// check which locks are needed
runtime_locklen++;
}
} // line 2713: for(i = 0; i < numparams; i++)
- // grab these required locks
+ // grab these required locks
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe991);
#endif
- //long clock2;
- //clock2 = BAMBOO_GET_EXE_TIME();
for(i = 0; i < runtime_locklen; i++) {
int * lock = (int *)(runtime_locks[i].redirectlock);
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xf001);
-#endif
-#ifdef PROFILE
- //isInterrupt = false;
#endif
while(!lockflag) {
BAMBOO_WAITING_FOR_LOCK(0);
lockflag = false;
#ifndef INTERRUPT
reside = false;
-#endif
-#ifdef PROFILE
- //isInterrupt = true;
#endif
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
#ifdef DEBUG
#endif
#endif
goto newtask;
- //}
}
} // line 2752: for(i = 0; i < runtime_locklen; i++)
- /*long clock3;
- clock3 = BAMBOO_GET_EXE_TIME();
- //tprintf("sort: %d, grab: %d \n", clock2-clock1, clock3-clock2);*/
-
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe993);
#endif
goto newtask;
}
} // line2865
- /* Check if the object's flags still meets requirements */
+ /* Check if the object's flags still meets requirements */
{
int tmpi = 0;
bool ismet = false;
taskpointerarray[i+OFFSET]=parameter;
} // line 2824: for(i=0; i<numparams; i++)
- /* Copy the tags */
+ /* Copy the tags */
for(; i<numtotal; i++) {
taskpointerarray[i+OFFSET]=currtpd->parameterArray[i];
}
#endif
profileTaskStart(currtpd->task->name);
#endif
- // TODO
- //long clock4;
- //clock4 = BAMBOO_GET_EXE_TIME();
- //tprintf("sort: %d, grab: %d, check: %d \n", (int)(clock2-clock1), (int)(clock3-clock2), (int)(clock4-clock3));
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe997);
#endif
((void (*)(void **))currtpd->task->taskptr)(taskpointerarray);
- // TODO
- //long clock5;
- //clock5 = BAMBOO_GET_EXE_TIME();
- // tprintf("sort: %d, grab: %d, check: %d \n", (int)(clock2-clock1), (int)(clock3-clock2), (int)(clock4-clock3));
#ifdef PROFILE
#ifdef ACCURATEPROFILE
}
} // line 3015: if(islock)
- //long clock6;
- //clock6 = BAMBOO_GET_EXE_TIME();
- //tprintf("sort: %d, grab: %d, check: %d \n", (int)(clock2-clock1), (int)(clock3-clock2), (int)(clock4-clock3));
-
#ifdef PROFILE
// post task execution finish, set the end of the postTaskInfo
profileTaskEnd();
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xe99a);
#endif
- //long clock7;
- //clock7 = BAMBOO_GET_EXE_TIME();
- //tprintf("sort: %d, grab: %d, check: %d, release: %d, other %d \n", (int)(clock2-clock1), (int)(clock3-clock2), (int)(clock4-clock3), (int)(clock6-clock5), (int)(clock7-clock6));
-
} //
//} // if (hashsize(activetasks)>0)
} // while(hashsize(activetasks)>0)
for(i=0; i<pd->numbertags; i++) {
int slotid=pd->tagarray[2*i];
- //int tagid=pd->tagarray[2*i+1];
if (statusarray[slotid+numparams]!=0) {
/* This tag has already been enqueued, use it to narrow search */
parameter->iterators[*iteratorcount].tagbindings[tagcount]=
taskInfoIndex++;
if(taskInfoIndex == TASKINFOLENGTH) {
taskInfoOverflow = true;
- //taskInfoIndex = 0;
}
}
}
unsigned long long preprocessingtime = 0;
unsigned long long objqueuecheckingtime = 0;
unsigned long long postprocessingtime = 0;
- //int interruptiontime = 0;
unsigned long long other = 0;
unsigned long long averagetasktime = 0;
int tasknum = 0;
printf("\nAverage task execution time: %lld\n", averagetasktime);
- //printf("\nTotal time spent for interruptions: %lld\n", interrupttime);
#else
int i = 0;
int j = 0;