PPL Logo

CkMigratable Class Reference

#include <ckmigratable.h>

Inheritance diagram for CkMigratable:

Inheritance graph
[legend]
Collaboration diagram for CkMigratable:

Collaboration graph
[legend]

Public Member Functions

 CkMigratable (void)
 CkMigratable (CkMigrateMessage *m)
virtual ~CkMigratable ()
virtual void pup (PUP::er &p)
 Pack/UnPack - tell the runtime how to serialize this class's data for migration, checkpoint, etc.
virtual void CkAddThreadListeners (CthThread tid, void *msg)
 Called when a [threaded] charm entry method is created:.
virtual int ckGetChareType (void) const
 Return the type of this chare, as present in _chareTable.
const CkArrayIndex & ckGetArrayIndex (void) const
CmiUInt8 ckGetID (void) const
void ckStopTiming (void)
void ckStartTiming (void)
LBDatabasegetLBDB (void) const
MetaBalancergetMetaBalancer (void) const
void ckStopTiming (void)
void ckStartTiming (void)
LDObjHandle timingBeforeCall (int *objstopped)
 for inline call
void timingAfterCall (LDObjHandle objHandle, int *objstopped)
void ckMigrate (int toPe)
virtual void ckAboutToMigrate (void)
 Called by the system just before and after migration to another processor:.
virtual void ckJustMigrated (void)
void recvLBPeriod (void *data)
void metaLBCallLB ()
void clearMetaLBData (void)
virtual void ckJustRestored (void)
virtual void ckDestroy (void)
 Delete this object.
bool ckInvokeEntry (int epIdx, void *msg, bool doFree)
 Execute the given entry method.
virtual void ResumeFromSync (void)
virtual void UserSetLBLoad (void)
void setObjTime (double cputime)
 user define this when setLBLoad is true
double getObjTime ()
void * getObjUserData (int idx)
 Use this method to set user specified data to the lbdatabase.
void AtSync (int waitForMigration=1)
int MigrateToPe ()
void ReadyMigrate (bool ready)
void ckFinishConstruction (void)
void setMigratable (int migratable)
void setPupSize (size_t obj_pup_size)
void AtSync (int waitForMigration=1)
void setMigratable (int migratable)
void setPupSize (size_t obj_pup_size)
void ckFinishConstruction (void)
bool isAsyncEvacuate ()

Data Fields

CkArrayIndex thisIndexMax

Protected Member Functions

virtual void CkAbort (const char *str) const
 A more verbose form of abort.

Protected Attributes

CkLocRecmyRec
bool usesAtSync
bool usesAutoMeasure
bool barrierRegistered

Private Types

enum  state {
  OFF, ON, PAUSE, DECIDED,
  LOAD_BALANCE
}

Private Member Functions

void commonInit (void)
void AsyncEvacuate (bool set)

Static Private Member Functions

static void staticResumeFromSync (void *data)

Private Attributes

int thisChareType
int atsync_iteration
double prev_load
CkMigratable::state local_state
bool can_reset
LDBarrierClient ldBarrierHandle
LDBarrierReceiver ldBarrierRecvHandle
int prefetchObjID
bool isInCore
bool asyncEvacuate

Friends

class CkLocMgr
int CkArrayPrefetch_msg2ObjId (void *msg)
 Return the out-of-core objid (from CooRegisterObject) that this Converse message will access.
void CkArrayPrefetch_writeToSwap (FILE *swapfile, void *objptr)
 Write this object (registered with RegisterObject) to this writable file.
void CkArrayPrefetch_readFromSwap (FILE *swapfile, void *objptr)
 Read this object (registered with RegisterObject) from this readable file.

Detailed Description

Definition at line 4 of file ckmigratable.h.


Member Enumeration Documentation

enum CkMigratable::state [private]

Enumerator:
OFF 
ON 
PAUSE 
DECIDED 
LOAD_BALANCE 

Definition at line 11 of file ckmigratable.h.


Constructor & Destructor Documentation

CkMigratable::CkMigratable ( void   ) 

Definition at line 1486 of file cklocation.C.

References commonInit().

Here is the call graph for this function:

CkMigratable::CkMigratable ( CkMigrateMessage m  ) 

Definition at line 1490 of file cklocation.C.

References commonInit().

Here is the call graph for this function:

CkMigratable::~CkMigratable (  )  [virtual]


Member Function Documentation

void CkMigratable::commonInit ( void   )  [private]

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

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

Reimplemented from Chare.

Reimplemented in ArrayElement, ArrayElemExt, Cell, Cell2D, Cell1D, Cell3D, ArmciVirtualProcessor, threadCollide, and TCharmClient1D.

Definition at line 1496 of file cklocation.C.

References CkLocRec::AsyncEvacuate(), asyncEvacuate, barrierRegistered, can_reset, ckFinishConstruction(), idx2str(), PUP::er::isPacking(), CkLocRec::isReadyMigrate(), PUP::er::isUnpacking(), myRec, p, Chare::pup(), CkLocRec::ReadyMigrate(), thisIndexMax, usesAtSync, and usesAutoMeasure.

Referenced by ArrayElement::pup().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::CkAddThreadListeners ( CthThread  tid,
void *  msg 
) [virtual]

Called when a [threaded] charm entry method is created:.

This method is called before starting a [threaded] entry method.

Reimplemented from Chare.

Definition at line 1803 of file cklocation.C.

References PUP::a, Chare::CkAddThreadListeners(), CkArrayThreadListener_free(), CkArrayThreadListener_resume(), CkArrayThreadListener_suspend(), CthAddListener(), CthSetThreadID(), and thisIndexMax.

Here is the call graph for this function:

int CkMigratable::ckGetChareType ( void   )  const [virtual]

Return the type of this chare, as present in _chareTable.

Reimplemented from Chare.

Definition at line 1494 of file cklocation.C.

References thisChareType.

Referenced by CpdList_arrayElements::add(), ArrayElemExt::ArrayElemExt(), ArrayElement::ckDebugChareName(), and CkLocMgr::pupElementsFor().

Here is the caller graph for this function:

const CkArrayIndex& CkMigratable::ckGetArrayIndex ( void   )  const [inline]

Definition at line 40 of file ckmigratable.h.

References CkLocRec::getIndex(), and myRec.

Referenced by CkCallback::CkCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

CmiUInt8 CkMigratable::ckGetID ( void   )  const [inline]

Reimplemented in ArrayElement.

Definition at line 41 of file ckmigratable.h.

References CkLocRec::getID(), and myRec.

Referenced by ArrayElement::ckDestroy(), CkArray::deleteElt(), and CkArray::eraseEltFromArrMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::ckStopTiming ( void   )  [inline]

Definition at line 45 of file ckmigratable.h.

References myRec, and CkLocRec::stopTiming().

Referenced by CkArrayThreadListener_suspend().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::ckStartTiming ( void   )  [inline]

Definition at line 47 of file ckmigratable.h.

References myRec, and CkLocRec::startTiming().

Referenced by CkArrayThreadListener_resume().

Here is the call graph for this function:

Here is the caller graph for this function:

LBDatabase* CkMigratable::getLBDB ( void   )  const [inline]

Definition at line 48 of file ckmigratable.h.

References CkLocRec::getLBDB(), and myRec.

Referenced by timingAfterCall(), and timingBeforeCall().

Here is the call graph for this function:

Here is the caller graph for this function:

MetaBalancer* CkMigratable::getMetaBalancer ( void   )  const [inline]

Definition at line 49 of file ckmigratable.h.

References CkLocRec::getMetaBalancer(), and myRec.

Referenced by AtSync().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::ckStopTiming ( void   )  [inline]

Definition at line 51 of file ckmigratable.h.

void CkMigratable::ckStartTiming ( void   )  [inline]

Definition at line 52 of file ckmigratable.h.

LDObjHandle CkMigratable::timingBeforeCall ( int objstopped  ) 

for inline call

Definition at line 1928 of file cklocation.C.

References getLBDB(), myRec, LBDatabase::ObjectStop(), and CkLocRec::startTiming().

Here is the call graph for this function:

void CkMigratable::timingAfterCall ( LDObjHandle  objHandle,
int objstopped 
)

Definition at line 1941 of file cklocation.C.

References getLBDB(), myRec, LBDatabase::ObjectStart(), and CkLocRec::stopTiming().

Here is the call graph for this function:

void CkMigratable::ckMigrate ( int  toPe  )  [inline]

Definition at line 60 of file ckmigratable.h.

References CkLocRec::migrateMe(), and myRec.

Here is the call graph for this function:

void CkMigratable::ckAboutToMigrate ( void   )  [virtual]

Called by the system just before and after migration to another processor:.

Reimplemented in ArrayElement.

Definition at line 1520 of file cklocation.C.

Referenced by ElementDistributor::addLocation(), ArrayElement::ckAboutToMigrate(), CkLocMgr::emigrate(), and sendBackImmigrantRecObjs().

Here is the caller graph for this function:

void CkMigratable::ckJustMigrated ( void   )  [virtual]

Reimplemented in ArrayElement, threadCollide, and TCharmClient1D.

Definition at line 1521 of file cklocation.C.

Referenced by ArrayElement::ckJustMigrated(), CkLocMgr::immigrate(), and CkLocMgr::resume().

Here is the caller graph for this function:

void CkMigratable::recvLBPeriod ( void *  data  ) 

Definition at line 1609 of file cklocation.C.

References atsync_iteration, can_reset, Converse::CkMyPe(), DECIDED, CkLocRec::getMetaBalancer(), MetaBalancer::getPredictedLBPeriod(), idx2str(), LOAD_BALANCE, local_state, myRec, PAUSE, ResumeFromSync(), and thisIndexMax.

Referenced by CkLocMgr::informLBPeriod().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::metaLBCallLB (  ) 

Definition at line 1638 of file cklocation.C.

References LBDatabase::AtLocalBarrier(), CkLocRec::getLBDB(), ldBarrierHandle, myRec, and usesAtSync.

Referenced by CkLocMgr::metaLBCallLB().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::clearMetaLBData ( void   ) 

Definition at line 1600 of file cklocation.C.

References atsync_iteration, can_reset, local_state, OFF, and prev_load.

Referenced by staticResumeFromSync().

Here is the caller graph for this function:

void CkMigratable::ckJustRestored ( void   )  [virtual]

Reimplemented in ArrayElement.

Definition at line 1522 of file cklocation.C.

Referenced by ArrayElement::ckJustRestored(), and CkLocMgr::restore().

Here is the caller graph for this function:

void CkMigratable::ckDestroy ( void   )  [virtual]

Delete this object.

Reimplemented in ArrayElement.

Definition at line 1519 of file cklocation.C.

Referenced by CkLocation::destroyAll(), and CkLocMgr::flushLocalRecs().

Here is the caller graph for this function:

bool CkMigratable::ckInvokeEntry ( int  epIdx,
void *  msg,
bool  doFree 
) [inline]

Execute the given entry method.

Returns false if the element deleted itself or migrated away during execution.

Definition at line 78 of file ckmigratable.h.

References CkLocRec::invokeEntry(), and myRec.

Referenced by CkArrayBroadcaster::deliver(), and ArrayElement::recvBroadcast().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::CkAbort ( const char *  str  )  const [protected, virtual]

A more verbose form of abort.

Reimplemented in ArrayElement.

Definition at line 1555 of file cklocation.C.

References _chareTable, name, and thisChareType.

Referenced by AtSync(), ArrayElement::CkAbort(), and UserSetLBLoad().

Here is the caller graph for this function:

void CkMigratable::ResumeFromSync ( void   )  [virtual]

Reimplemented in ArrayElemExt, and Cell.

Definition at line 1560 of file cklocation.C.

Referenced by AtSync(), CkLocMgr::immigrate(), recvLBPeriod(), and staticResumeFromSync().

Here is the caller graph for this function:

void CkMigratable::UserSetLBLoad ( void   )  [virtual]

Definition at line 1565 of file cklocation.C.

References CkAbort().

Referenced by AtSync().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::setObjTime ( double  cputime  ) 

user define this when setLBLoad is true

Definition at line 1571 of file cklocation.C.

References myRec, and CkLocRec::setObjTime().

Here is the call graph for this function:

double CkMigratable::getObjTime (  ) 

Definition at line 1574 of file cklocation.C.

References CkLocRec::getObjTime(), and myRec.

Here is the call graph for this function:

void * CkMigratable::getObjUserData ( int  idx  ) 

Use this method to set user specified data to the lbdatabase.

Eg usage: In the application code, void *data = getObjUserData(CkpvAccess(_lb_obj_index)); *(int *) data = val;

In the loadbalancer or wherever this data is used do for (int i = 0; i < stats->n_objs; i++ ) { LDObjData &odata = stats->objData[i]; int* udata = (int *) odata.getUserData(CkpvAccess(_lb_obj_index)); }

For a complete example look at tests/charm++/load_balancing/lb_userdata_test/

Definition at line 1595 of file cklocation.C.

References CkLocRec::getObjUserData(), and myRec.

Here is the call graph for this function:

void CkMigratable::AtSync ( int  waitForMigration = 1  ) 

int CkMigratable::MigrateToPe (  )  [inline]

Definition at line 96 of file ckmigratable.h.

References CkLocRec::MigrateToPe(), and myRec.

Here is the call graph for this function:

void CkMigratable::staticResumeFromSync ( void *  data  )  [static, private]

Definition at line 1748 of file cklocation.C.

References _lb_args, clearMetaLBData(), idx2str(), CkLBArgs::metaLbOn(), Chare::mlogData, ChareMlogData::resumeCount, ResumeFromSync(), thisIndexMax, and ChareMlogData::toResumeOrNot.

Referenced by ckFinishConstruction().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::ReadyMigrate ( bool  ready  ) 

Definition at line 1739 of file cklocation.C.

References myRec, and CkLocRec::ReadyMigrate().

Referenced by AtSync().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::ckFinishConstruction ( void   ) 

void CkMigratable::setMigratable ( int  migratable  ) 

Definition at line 1770 of file cklocation.C.

References myRec, and CkLocRec::setMigratable().

Here is the call graph for this function:

void CkMigratable::setPupSize ( size_t  obj_pup_size  ) 

Definition at line 1775 of file cklocation.C.

References myRec, and CkLocRec::setPupSize().

Referenced by AtSync().

Here is the call graph for this function:

Here is the caller graph for this function:

void CkMigratable::AtSync ( int  waitForMigration = 1  )  [inline]

Definition at line 106 of file ckmigratable.h.

References ResumeFromSync().

Here is the call graph for this function:

void CkMigratable::setMigratable ( int  migratable  )  [inline]

Definition at line 107 of file ckmigratable.h.

void CkMigratable::setPupSize ( size_t  obj_pup_size  )  [inline]

Definition at line 108 of file ckmigratable.h.

void CkMigratable::ckFinishConstruction ( void   )  [inline]

Definition at line 110 of file ckmigratable.h.

void CkMigratable::AsyncEvacuate ( bool  set  )  [inline, private]

Definition at line 126 of file ckmigratable.h.

References asyncEvacuate, CkLocRec::AsyncEvacuate(), and myRec.

Referenced by commonInit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CkMigratable::isAsyncEvacuate (  )  [inline]

Definition at line 128 of file ckmigratable.h.

References asyncEvacuate.


Friends And Related Function Documentation

friend class CkLocMgr [friend]

Reimplemented in ArrayElement.

Definition at line 115 of file ckmigratable.h.

int CkArrayPrefetch_msg2ObjId ( void *  msg  )  [friend]

Return the out-of-core objid (from CooRegisterObject) that this Converse message will access.

If the message will not access an object, return -1.

Definition at line 1382 of file cklocation.C.

void CkArrayPrefetch_writeToSwap ( FILE *  swapfile,
void *  objptr 
) [friend]

Write this object (registered with RegisterObject) to this writable file.

Definition at line 1392 of file cklocation.C.

void CkArrayPrefetch_readFromSwap ( FILE *  swapfile,
void *  objptr 
) [friend]

Read this object (registered with RegisterObject) from this readable file.

Definition at line 1409 of file cklocation.C.


Field Documentation

Definition at line 8 of file ckmigratable.h.

Referenced by CkAbort(), CkArrayPrefetch_readFromSwap(), ckGetChareType(), and commonInit().

Definition at line 9 of file ckmigratable.h.

Referenced by AtSync(), clearMetaLBData(), commonInit(), recvLBPeriod(), and ~CkMigratable().

double CkMigratable::prev_load [private]

Definition at line 10 of file ckmigratable.h.

Referenced by AtSync(), clearMetaLBData(), and commonInit().

Definition at line 18 of file ckmigratable.h.

Referenced by AtSync(), clearMetaLBData(), commonInit(), pup(), and recvLBPeriod().

Definition at line 21 of file ckmigratable.h.

Referenced by AtSync(), ckFinishConstruction(), commonInit(), and pup().

Definition at line 22 of file ckmigratable.h.

Referenced by ckFinishConstruction(), commonInit(), pup(), and ~CkMigratable().

Definition at line 25 of file ckmigratable.h.

Referenced by AtSync(), ckFinishConstruction(), metaLBCallLB(), and ~CkMigratable().

Definition at line 26 of file ckmigratable.h.

Referenced by ckFinishConstruction(), and ~CkMigratable().

Definition at line 120 of file ckmigratable.h.

Referenced by commonInit(), CkLocMgr::emigrate(), and ~CkMigratable().

Definition at line 125 of file ckmigratable.h.

Referenced by AsyncEvacuate(), isAsyncEvacuate(), and pup().


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

Generated on Mon Sep 21 08:20:50 2020 for Charm++ by  doxygen 1.5.5