#include <CkCache.h>
Public Member Functions | |
CkCacheManager (int size, CkGroupID gid) | |
CkCacheManager (int size, int n, CkGroupID *gid) | |
CkCacheManager (int size, int n, CkGroupID *gid, int nWB, CkGroupID *gidWB) | |
CkCacheManager (CkMigrateMessage *m) | |
~CkCacheManager () | |
void | pup (PUP::er &p) |
void * | requestData (CkCacheKey what, CkArrayIndex &toWhom, int chunk, CkCacheEntryType< CkCacheKey > *type, CkCacheRequestorData< CkCacheKey > &req) |
void * | requestDataNoFetch (CkCacheKey key, int chunk) |
CkCacheEntry< CkCacheKey > * | requestCacheEntryNoFetch (CkCacheKey key, int chunk) |
void | recvData (CkCacheKey key, void *data, CkCacheFillMsg< CkCacheKey > *msg=NULL) |
void | recvData (CkCacheFillMsg< CkCacheKey > *msg) |
void | recvData (CkCacheKey key, CkArrayIndex &from, CkCacheEntryType< CkCacheKey > *type, int chunk, void *data) |
void | cacheSync (int &numChunks, CkArrayIndex &chareIdx, int &localIdx) |
void | writebackChunk (int num) |
Called from the TreePieces to acknowledge that a particular chunk can be written back to the original senders. | |
void | finishedChunk (int num, CmiUInt8 weight) |
Called from the TreePieces to acknowledge that a particular chunk has been completely used, and can be deleted. | |
void | collectStatistics (CkCallback cb) |
Called from the TreePieces to acknowledge that they have completely finished their computation. | |
std::map< CkCacheKey, CkCacheEntry< CkCacheKey > * > * | getCache () |
Private Member Functions | |
void | init () |
Private Attributes | |
int | numChunks |
Number of chunks in which the cache is splitted. | |
int | finishedChunks |
Number of chunks that have already been completely acknowledged. | |
CkCacheArrayCounter | localChares |
A list of all the elements that are present in the local processor for the current iteration. | |
CkCacheArrayCounter | localCharesWB |
A list of all the elements that are present in the local processor for the current iteration with respect to writeback. | |
int | syncdChares |
number of chares that have checked in for the next iteration | |
int | numLocMgr |
The number of arrays this Manager serves without support for writeback. | |
CkGroupID * | locMgr |
The group ids of the location managers of the arrays this Manager serves with support for writeback. | |
int | numLocMgrWB |
The number of arrays this Manager serves with support for writeback. | |
CkGroupID * | locMgrWB |
The group ids of the location managers of the arrays this Manager serves with support for writeback. | |
CmiUInt8 | dataArrived |
particles arrived from remote processors, this counts only the entries in the cache | |
CmiUInt8 | dataTotalArrived |
particles arrived from remote processors, this counts the real number of particles arrived | |
CmiUInt8 | dataMisses |
particles missed while walking the tree for computation | |
CmiUInt8 | dataLocal |
particles that have been imported from local TreePieces | |
CmiUInt8 | dataError |
particles arrived which were never requested, basically errors | |
CmiUInt8 | totalDataRequested |
counts the total number of particles requested by all the chares on the processor | |
CmiUInt8 | maxData |
maximum number of nodes stored at some point in the cache | |
CmiUInt8 * | chunkWeight |
weights of the chunks in which the tree is divided, the cache will update the chunk division based on these values | |
CmiUInt8 | maxSize |
Maximum number of allowed data stored. | |
int * | chunkAck |
number of acknowledgements awaited before deleting the chunk | |
int * | chunkAckWB |
number of acknowledgements awaited before writing back the chunk | |
std::map< CkCacheKey, CkCacheEntry< CkCacheKey > * > * | cacheTable |
hash table containing all the entries currently in the cache | |
int | storedData |
std::map< CkCacheKey, int > | outStandingRequests |
list of all the outstanding requests. |
Definition at line 201 of file CkCache.h.
CkCacheManager< CkCacheKey >::CkCacheManager | ( | int | size, | |
CkGroupID | gid | |||
) | [inline] |
Definition at line 315 of file CkCache.h.
References CkCacheManager< CkCacheKey >::init(), CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::maxSize, CkCacheManager< CkCacheKey >::numLocMgr, and CkCacheManager< CkCacheKey >::numLocMgrWB.
CkCacheManager< CkCacheKey >::CkCacheManager | ( | int | size, | |
int | n, | |||
CkGroupID * | gid | |||
) | [inline] |
Definition at line 325 of file CkCache.h.
References CkCacheManager< CkCacheKey >::init(), CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::maxSize, CkCacheManager< CkCacheKey >::numLocMgr, and CkCacheManager< CkCacheKey >::numLocMgrWB.
CkCacheManager< CkCacheKey >::CkCacheManager | ( | int | size, | |
int | n, | |||
CkGroupID * | gid, | |||
int | nWB, | |||
CkGroupID * | gidWB | |||
) | [inline] |
Definition at line 335 of file CkCache.h.
References CkCacheManager< CkCacheKey >::init(), CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::locMgrWB, CkCacheManager< CkCacheKey >::maxSize, CkCacheManager< CkCacheKey >::numLocMgr, and CkCacheManager< CkCacheKey >::numLocMgrWB.
CkCacheManager< CkCacheKey >::CkCacheManager | ( | CkMigrateMessage * | m | ) | [inline] |
Definition at line 280 of file CkCache.h.
References CkCacheManager< CkCacheKey >::init().
CkCacheManager< CkCacheKey >::~CkCacheManager | ( | ) | [inline] |
void CkCacheManager< CkCacheKey >::pup | ( | PUP::er & | p | ) | [inline] |
Definition at line 367 of file CkCache.h.
References PUP::er::isUnpacking(), CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::locMgrWB, CkCacheManager< CkCacheKey >::maxSize, CkCacheManager< CkCacheKey >::numLocMgr, CkCacheManager< CkCacheKey >::numLocMgrWB, and PUP::PUParray().
void CkCacheManager< CkCacheKey >::init | ( | void | ) | [inline, private] |
Definition at line 347 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, CkCacheManager< CkCacheKey >::chunkAck, CkCacheManager< CkCacheKey >::chunkWeight, CkCacheManager< CkCacheKey >::dataArrived, CkCacheManager< CkCacheKey >::dataLocal, CkCacheManager< CkCacheKey >::dataMisses, CkCacheManager< CkCacheKey >::dataTotalArrived, CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::maxSize, CkCacheManager< CkCacheKey >::numChunks, CkCacheManager< CkCacheKey >::numLocMgr, CkCacheManager< CkCacheKey >::storedData, CkCacheManager< CkCacheKey >::syncdChares, and CkCacheManager< CkCacheKey >::totalDataRequested.
Referenced by CkCacheManager< CkCacheKey >::CkCacheManager().
void * CkCacheManager< CkCacheKey >::requestData | ( | CkCacheKey | what, | |
CkArrayIndex & | toWhom, | |||
int | chunk, | |||
CkCacheEntryType< CkCacheKey > * | type, | |||
CkCacheRequestorData< CkCacheKey > & | req | |||
) | [inline] |
Definition at line 378 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, CkCacheManager< CkCacheKey >::chunkAck, CkCacheEntry< CkCacheKey >::data, CkCacheEntry< CkCacheKey >::home, CkCacheEntry< CkCacheKey >::misses, CkCacheManager< CkCacheKey >::outStandingRequests, p, CkCacheEntry< CkCacheKey >::replyRecvd, CkCacheEntryType< CkCacheKey >::request(), CkCacheEntry< CkCacheKey >::requestorVec, CkCacheEntry< CkCacheKey >::requestSent, CkCacheManager< CkCacheKey >::totalDataRequested, and CkCacheEntry< CkCacheKey >::totalRequests.
void * CkCacheManager< CkCacheKey >::requestDataNoFetch | ( | CkCacheKey | key, | |
int | chunk | |||
) | [inline] |
Definition at line 428 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, and p.
CkCacheEntry< CkCacheKey > * CkCacheManager< CkCacheKey >::requestCacheEntryNoFetch | ( | CkCacheKey | key, | |
int | chunk | |||
) | [inline] |
Definition at line 437 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, and p.
void CkCacheManager< CkCacheKey >::recvData | ( | CkCacheKey | key, | |
void * | data, | |||
CkCacheFillMsg< CkCacheKey > * | msg = NULL | |||
) | [inline] |
Definition at line 451 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, caller, CkCacheManager< CkCacheKey >::chunkAck, CkCacheEntry< CkCacheKey >::data, CkCacheEntry< CkCacheKey >::home, CkCacheManager< CkCacheKey >::numChunks, CkCacheManager< CkCacheKey >::outStandingRequests, p, CkCacheEntry< CkCacheKey >::requestorVec, CkCacheManager< CkCacheKey >::storedData, and CkCacheEntry< CkCacheKey >::type.
Referenced by CkCacheManager< CkCacheKey >::recvData().
void CkCacheManager< CkCacheKey >::recvData | ( | CkCacheFillMsg< CkCacheKey > * | msg | ) | [inline] |
Definition at line 481 of file CkCache.h.
References CkCacheFillMsg< CkCacheKey >::key, key, and CkCacheManager< CkCacheKey >::recvData().
void CkCacheManager< CkCacheKey >::recvData | ( | CkCacheKey | key, | |
CkArrayIndex & | from, | |||
CkCacheEntryType< CkCacheKey > * | type, | |||
int | chunk, | |||
void * | data | |||
) | [inline] |
Definition at line 487 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, caller, CkCacheEntry< CkCacheKey >::data, CkCacheEntry< CkCacheKey >::home, CkCacheEntry< CkCacheKey >::key, p, CkCacheEntry< CkCacheKey >::replyRecvd, CkCacheEntry< CkCacheKey >::requestorVec, CkCacheManager< CkCacheKey >::storedData, and CkCacheEntry< CkCacheKey >::type.
void CkCacheManager< CkCacheKey >::cacheSync | ( | int & | numChunks, | |
CkArrayIndex & | chareIdx, | |||
int & | localIdx | |||
) | [inline] |
Definition at line 510 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, CkCacheManager< CkCacheKey >::chunkAck, CkCacheManager< CkCacheKey >::chunkAckWB, CkCacheManager< CkCacheKey >::chunkWeight, CkLocalBranch(), CmiResetMaxMemory(), CkCacheArrayCounter::count, CkCacheManager< CkCacheKey >::dataArrived, CkCacheManager< CkCacheKey >::dataLocal, CkCacheManager< CkCacheKey >::dataMisses, CkCacheManager< CkCacheKey >::dataTotalArrived, CkCacheManager< CkCacheKey >::finishedChunks, CkHashtableT< KEY, OBJ >::get(), CkLocMgr::iterate(), CkCacheManager< CkCacheKey >::localChares, CkCacheManager< CkCacheKey >::localCharesWB, CkCacheManager< CkCacheKey >::locMgr, CkCacheManager< CkCacheKey >::locMgrWB, CkCacheManager< CkCacheKey >::maxData, CkCacheManager< CkCacheKey >::numChunks, CkCacheManager< CkCacheKey >::numLocMgr, CkCacheManager< CkCacheKey >::numLocMgrWB, CkCacheManager< CkCacheKey >::outStandingRequests, CkCacheArrayCounter::registered, CkCacheArrayCounter::reset(), CkCacheManager< CkCacheKey >::storedData, CkCacheManager< CkCacheKey >::syncdChares, and CkCacheManager< CkCacheKey >::totalDataRequested.
void CkCacheManager< CkCacheKey >::writebackChunk | ( | int | num | ) | [inline] |
Called from the TreePieces to acknowledge that a particular chunk can be written back to the original senders.
Definition at line 579 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, CkCacheManager< CkCacheKey >::chunkAckWB, and CkCacheEntry< CkCacheKey >::writeback().
void CkCacheManager< CkCacheKey >::finishedChunk | ( | int | num, | |
CmiUInt8 | weight | |||
) | [inline] |
Called from the TreePieces to acknowledge that a particular chunk has been completely used, and can be deleted.
Definition at line 596 of file CkCache.h.
References CkCacheManager< CkCacheKey >::cacheTable, CkCacheManager< CkCacheKey >::chunkAck, CkCacheManager< CkCacheKey >::chunkWeight, CkCacheEntry< CkCacheKey >::data, CkCacheManager< CkCacheKey >::finishedChunks, CkCacheManager< CkCacheKey >::maxData, CkCacheManager< CkCacheKey >::numChunks, CkCacheManager< CkCacheKey >::storedData, CkCacheManager< CkCacheKey >::syncdChares, and CkCacheEntry< CkCacheKey >::type.
void CkCacheManager< CkCacheKey >::collectStatistics | ( | CkCallback | cb | ) | [inline] |
Called from the TreePieces to acknowledge that they have completely finished their computation.
Collect the statistics for the latest iteration
Definition at line 629 of file CkCache.h.
References Converse::CkMyPe(), CkCacheManager< CkCacheKey >::dataArrived, CkCacheManager< CkCacheKey >::dataError, CkCacheManager< CkCacheKey >::dataLocal, CkCacheManager< CkCacheKey >::dataMisses, CkCacheManager< CkCacheKey >::dataTotalArrived, CkCacheManager< CkCacheKey >::maxData, CkCacheStatistics::sum, and CkCacheManager< CkCacheKey >::totalDataRequested.
std::map< CkCacheKey, CkCacheEntry< CkCacheKey > * > * CkCacheManager< CkCacheKey >::getCache | ( | ) | [inline] |
int CkCacheManager< CkCacheKey >::numChunks [private] |
Number of chunks in which the cache is splitted.
Definition at line 208 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::recvData().
int CkCacheManager< CkCacheKey >::finishedChunks [private] |
Number of chunks that have already been completely acknowledged.
Definition at line 210 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), and CkCacheManager< CkCacheKey >::finishedChunk().
CkCacheArrayCounter CkCacheManager< CkCacheKey >::localChares [private] |
A list of all the elements that are present in the local processor for the current iteration.
Definition at line 214 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync().
CkCacheArrayCounter CkCacheManager< CkCacheKey >::localCharesWB [private] |
A list of all the elements that are present in the local processor for the current iteration with respect to writeback.
Definition at line 217 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync().
int CkCacheManager< CkCacheKey >::syncdChares [private] |
number of chares that have checked in for the next iteration
Definition at line 219 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), and CkCacheManager< CkCacheKey >::init().
int CkCacheManager< CkCacheKey >::numLocMgr [private] |
The number of arrays this Manager serves without support for writeback.
Definition at line 222 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::CkCacheManager(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::pup().
CkGroupID* CkCacheManager< CkCacheKey >::locMgr [private] |
The group ids of the location managers of the arrays this Manager serves with support for writeback.
Definition at line 225 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::CkCacheManager(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::pup().
int CkCacheManager< CkCacheKey >::numLocMgrWB [private] |
The number of arrays this Manager serves with support for writeback.
Definition at line 227 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::CkCacheManager(), and CkCacheManager< CkCacheKey >::pup().
CkGroupID* CkCacheManager< CkCacheKey >::locMgrWB [private] |
The group ids of the location managers of the arrays this Manager serves with support for writeback.
Definition at line 230 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::CkCacheManager(), and CkCacheManager< CkCacheKey >::pup().
CmiUInt8 CkCacheManager< CkCacheKey >::dataArrived [private] |
particles arrived from remote processors, this counts only the entries in the cache
Definition at line 234 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), and CkCacheManager< CkCacheKey >::init().
CmiUInt8 CkCacheManager< CkCacheKey >::dataTotalArrived [private] |
particles arrived from remote processors, this counts the real number of particles arrived
Definition at line 237 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), and CkCacheManager< CkCacheKey >::init().
CmiUInt8 CkCacheManager< CkCacheKey >::dataMisses [private] |
particles missed while walking the tree for computation
Definition at line 239 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), and CkCacheManager< CkCacheKey >::init().
CmiUInt8 CkCacheManager< CkCacheKey >::dataLocal [private] |
particles that have been imported from local TreePieces
Definition at line 241 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), and CkCacheManager< CkCacheKey >::init().
CmiUInt8 CkCacheManager< CkCacheKey >::dataError [private] |
particles arrived which were never requested, basically errors
Definition at line 243 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::collectStatistics().
CmiUInt8 CkCacheManager< CkCacheKey >::totalDataRequested [private] |
counts the total number of particles requested by all the chares on the processor
Definition at line 246 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::requestData().
CmiUInt8 CkCacheManager< CkCacheKey >::maxData [private] |
maximum number of nodes stored at some point in the cache
Definition at line 248 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::collectStatistics(), and CkCacheManager< CkCacheKey >::finishedChunk().
CmiUInt8* CkCacheManager< CkCacheKey >::chunkWeight [private] |
weights of the chunks in which the tree is divided, the cache will update the chunk division based on these values
Definition at line 253 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), and CkCacheManager< CkCacheKey >::init().
CmiUInt8 CkCacheManager< CkCacheKey >::maxSize [private] |
Maximum number of allowed data stored.
Definition at line 256 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::CkCacheManager(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::pup().
int* CkCacheManager< CkCacheKey >::chunkAck [private] |
number of acknowledgements awaited before deleting the chunk
Definition at line 259 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), CkCacheManager< CkCacheKey >::init(), CkCacheManager< CkCacheKey >::recvData(), and CkCacheManager< CkCacheKey >::requestData().
int* CkCacheManager< CkCacheKey >::chunkAckWB [private] |
number of acknowledgements awaited before writing back the chunk
Definition at line 261 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), and CkCacheManager< CkCacheKey >::writebackChunk().
std::map<CkCacheKey,CkCacheEntry<CkCacheKey>*>* CkCacheManager< CkCacheKey >::cacheTable [private] |
hash table containing all the entries currently in the cache
Definition at line 264 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), CkCacheManager< CkCacheKey >::getCache(), CkCacheManager< CkCacheKey >::init(), CkCacheManager< CkCacheKey >::recvData(), CkCacheManager< CkCacheKey >::requestCacheEntryNoFetch(), CkCacheManager< CkCacheKey >::requestData(), CkCacheManager< CkCacheKey >::requestDataNoFetch(), and CkCacheManager< CkCacheKey >::writebackChunk().
int CkCacheManager< CkCacheKey >::storedData [private] |
Definition at line 265 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::finishedChunk(), CkCacheManager< CkCacheKey >::init(), and CkCacheManager< CkCacheKey >::recvData().
std::map<CkCacheKey,int> CkCacheManager< CkCacheKey >::outStandingRequests [private] |
list of all the outstanding requests.
The second field is the chunk for which this request is outstanding
Definition at line 269 of file CkCache.h.
Referenced by CkCacheManager< CkCacheKey >::cacheSync(), CkCacheManager< CkCacheKey >::recvData(), and CkCacheManager< CkCacheKey >::requestData().