#include <ckarray.h>
Public Member Functions | |
CkArray (CkArrayOptions &&c, CkMarshalledMessage &&initMsg) | |
CkArray (CkMigrateMessage *m) | |
~CkArray () | |
CkGroupID & | getGroupID (void) |
CkGroupID & | getmCastMgr (void) |
bool | isSectionAutoDelegated (void) |
UShort & | getRecvBroadcastEpIdx (void) |
CkLocMgr * | getLocMgr (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) |
ArrayElement * | lookup (const CmiUInt8 id) |
Fetch a local element via its ID (return NULL if not local). | |
ArrayElement * | lookup (const CkArrayIndex &idx) |
Fetch a local element via its index (return NULL if not local). | |
virtual CkMigratable * | getEltFromArrMgr (const CmiUInt8 id) |
virtual void | putEltInArrMgr (const CmiUInt8 id, CkMigratable *elt) |
virtual void | eraseEltFromArrMgr (const CmiUInt8 id) |
void | deleteElt (const CmiUInt8 id) |
virtual CkMigratable * | allocateMigrated (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 | |
ArrayElement * | allocate (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< ArrayElement > | magic |
CkLocMgr * | locMgr |
CkGroupID | locMgrID |
CkGroupID | mCastMgrID |
bool | sectionAutoDelegate |
CkCallback | initCallback |
CProxy_CkArray | thisProxy |
std::unordered_map< CmiUInt8, unsigned int > | localElems |
std::vector< CkMigratable * > | localElemVec |
int * | children |
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< CkArrayListener > | listeners |
int | listenerDataOffset |
CkArrayReducer * | reducer |
CkArrayBroadcaster * | broadcaster |
Friends | |
class | ArrayElement |
class | CProxy_ArrayBase |
class | CProxyElement_ArrayBase |
Definition at line 543 of file ckarray.h.
CkArray::CkArray | ( | CkArrayOptions && | c, | |
CkMarshalledMessage && | initMsg | |||
) |
Set up initial elements (if any)
Definition at line 833 of file ckarray.C.
References addListener(), CkLocMgr::addManager(), broadcaster, children, Converse::CkMyPe(), CkReductionMgr::ckSetReductionClient(), CmiAlloc(), CmiMyPe(), CkReductionMgr::disableNotifyChildrenStart, initDone(), CkCallback::invalid, PUP::l, level, listenerDataOffset, listeners, locMgr, max(), numChildren, CkLocMgr::populateInitial(), reducer, setupSpringCleaning(), CkVec< T >::size(), stableLocations, and IrrGroup::thisgroup.
CkArray::CkArray | ( | CkMigrateMessage * | m | ) |
CkArray::~CkArray | ( | ) |
Definition at line 919 of file ckarray.C.
References CcdCancelCallOnCondition(), springCleaningCcd, and stableLocations.
CkGroupID& CkArray::getGroupID | ( | void | ) | [inline] |
Definition at line 572 of file ckarray.h.
Referenced by CkArrayElementRangeIterator< T >::addLocation().
UShort& CkArray::getRecvBroadcastEpIdx | ( | void | ) | [inline] |
Definition at line 576 of file ckarray.h.
Referenced by CkRdmaEMBcastAckHandler(), handleArrayMsgOnChildPostCompletionForRecvBcast(), handleMsgOnInterimPostCompletionForRecvBcast(), recvBroadcast(), and sendRecvDoneMsgToPeers().
CkLocMgr* CkArray::getLocMgr | ( | void | ) | [inline] |
Definition at line 579 of file ckarray.h.
Referenced by ArrayMeshStreamer< dtype, itype, ClientType, RouterType, EntryMethod >::ArrayMeshStreamer(), CkArrayOptions::bindTo(), CpdPythonGroup::buildIterator(), CProxy_ArrayBase::ckLocMgr(), MeshStreamer< dtype >::init(), ArrayElement::init_checkpt(), ArrayElement::inmem_checkpoint(), CkArrayElementRangeIterator< T >::iterate(), and updateHomePE().
const CkArrayIndex& CkArray::getNumInitial | ( | void | ) | const [inline] |
int CkArray::homePe | ( | const CkArrayIndex & | idx | ) | const [inline] |
Definition at line 581 of file ckarray.h.
Referenced by broadcastHomeElements().
int CkArray::procNum | ( | const CkArrayIndex & | idx | ) | const [inline] |
Definition at line 582 of file ckarray.h.
Referenced by findInitialHostPe().
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().
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().
int CkArray::deliver | ( | CkArrayMessage * | m, | |
CkDeliver_t | type | |||
) | [inline] |
Definition at line 592 of file ckarray.h.
References CkArrayMessage::array_element_id().
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().
ArrayElement* CkArray::lookup | ( | const CkArrayIndex & | idx | ) | [inline] |
virtual CkMigratable* CkArray::getEltFromArrMgr | ( | const CmiUInt8 | id | ) | [inline, virtual] |
Definition at line 606 of file ckarray.h.
Referenced by CkLocMgr::addElementToRec(), and CkLocMgr::pupElementsFor().
virtual void CkArray::putEltInArrMgr | ( | const CmiUInt8 | id, | |
CkMigratable * | elt | |||
) | [inline, virtual] |
Definition at line 610 of file ckarray.h.
Referenced by CkLocMgr::addElementToRec().
virtual void CkArray::eraseEltFromArrMgr | ( | const CmiUInt8 | id | ) | [inline, virtual] |
Definition at line 615 of file ckarray.h.
References CkMigratable::ckGetID(), and offset.
void CkArray::deleteElt | ( | const CmiUInt8 | id | ) | [inline] |
Definition at line 633 of file ckarray.h.
References CkMigratable::ckGetID(), and offset.
Referenced by ArrayElement::ckDestroy().
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().
void CkArray::stampListenerData | ( | CkMigratable * | elt | ) |
Definition at line 993 of file ckarray.C.
References ArrayElement::listenerData.
Referenced by CkLocMgr::pupElementsFor().
Prepare creation message:.
Referenced by CProxy_ArrayBase::ckInsertIdx(), demandCreateElement(), and insertInitial().
Definition at line 976 of file ckarray.C.
References locMgr, procNum(), and CkLocMgr::whichPE().
Referenced by CProxy_ArrayBase::ckInsertIdx().
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().
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().
void CkArray::beginInserting | ( | void | ) | [virtual] |
Definition at line 1083 of file ckarray.C.
References Converse::CkMyPe(), and thisProxy.
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().
void CkArray::remoteBeginInserting | ( | void | ) |
Definition at line 1101 of file ckarray.C.
References isInserting, PUP::l, listeners, locMgr, CkVec< T >::size(), and CkLocMgr::startInserting().
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().
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().
void CkArray::insertElement | ( | CkMarshalledMessage && | m, | |
const CkArrayIndex & | idx, | |||
int | listenerData[CK_ARRAYLISTENER_MAXLEN] | |||
) |
Definition at line 1023 of file ckarray.C.
References insertElement().
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().
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.
void CkArray::recvBroadcast | ( | CkMessage * | msg | ) |
Increment broadcast count; deliver to all local elements.
Definition at line 1535 of file ckarray.C.
References broadcaster, CkLocMgr::callForAllRecords(), CkArrayBroadcaster::deliver(), ForArrayEltMsg, ForBocMsg, getArrayMgrFromMsg(), envelope::getEpIdx(), getRecvBroadcastEpIdx(), envelope::getsetArrayEp(), CkArrayBroadcaster::incoming(), len, localElemVec, locMgr, recvBroadcastEpIdx, root, envelope::setArrayMgr(), envelope::setMsgtype(), stableLocations, staticBroadcastHomeElements(), IrrGroup::thisgroup, and UsrToEnv().
Referenced by recvBroadcastViaTree(), and sendBroadcast().
void CkArray::sendExpeditedBroadcast | ( | CkMessage * | msg | ) |
void CkArray::recvExpeditedBroadcast | ( | CkMessage * | msg | ) | [inline] |
void CkArray::recvBroadcastViaTree | ( | CkMessage * | msg | ) |
Definition at line 1484 of file ckarray.C.
References children, CkCopyMsg(), numChildren, recvBroadcast(), and thisProxy.
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.
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.
void CkArray::ckJustMigrated | ( | void | ) | [inline, virtual] |
virtual bool CkArray::isArrMgr | ( | void | ) | [inline, virtual] |
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().
void CkArray::springCleaning | ( | void | ) | [inline, private] |
Definition at line 533 of file ckarray.C.
References broadcaster, setupSpringCleaning(), and CkArrayBroadcaster::springCleaning().
void CkArray::staticSpringCleaning | ( | void * | forWhom, | |
double | curWallTime | |||
) | [static, private] |
Definition at line 540 of file ckarray.C.
Referenced by setupSpringCleaning().
void CkArray::setupSpringCleaning | ( | ) | [private] |
Definition at line 544 of file ckarray.C.
References CcdCallOnCondition(), springCleaningCcd, stableLocations, and staticSpringCleaning().
Referenced by CkArray(), pup(), and springCleaning().
void CkArray::addListener | ( | CkArrayListener * | l | ) | [inline] |
Definition at line 711 of file ckarray.h.
References CkArrayListener::ckGetLen().
Referenced by CkArray().
void CkArray::flushStates | ( | ) | [virtual] |
Reimplemented from CkReductionMgr.
Definition at line 1657 of file ckarray.C.
References CkReductionMgr::flushStates(), PUP::l, listeners, and CkReductionMgr::resetCountersWhenFlushingStates().
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().
virtual int CkArray::numberReductionMessages | ( | ) | [inline, virtual] |
Reimplemented from CkReductionMgr.
Definition at line 732 of file ckarray.h.
References Converse::CkMyPe().
void CkArray::broadcastHomeElements | ( | void * | data, | |
CkLocRec * | rec, | |||
CkArrayIndex * | index | |||
) |
Definition at line 1498 of file ckarray.C.
References _entryTable, CkArrayMessage::array_ep(), CkArrayMessage::array_ep_bcast(), CkCopyMsg(), CkDeliver_queue, Converse::CkMyPe(), CmiMyPe(), CmiPrintf(), copy(), deliver(), CkLocRec::getID(), envelope::getsetArrayHops(), CkLocMgr::homeElementCount, homePe(), _ckGroupID::idx, idx2str(), locMgr, envelope::setArrayMgr(), envelope::setEpIdx(), envelope::setRecipientID(), envelope::setSrcPe(), IrrGroup::thisgroup, and UsrToEnv().
Referenced by staticBroadcastHomeElements().
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().
static bool CkArray::isIrreducible | ( | ) | [inline, static] |
friend class ArrayElement [friend] |
friend class CProxy_ArrayBase [friend] |
CkMagicNumber<ArrayElement> CkArray::magic [private] |
CkLocMgr* CkArray::locMgr [private] |
Definition at line 549 of file ckarray.h.
Referenced by broadcastHomeElements(), CkArray(), ckDestroy(), findInitialHostPe(), insertElement(), pup(), recvBroadcast(), remoteBeginInserting(), and remoteDoneInserting().
CkGroupID CkArray::locMgrID [private] |
CkGroupID CkArray::mCastMgrID [private] |
bool CkArray::sectionAutoDelegate [private] |
CkCallback CkArray::initCallback [private] |
CProxy_CkArray CkArray::thisProxy [private] |
Reimplemented from CkReductionMgr.
Definition at line 554 of file ckarray.h.
Referenced by beginInserting(), ckDestroy(), doneInserting(), initDone(), insertElement(), pup(), recvBroadcastViaTree(), sendBroadcast(), and sendExpeditedBroadcast().
std::unordered_map<CmiUInt8, unsigned int> CkArray::localElems [private] |
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().
int CkArray::numChildren [private] |
Definition at line 560 of file ckarray.h.
Referenced by CkArray(), recvBroadcastViaTree(), and sendBroadcast().
UShort CkArray::recvBroadcastEpIdx [private] |
bool CkArray::stableLocations [private] |
Definition at line 565 of file ckarray.h.
Referenced by CkArray(), forwardZCMsgToOtherElems(), pup(), recvBroadcast(), setupSpringCleaning(), and ~CkArray().
CkArrayIndex CkArray::numInitial [private] |
bool CkArray::isInserting [private] |
Number of initial array elements.
Definition at line 695 of file ckarray.h.
Referenced by CkArray(), remoteBeginInserting(), and remoteDoneInserting().
int CkArray::numPesInited [private] |
Are we currently inserting elements?
Definition at line 696 of file ckarray.h.
Referenced by initDone(), and pup().
int CkArray::springCleaningCcd [private] |
CkPupAblePtrVec<CkArrayListener> CkArray::listeners [private] |
Definition at line 708 of file ckarray.h.
Referenced by ArrayElement::ckAboutToMigrate(), CkArray(), ArrayElement::ckDestroy(), ArrayElement::ckJustMigrated(), flushStates(), ArrayElement::initBasics(), insertElement(), pup(), remoteBeginInserting(), and remoteDoneInserting().
int CkArray::listenerDataOffset [private] |
CkArrayReducer* CkArray::reducer [private] |
Definition at line 722 of file ckarray.h.
Referenced by CkArray(), ArrayElement::contribute2(), ArrayElement::getRedNo(), and pup().
CkArrayBroadcaster* CkArray::broadcaster [private] |
Definition at line 723 of file ckarray.h.
Referenced by CkArray(), forwardZCMsgToOtherElems(), pup(), recvBroadcast(), and springCleaning().