#include <msa-distArray.h>
Public Types | |
typedef MSA_CacheGroup< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE > | CacheGroup_t |
typedef CProxy_MSA_CacheGroup < ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE > | CProxy_CacheGroup_t |
typedef CProxy_MSA_PageArray < ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE > | CProxy_PageArray_t |
typedef ENTRY | T |
typedef ENTRY_OPS_CLASS | OPS |
typedef MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE > | thisMSA |
typedef MSAHandle< thisMSA > | Handle |
typedef MSARead< thisMSA > | Read |
typedef MSAAccum< thisMSA > | Accum |
typedef MSAWrite< thisMSA > | Write |
Public Member Functions | |
MSA1D () | |
virtual void | pup (PUP::er &p) |
MSA1D (unsigned int nEntries_, unsigned int num_wrkrs, unsigned int maxBytes=MSA_DEFAULT_MAX_BYTES) | |
Create a completely new MSA array. | |
MSA1D (CProxy_CacheGroup_t cg_) | |
~MSA1D () | |
void | changePE () |
this function is supposed to be called when the thread/object using this array migrates to another PE. | |
unsigned int | length () const |
Get the total length of the array, across all processors. | |
const CProxy_CacheGroup_t & | getCacheGroup () const |
unsigned int | getNumEntriesPerPage () const |
unsigned int | getPageIndex (unsigned int idx) |
Return the page this entry is stored at. | |
unsigned int | getOffsetWithinPage (unsigned int idx) |
Return the offset, in entries, that this entry is stored at within a page. | |
void | enroll (int num_workers) |
ENTRY & | getPageBottom (unsigned int idx, MSA_Page_Fault_t accessMode) |
void | FreeMem () |
void | Prefetch (unsigned int start, unsigned int end) |
Non-blocking prefetch of entries from start to end, inclusive. | |
int | WaitAll () |
Block until all prefetched pages arrive. | |
void | Unlock () |
Unlock all locked pages. | |
void | Unlock (unsigned int start, unsigned int end) |
start and end are element indexes. | |
Write | getInitialWrite () |
Accum | getInitialAccum () |
Protected Member Functions | |
const ENTRY * | readablePage (unsigned int page) |
const ENTRY * | readablePage2 (unsigned int page) |
ENTRY * | writeablePage (unsigned int page, unsigned int offset) |
const ENTRY & | get (unsigned int idx) |
Return a read-only copy of the element at idx. | |
const ENTRY & | operator[] (unsigned int idx) |
const ENTRY & | get2 (unsigned int idx) |
Return a read-only copy of the element at idx; ONLY WORKS WHEN ELEMENT IS ALREADY IN THE CACHE-- WILL SEGFAULT IF ELEMENT NOT ALREADY PRESENT. | |
ENTRY & | set (unsigned int idx) |
Return a writeable copy of the element at idx. | |
ENTRY & | accumulate (unsigned int idx) |
Fetch the ENTRY at idx to be accumulated. | |
void | accumulate (unsigned int idx, const ENTRY &ent) |
Add ent to the element at idx. | |
void | sync (int single=0, bool clear=false) |
Synchronize reads and writes across the entire array. | |
Protected Attributes | |
unsigned int | nEntries |
Total number of ENTRY's in the whole array. | |
bool | initHandleGiven |
CacheGroup_t * | cache |
Handle to owner of cache. | |
CProxy_CacheGroup_t | cg |
Friends | |
class | MSAHandle< thisMSA > |
class | MSARead< thisMSA > |
class | MSAWrite< thisMSA > |
class | MSAAccum< thisMSA > |
There are nEntries total numer of ENTRY's, with ENTRIES_PER_PAGE data items per "page". It is implemented as a Chare Array of pages, and a Group representing the local cache.
The requirements for the templates are: ENTRY: User data class stored in the array, with at least:
Definition at line 394 of file msa-distArray.h.
typedef MSA_CacheGroup<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::CacheGroup_t |
Definition at line 397 of file msa-distArray.h.
typedef CProxy_MSA_CacheGroup<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::CProxy_CacheGroup_t |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 398 of file msa-distArray.h.
typedef CProxy_MSA_PageArray<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::CProxy_PageArray_t |
Definition at line 399 of file msa-distArray.h.
typedef ENTRY MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::T |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 401 of file msa-distArray.h.
typedef ENTRY_OPS_CLASS MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::OPS |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 402 of file msa-distArray.h.
typedef MSA1D<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::thisMSA |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 403 of file msa-distArray.h.
typedef MSAHandle<thisMSA> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Handle |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 404 of file msa-distArray.h.
typedef MSARead<thisMSA> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Read |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 405 of file msa-distArray.h.
typedef MSAAccum<thisMSA> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Accum |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 406 of file msa-distArray.h.
typedef MSAWrite<thisMSA> MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Write |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 407 of file msa-distArray.h.
MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::MSA1D | ( | ) | [inline] |
Definition at line 442 of file msa-distArray.h.
MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::MSA1D | ( | unsigned int | nEntries_, | |
unsigned int | num_wrkrs, | |||
unsigned int | maxBytes = MSA_DEFAULT_MAX_BYTES | |||
) | [inline] |
Create a completely new MSA array.
This call creates the corresponding groups, so only call it once per array.
Definition at line 456 of file msa-distArray.h.
MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::MSA1D | ( | CProxy_CacheGroup_t | cg_ | ) | [inline] |
Definition at line 470 of file msa-distArray.h.
MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::~MSA1D | ( | ) | [inline] |
Definition at line 476 of file msa-distArray.h.
const ENTRY* MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::readablePage | ( | unsigned int | page | ) | [inline, protected] |
Definition at line 422 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::get(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::getPageBottom().
const ENTRY* MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::readablePage2 | ( | unsigned int | page | ) | [inline, protected] |
Definition at line 428 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::get2().
ENTRY* MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::writeablePage | ( | unsigned int | page, | |
unsigned int | offset | |||
) | [inline, protected] |
Definition at line 435 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::getPageBottom(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::set().
virtual void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::pup | ( | PUP::er & | p | ) | [inline, virtual] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 446 of file msa-distArray.h.
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::changePE | ( | ) | [inline] |
this function is supposed to be called when the thread/object using this array migrates to another PE.
Definition at line 490 of file msa-distArray.h.
unsigned int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::length | ( | void | ) | const [inline] |
Get the total length of the array, across all processors.
Definition at line 499 of file msa-distArray.h.
const CProxy_CacheGroup_t& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getCacheGroup | ( | ) | const [inline] |
Definition at line 501 of file msa-distArray.h.
unsigned int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getNumEntriesPerPage | ( | ) | const [inline] |
Definition at line 505 of file msa-distArray.h.
unsigned int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getPageIndex | ( | unsigned int | idx | ) | [inline] |
unsigned int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getOffsetWithinPage | ( | unsigned int | idx | ) | [inline] |
Return the offset, in entries, that this entry is stored at within a page.
Definition at line 514 of file msa-distArray.h.
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::enroll | ( | int | num_workers | ) | [inline] |
Definition at line 527 of file msa-distArray.h.
Referenced by CreateAdaptAdjacencies().
ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getPageBottom | ( | unsigned int | idx, | |
MSA_Page_Fault_t | accessMode | |||
) | [inline] |
Definition at line 540 of file msa-distArray.h.
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::FreeMem | ( | ) | [inline] |
Definition at line 554 of file msa-distArray.h.
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Prefetch | ( | unsigned int | start, | |
unsigned int | end | |||
) | [inline] |
Non-blocking prefetch of entries from start to end, inclusive.
Prefetch'd pages are locked into the cache, so you must call unlock afterwards.
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 562 of file msa-distArray.h.
int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::WaitAll | ( | ) | [inline] |
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Unlock | ( | ) | [inline] |
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::Unlock | ( | unsigned int | start, | |
unsigned int | end | |||
) | [inline] |
start and end are element indexes.
Unlocks completely spanned pages given a range of elements index'd from "start" to "end", inclusive. If start/end does not span a page completely, i.e. start/end is in the middle of a page, the entire page is still unlocked--in particular, this means you should not have several adjacent ranges locked.
Definition at line 581 of file msa-distArray.h.
Write MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getInitialWrite | ( | ) | [inline] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 588 of file msa-distArray.h.
Accum MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::getInitialAccum | ( | ) | [inline] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 597 of file msa-distArray.h.
Referenced by CreateAdaptAdjacencies().
const ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::get | ( | unsigned int | idx | ) | [inline, protected] |
Return a read-only copy of the element at idx.
May block if the element is not already in the cache.
Definition at line 611 of file msa-distArray.h.
const ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::operator[] | ( | unsigned int | idx | ) | [inline, protected] |
Definition at line 618 of file msa-distArray.h.
const ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::get2 | ( | unsigned int | idx | ) | [inline, protected] |
Return a read-only copy of the element at idx; ONLY WORKS WHEN ELEMENT IS ALREADY IN THE CACHE-- WILL SEGFAULT IF ELEMENT NOT ALREADY PRESENT.
Never blocks; may crash if element not already present.
Definition at line 627 of file msa-distArray.h.
Referenced by MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >::get2().
ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::set | ( | unsigned int | idx | ) | [inline, protected] |
Return a writeable copy of the element at idx.
Never blocks; will create a new blank element if none exists locally. UNDEFINED if two threads set the same element.
Definition at line 637 of file msa-distArray.h.
Referenced by MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >::set().
ENTRY& MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::accumulate | ( | unsigned int | idx | ) | [inline, protected] |
Fetch the ENTRY at idx to be accumulated.
You must perform the accumulation on the return value before calling "sync". Never blocks.
Definition at line 649 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::accumulate().
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::accumulate | ( | unsigned int | idx, | |
const ENTRY & | ent | |||
) | [inline, protected] |
Add ent to the element at idx.
Never blocks. Merges together accumulates from different threads.
Definition at line 659 of file msa-distArray.h.
void MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::sync | ( | int | single = 0 , |
|
bool | clear = false | |||
) | [inline, protected] |
Synchronize reads and writes across the entire array.
Definition at line 665 of file msa-distArray.h.
friend class MSAHandle< thisMSA > [friend] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 408 of file msa-distArray.h.
friend class MSARead< thisMSA > [friend] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 409 of file msa-distArray.h.
friend class MSAWrite< thisMSA > [friend] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 410 of file msa-distArray.h.
friend class MSAAccum< thisMSA > [friend] |
Reimplemented in MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >.
Definition at line 411 of file msa-distArray.h.
unsigned int MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::nEntries [protected] |
Total number of ENTRY's in the whole array.
Definition at line 415 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::length(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::MSA1D(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::pup().
bool MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::initHandleGiven [protected] |
Definition at line 416 of file msa-distArray.h.
Referenced by MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >::getInitialAccum(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::getInitialAccum(), MSA::MSA2D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE, ARRAY_LAYOUT >::getInitialWrite(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::getInitialWrite().
CacheGroup_t* MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::cache [protected] |
Handle to owner of cache.
Definition at line 419 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::accumulate(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::changePE(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::enroll(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::FreeMem(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::MSA1D(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::Prefetch(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::pup(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::readablePage(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::readablePage2(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::sync(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::Unlock(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::WaitAll(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::writeablePage(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::~MSA1D().
CProxy_CacheGroup_t MSA::MSA1D< ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE >::cg [protected] |
Definition at line 420 of file msa-distArray.h.
Referenced by MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::changePE(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::getCacheGroup(), MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::MSA1D(), and MSA::MSA1D< ElemList< T >, DefaultListEntry< ElemList< T >, true >, MSA_DEFAULT_ENTRIES_PER_PAGE >::pup().