PPL Logo

CkArray Class Reference
[CkArrayImpl]

#include <ckarray.h>

Inheritance diagram for CkArray:

Inheritance graph
[legend]
Collaboration diagram for CkArray:

Collaboration graph
[legend]

Public Member Functions

 CkArray (CkArrayOptions &&c, CkMarshalledMessage &&initMsg)
 CkArray (CkMigrateMessage *m)
 ~CkArray ()
CkGroupIDgetGroupID (void)
CkGroupIDgetmCastMgr (void)
bool isSectionAutoDelegated (void)
UShortgetRecvBroadcastEpIdx (void)
CkLocMgrgetLocMgr (void)
const CkArrayIndex & getNumInitial (void) const
int homePe (const CkArrayIndex &idx) const
int procNum (const CkArrayIndex &idx) const
int lastKnown (const CkArrayIndex &idx) const
 Return the last known processor for this array index.
void deliver (CkMessage *m, const CkArrayIndex &idx, CkDeliver_t type, int opts=0)
 Deliver message to this element (directly if local) doFree if is local.
int deliver (CkArrayMessage *m, CkDeliver_t type)
ArrayElementlookup (const CmiUInt8 id)
 Fetch a local element via its ID (return NULL if not local).
ArrayElementlookup (const CkArrayIndex &idx)
 Fetch a local element via its index (return NULL if not local).
virtual CkMigratablegetEltFromArrMgr (const CmiUInt8 id)
virtual void putEltInArrMgr (const CmiUInt8 id, CkMigratable *elt)
virtual void eraseEltFromArrMgr (const CmiUInt8 id)
void deleteElt (const CmiUInt8 id)
virtual CkMigratableallocateMigrated (int elChareType, CkElementCreation_t type)
 Create-after-migrate: Create an uninitialized element after migration The element's constructor will be called immediately after.
void stampListenerData (CkMigratable *elt)
void prepareCtorMsg (CkMessage *m, int listenerData[CK_ARRAYLISTENER_MAXLEN])
 Prepare creation message:.
int findInitialHostPe (const CkArrayIndex &idx, int proposedPe)
virtual void insertInitial (const CkArrayIndex &idx, void *ctorMsg)
 Create initial array elements:.
virtual void doneInserting (void)
virtual void beginInserting (void)
void remoteDoneInserting (void)
 This is called on every processor after the last array insertion.
void remoteBeginInserting (void)
void initDone (void)
bool insertElement (CkArrayMessage *, const CkArrayIndex &idx, int listenerData[CK_ARRAYLISTENER_MAXLEN])
 Create manually:.
void insertElement (CkMarshalledMessage &&, const CkArrayIndex &idx, int listenerData[CK_ARRAYLISTENER_MAXLEN])
void demandCreateElement (const CkArrayIndex &idx, int ctor, CkDeliver_t type)
 Demand-creation:.
void sendBroadcast (CkMessage *msg)
 Broadcast communication:.
void recvBroadcast (CkMessage *msg)
 Increment broadcast count; deliver to all local elements.
void sendExpeditedBroadcast (CkMessage *msg)
void recvExpeditedBroadcast (CkMessage *msg)
void recvBroadcastViaTree (CkMessage *msg)
void ckDestroy ()
 Whole array destruction, including all elements and the group itself.
void pup (PUP::er &p)
 Pack/UnPack - tell the runtime how to serialize this class's data for migration, checkpoint, etc.
void ckJustMigrated (void)
virtual bool isArrMgr (void)
void addListener (CkArrayListener *l)
void flushStates ()
void forwardZCMsgToOtherElems (envelope *env)
virtual int numberReductionMessages ()
void broadcastHomeElements (void *data, CkLocRec *rec, CkArrayIndex *index)

Static Public Member Functions

static void staticBroadcastHomeElements (CkArray *arr, void *data, CkLocRec *rec, CkArrayIndex *index)
static bool isIrreducible ()

Private Member Functions

ArrayElementallocate (int elChareType, CkMessage *msg, bool fromMigration, int *listenerData)
 Allocate space for a new array element.
void springCleaning (void)
void setupSpringCleaning ()

Static Private Member Functions

static void staticSpringCleaning (void *forWhom, double curWallTime)

Private Attributes

CkMagicNumber< ArrayElementmagic
CkLocMgrlocMgr
CkGroupID locMgrID
CkGroupID mCastMgrID
bool sectionAutoDelegate
CkCallback initCallback
CProxy_CkArray thisProxy
std::unordered_map< CmiUInt8,
unsigned int
localElems
std::vector< CkMigratable * > localElemVec
intchildren
int numChildren
UShort recvBroadcastEpIdx
bool stableLocations
CkArrayIndex numInitial
bool isInserting
 Number of initial array elements.
int numPesInited
 Are we currently inserting elements?
int springCleaningCcd
CkPupAblePtrVec< CkArrayListenerlisteners
int listenerDataOffset
CkArrayReducerreducer
CkArrayBroadcasterbroadcaster

Friends

class ArrayElement
class CProxy_ArrayBase
class CProxyElement_ArrayBase

Detailed Description

Definition at line 543 of file ckarray.h.


Constructor & Destructor Documentation

CkArray::CkArray ( CkArrayOptions &&  c,
CkMarshalledMessage &&  initMsg 
)

CkArray::CkArray ( CkMigrateMessage m  ) 

Definition at line 912 of file ckarray.C.

References isInserting, and locMgr.

CkArray::~CkArray (  ) 

Definition at line 919 of file ckarray.C.

References CcdCancelCallOnCondition(), springCleaningCcd, and stableLocations.

Here is the call graph for this function:


Member Function Documentation

CkGroupID& CkArray::getGroupID ( void   )  [inline]

Definition at line 572 of file ckarray.h.

Referenced by CkArrayElementRangeIterator< T >::addLocation().

Here is the caller graph for this function:

CkGroupID& CkArray::getmCastMgr ( void   )  [inline]

Definition at line 573 of file ckarray.h.

bool CkArray::isSectionAutoDelegated ( void   )  [inline]

Definition at line 574 of file ckarray.h.

UShort& CkArray::getRecvBroadcastEpIdx ( void   )  [inline]

CkLocMgr* CkArray::getLocMgr ( void   )  [inline]

const CkArrayIndex& CkArray::getNumInitial ( void   )  const [inline]

Definition at line 580 of file ckarray.h.

int CkArray::homePe ( const CkArrayIndex &  idx  )  const [inline]

Definition at line 581 of file ckarray.h.

Referenced by broadcastHomeElements().

Here is the caller graph for this function:

int CkArray::procNum ( const CkArrayIndex &  idx  )  const [inline]

Definition at line 582 of file ckarray.h.

Referenced by findInitialHostPe().

Here is the caller graph for this function:

int CkArray::lastKnown ( const CkArrayIndex &  idx  )  const [inline]

Return the last known processor for this array index.

Valid for any possible array index.

Definition at line 586 of file ckarray.h.

Referenced by final::destLikelyWithinProcess(), CkObjID::guessPE(), and CkMulticastMgr::initCookie().

Here is the caller graph for this function:

void CkArray::deliver ( CkMessage m,
const CkArrayIndex &  idx,
CkDeliver_t  type,
int  opts = 0 
) [inline]

Deliver message to this element (directly if local) doFree if is local.

Definition at line 590 of file ckarray.h.

Referenced by _processArrayEltMsg(), broadcastHomeElements(), CkSendMsgArray(), and CkSendMsgArrayInline().

Here is the caller graph for this function:

int CkArray::deliver ( CkArrayMessage m,
CkDeliver_t  type 
) [inline]

Definition at line 592 of file ckarray.h.

References CkArrayMessage::array_element_id().

Here is the call graph for this function:

ArrayElement* CkArray::lookup ( const CmiUInt8  id  )  [inline]

Fetch a local element via its ID (return NULL if not local).

Definition at line 595 of file ckarray.h.

Referenced by CpdPythonArrayIterator::addLocation(), CkArrayElementRangeIterator< T >::addLocation(), CkArrayMessageObjectPtr(), CkLocMgr::deliverMsg(), and CkMemCheckPT::inmem_restore().

Here is the caller graph for this function:

ArrayElement* CkArray::lookup ( const CkArrayIndex &  idx  )  [inline]

Fetch a local element via its index (return NULL if not local).

Definition at line 597 of file ckarray.h.

virtual CkMigratable* CkArray::getEltFromArrMgr ( const CmiUInt8  id  )  [inline, virtual]

Definition at line 606 of file ckarray.h.

Referenced by CkLocMgr::addElementToRec(), and CkLocMgr::pupElementsFor().

Here is the caller graph for this function:

virtual void CkArray::putEltInArrMgr ( const CmiUInt8  id,
CkMigratable elt 
) [inline, virtual]

Definition at line 610 of file ckarray.h.

Referenced by CkLocMgr::addElementToRec().

Here is the caller graph for this function:

virtual void CkArray::eraseEltFromArrMgr ( const CmiUInt8  id  )  [inline, virtual]

Definition at line 615 of file ckarray.h.

References CkMigratable::ckGetID(), and offset.

Here is the call graph for this function:

void CkArray::deleteElt ( const CmiUInt8  id  )  [inline]

Definition at line 633 of file ckarray.h.

References CkMigratable::ckGetID(), and offset.

Referenced by ArrayElement::ckDestroy().

Here is the call graph for this function:

Here is the caller graph for this function:

CkMigratable * CkArray::allocateMigrated ( int  elChareType,
CkElementCreation_t  type 
) [virtual]

Create-after-migrate: Create an uninitialized element after migration The element's constructor will be called immediately after.

Definition at line 999 of file ckarray.C.

References allocate().

Referenced by CkLocMgr::pupElementsFor().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::stampListenerData ( CkMigratable elt  ) 

Definition at line 993 of file ckarray.C.

References ArrayElement::listenerData.

Referenced by CkLocMgr::pupElementsFor().

Here is the caller graph for this function:

void CkArray::prepareCtorMsg ( CkMessage m,
int  listenerData[CK_ARRAYLISTENER_MAXLEN] 
)

Prepare creation message:.

Referenced by CProxy_ArrayBase::ckInsertIdx(), demandCreateElement(), and insertInitial().

Here is the caller graph for this function:

int CkArray::findInitialHostPe ( const CkArrayIndex &  idx,
int  proposedPe 
)

Definition at line 976 of file ckarray.C.

References locMgr, procNum(), and CkLocMgr::whichPE().

Referenced by CProxy_ArrayBase::ckInsertIdx().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::insertInitial ( const CkArrayIndex &  idx,
void *  ctorMsg 
) [virtual]

Create initial array elements:.

Definition at line 1127 of file ckarray.C.

References insertElement(), and prepareCtorMsg().

Referenced by ConfigurableRRMap::populateInitial().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::doneInserting ( void   )  [virtual]

Definition at line 1078 of file ckarray.C.

References Converse::CkMyPe(), and thisProxy.

Referenced by ConfigurableRRMap::populateInitial(), CldMap::populateInitial(), BlockMap::populateInitial(), and CkArrayMap::populateInitial().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::beginInserting ( void   )  [virtual]

Definition at line 1083 of file ckarray.C.

References Converse::CkMyPe(), and thisProxy.

Here is the call graph for this function:

void CkArray::remoteDoneInserting ( void   ) 

This is called on every processor after the last array insertion.

Definition at line 1089 of file ckarray.C.

References CkLocMgr::doneInserting(), initDone(), isInserting, PUP::l, listeners, locMgr, and CkVec< T >::size().

Here is the call graph for this function:

void CkArray::remoteBeginInserting ( void   ) 

Definition at line 1101 of file ckarray.C.

References isInserting, PUP::l, listeners, locMgr, CkVec< T >::size(), and CkLocMgr::startInserting().

Here is the call graph for this function:

void CkArray::initDone ( void   ) 

Definition at line 1047 of file ckarray.C.

References CkReductionMsg::buildNew(), Converse::CkMyPe(), CkReductionMgr::hasParent(), initCallback, CkCallback::isInvalid(), numPesInited, CkCallback::send(), thisProxy, CkReductionMgr::treeKids(), and CkReductionMgr::treeParent().

Referenced by CkArray(), and remoteDoneInserting().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CkArray::insertElement ( CkArrayMessage me,
const CkArrayIndex &  idx,
int  listenerData[CK_ARRAYLISTENER_MAXLEN] 
)

Create manually:.

This method is called by ck.C or the user to add an element.

Definition at line 1029 of file ckarray.C.

References _entryTable, CkLocMgr::addElement(), allocate(), CkArrayMessage::array_ep(), CkLocMgr::isRemote(), PUP::l, listeners, locMgr, IrrGroup::thisgroup, and thisProxy.

Referenced by demandCreateElement(), insertElement(), and insertInitial().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::insertElement ( CkMarshalledMessage &&  m,
const CkArrayIndex &  idx,
int  listenerData[CK_ARRAYLISTENER_MAXLEN] 
)

Definition at line 1023 of file ckarray.C.

References insertElement().

Here is the call graph for this function:

void CkArray::demandCreateElement ( const CkArrayIndex &  idx,
int  ctor,
CkDeliver_t  type 
)

Demand-creation:.

Demand-create an element at this index on this processor

Definition at line 1113 of file ckarray.C.

References CkArrayMessage::array_ep(), ArrayEltInitMsg, CkAllocSysMsg(), idx2str(), insertElement(), prepareCtorMsg(), envelope::setArrayMgr(), envelope::setMsgtype(), IrrGroup::thisgroup, and UsrToEnv().

Here is the call graph for this function:

void CkArray::sendBroadcast ( CkMessage msg  ) 

Broadcast communication:.

Reflect a broadcast off this Pe:.

Definition at line 1452 of file ckarray.C.

References children, CkCopyMsg(), Converse::CkMyPe(), numChildren, recvBroadcast(), and thisProxy.

Here is the call graph for this function:

void CkArray::recvBroadcast ( CkMessage msg  ) 

void CkArray::sendExpeditedBroadcast ( CkMessage msg  ) 

Definition at line 1473 of file ckarray.C.

References thisProxy.

void CkArray::recvExpeditedBroadcast ( CkMessage msg  )  [inline]

Definition at line 682 of file ckarray.h.

void CkArray::recvBroadcastViaTree ( CkMessage msg  ) 

Definition at line 1484 of file ckarray.C.

References children, CkCopyMsg(), numChildren, recvBroadcast(), and thisProxy.

Here is the call graph for this function:

void CkArray::ckDestroy ( void   ) 

Whole array destruction, including all elements and the group itself.

Definition at line 1672 of file ckarray.C.

References _localBranch(), CkLocMgr::deleteManager(), CkReductionMgr::isDestroying, _ckGroupID::isZero(), localElemVec, locMgr, mCastMgrID, CkLocMgr::setDuringDestruction(), _ckGroupID::setZero(), and thisProxy.

Here is the call graph for this function:

void CkArray::pup ( PUP::er p  )  [virtual]

Pack/UnPack - tell the runtime how to serialize this class's data for migration, checkpoint, etc.

Reimplemented from CkReductionMgr.

Definition at line 936 of file ckarray.C.

References CkLocMgr::addManager(), broadcaster, initCallback, PUP::er::isUnpacking(), listenerDataOffset, listeners, locMgr, locMgrID, mCastMgrID, numInitial, numPesInited, CkReductionMgr::pup(), reducer, sectionAutoDelegate, setupSpringCleaning(), stableLocations, testPup(), IrrGroup::thisgroup, and thisProxy.

Here is the call graph for this function:

void CkArray::ckJustMigrated ( void   )  [inline, virtual]

Reimplemented from IrrGroup.

Definition at line 689 of file ckarray.h.

virtual bool CkArray::isArrMgr ( void   )  [inline, virtual]

Reimplemented from IrrGroup.

Definition at line 691 of file ckarray.h.

ArrayElement * CkArray::allocate ( int  elChareType,
CkMessage msg,
bool  fromMigration,
int listenerData 
) [private]

Allocate space for a new array element.

Definition at line 1005 of file ckarray.C.

References _chareTable, elem, ArrayElement_initInfo::fromMigration, init(), ArrayElement_initInfo::listenerData, malloc(), numInitial, ArrayElement_initInfo::numInitial, setMemoryTypeChare(), ArrayElement_initInfo::thisArray, ArrayElement_initInfo::thisArrayID, and IrrGroup::thisgroup.

Referenced by allocateMigrated(), and insertElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::springCleaning ( void   )  [inline, private]

Definition at line 533 of file ckarray.C.

References broadcaster, setupSpringCleaning(), and CkArrayBroadcaster::springCleaning().

Here is the call graph for this function:

void CkArray::staticSpringCleaning ( void *  forWhom,
double  curWallTime 
) [static, private]

Definition at line 540 of file ckarray.C.

Referenced by setupSpringCleaning().

Here is the caller graph for this function:

void CkArray::setupSpringCleaning (  )  [private]

Definition at line 544 of file ckarray.C.

References CcdCallOnCondition(), springCleaningCcd, stableLocations, and staticSpringCleaning().

Referenced by CkArray(), pup(), and springCleaning().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::addListener ( CkArrayListener l  )  [inline]

Definition at line 711 of file ckarray.h.

References CkArrayListener::ckGetLen().

Referenced by CkArray().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkArray::flushStates (  )  [virtual]

Reimplemented from CkReductionMgr.

Definition at line 1657 of file ckarray.C.

References CkReductionMgr::flushStates(), PUP::l, listeners, and CkReductionMgr::resetCountersWhenFlushingStates().

Here is the call graph for this function:

void CkArray::forwardZCMsgToOtherElems ( envelope env  ) 

Definition at line 1638 of file ckarray.C.

References CkArrayMessage::array_ep_bcast(), broadcaster, CkArrayBroadcaster::deliver(), EnvToUsr(), envelope::getsetArrayEp(), len, localElemVec, and stableLocations.

Referenced by CkRdmaEMBcastAckHandler(), and handleArrayMsgOnChildPostCompletionForRecvBcast().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int CkArray::numberReductionMessages (  )  [inline, virtual]

Reimplemented from CkReductionMgr.

Definition at line 732 of file ckarray.h.

References Converse::CkMyPe().

Here is the call graph for this function:

void CkArray::broadcastHomeElements ( void *  data,
CkLocRec rec,
CkArrayIndex *  index 
)

void CkArray::staticBroadcastHomeElements ( CkArray arr,
void *  data,
CkLocRec rec,
CkArrayIndex *  index 
) [static]

Definition at line 1525 of file ckarray.C.

References broadcastHomeElements().

Referenced by recvBroadcast().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool CkArray::isIrreducible (  )  [inline, static]

Reimplemented from CkReductionMgr.

Definition at line 737 of file ckarray.h.


Friends And Related Function Documentation

friend class ArrayElement [friend]

Definition at line 544 of file ckarray.h.

friend class CProxy_ArrayBase [friend]

Definition at line 545 of file ckarray.h.

friend class CProxyElement_ArrayBase [friend]

Definition at line 546 of file ckarray.h.


Field Documentation

Reimplemented from Chare.

Definition at line 548 of file ckarray.h.

Definition at line 550 of file ckarray.h.

Referenced by pup().

Definition at line 551 of file ckarray.h.

Referenced by ckDestroy(), and pup().

Definition at line 552 of file ckarray.h.

Referenced by pup().

Definition at line 553 of file ckarray.h.

Referenced by initDone(), and pup().

CProxy_CkArray CkArray::thisProxy [private]

std::unordered_map<CmiUInt8, unsigned int> CkArray::localElems [private]

Definition at line 556 of file ckarray.h.

std::vector<CkMigratable *> CkArray::localElemVec [private]

Definition at line 557 of file ckarray.h.

Referenced by ckDestroy(), forwardZCMsgToOtherElems(), and recvBroadcast().

int* CkArray::children [private]

Definition at line 559 of file ckarray.h.

Referenced by CkArray(), recvBroadcastViaTree(), and sendBroadcast().

Definition at line 560 of file ckarray.h.

Referenced by CkArray(), recvBroadcastViaTree(), and sendBroadcast().

Definition at line 563 of file ckarray.h.

Referenced by recvBroadcast().

CkArrayIndex CkArray::numInitial [private]

Definition at line 694 of file ckarray.h.

Referenced by allocate(), and pup().

Number of initial array elements.

Definition at line 695 of file ckarray.h.

Referenced by CkArray(), remoteBeginInserting(), and remoteDoneInserting().

Are we currently inserting elements?

Definition at line 696 of file ckarray.h.

Referenced by initDone(), and pup().

Definition at line 705 of file ckarray.h.

Referenced by setupSpringCleaning(), and ~CkArray().

Definition at line 709 of file ckarray.h.

Referenced by CkArray(), and pup().

Definition at line 722 of file ckarray.h.

Referenced by CkArray(), ArrayElement::contribute2(), ArrayElement::getRedNo(), and pup().

Definition at line 723 of file ckarray.h.

Referenced by CkArray(), forwardZCMsgToOtherElems(), pup(), recvBroadcast(), and springCleaning().


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:19:07 2020 for Charm++ by  doxygen 1.5.5