PPL Logo

TCharm Class Reference

#include <tcharm_impl.h>

Inheritance diagram for TCharm:

Inheritance graph
[legend]
Collaboration diagram for TCharm:

Collaboration graph
[legend]

Public Member Functions

 TCharm (TCharmInitMsg *initMsg)
 TCharm (CkMigrateMessage *)
 ~TCharm ()
virtual void ckJustMigrated ()
virtual void ckJustRestored ()
virtual void ckAboutToMigrate ()
void migrateDelayed (int destPE)
void atBarrier ()
void atExit (CkReductionMsg *msg) noexcept
void clear ()
virtual void pup (PUP::er &p)
TCharmSemaphorefindSema (int id)
 Find this semaphore, or insert if there isn't one:.
TCharmSemaphoregetSema (int id)
 Block until this semaphore has data:.
void freeSema (TCharmSemaphore *)
 Remove this semaphore from the list.
void semaPut (int id, void *data)
 Store data at the semaphore "id".
void * semaPeek (int id)
 Retreive data from the semaphore "id", returning NULL if not there.
void * semaGets (int id)
 Retreive data from the semaphore "id".
void * semaGet (int id)
 Retreive data from the semaphore "id".
void run () noexcept
double getTimeOffset () const noexcept
void barrier () noexcept
void migrateTo (int destPE) noexcept
void evacuate () noexcept
void done (int exitcode) noexcept
int add (const UserData &d) noexcept
void * lookupUserData (int ud) noexcept
CthThread getThread () noexcept
const CProxy_TCharm & getProxy () const noexcept
int getElement () const noexcept
int getNumElements () const noexcept
void stopTiming () noexcept
void startTiming () noexcept
void schedule () noexcept
void stop () noexcept
void start () noexcept
void suspend () noexcept
void resume () noexcept
void migrate () noexcept
void async_migrate () noexcept
void allow_migrate ()
int system (const char *cmd)
 System() call emulation:.
void callSystem (const callSystemStruct &s)
CthThread getTid ()

Static Public Member Functions

static void nodeInit ()
static void procInit ()
static TCharmget () noexcept
static TCharmgetNULL () noexcept
static void activateThread (void) noexcept
static void deactivateThread () noexcept

Data Fields

CkVec< UserDatasud
CkVec< TCharmSemaphoresema
 Short, unordered list of waiting semaphores.

Private Types

enum  { maxUserData = 16 }

Private Member Functions

void pupThread (PUP::er &p)
void ResumeFromSync ()

Private Attributes

CthThread tid
CmiIsomallocBlockListheapBlocks
CtgGlobals threadGlobals
bool isStopped
bool exitWhenDone
bool isSelfDone
bool asyncMigrate
ThreadInfo threadInfo
TCharmInitMsginitMsg
double timeOffset
int nUd
UserData ud [maxUserData]

Friends

class TCharmAPIRoutine

Data Structures

class  TCharmSemaphore
class  ThreadInfo
class  UserData

Detailed Description

Definition at line 82 of file tcharm_impl.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
maxUserData 

Definition at line 147 of file tcharm_impl.h.


Constructor & Destructor Documentation

TCharm::TCharm ( TCharmInitMsg initMsg  ) 

TCharm::TCharm ( CkMigrateMessage msg  ) 

Definition at line 217 of file tcharm.C.

References heapBlocks, initMsg, threadGlobals, threadInfo, tid, and TCharm::ThreadInfo::tProxy.

TCharm::~TCharm (  ) 

Definition at line 386 of file tcharm.C.

References CmiIsomallocBlockListDelete(), CtgFree(), CthFree(), heapBlocks, initMsg, threadGlobals, and tid.

Here is the call graph for this function:


Member Function Documentation

void TCharm::pupThread ( PUP::er p  )  [private]

Definition at line 334 of file tcharm.C.

References checkPupMismatch(), CmiIsomallocBlockListPup(), CmiMemoryIs(), CtgPup(), CthPup(), heapBlocks, PUP::er::isUnpacking(), p, threadGlobals, and tid.

Referenced by pup().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::ResumeFromSync ( void   )  [private]

Definition at line 520 of file tcharm.C.

References start().

Here is the call graph for this function:

void TCharm::ckJustMigrated ( void   )  [virtual]

Definition at line 415 of file tcharm.C.

References asyncMigrate, ArrayElement::ckJustMigrated(), and resume().

Here is the call graph for this function:

void TCharm::ckJustRestored ( void   )  [virtual]

Definition at line 423 of file tcharm.C.

References ArrayElement::ckJustRestored().

Here is the call graph for this function:

void TCharm::ckAboutToMigrate ( void   )  [virtual]

Definition at line 428 of file tcharm.C.

References ArrayElement::ckAboutToMigrate(), and isStopped.

Here is the call graph for this function:

void TCharm::migrateDelayed ( int  destPE  ) 

Definition at line 412 of file tcharm.C.

void TCharm::atBarrier (  ) 

Definition at line 562 of file tcharm.C.

Referenced by barrier().

Here is the caller graph for this function:

void TCharm::atExit ( CkReductionMsg msg  ) 

Definition at line 582 of file tcharm.C.

References CkExit(), and msg.

Here is the call graph for this function:

void TCharm::clear (  ) 

Definition at line 434 of file tcharm.C.

References CmiIsomallocBlockListDelete(), CthFree(), heapBlocks, initMsg, and tid.

Here is the call graph for this function:

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

TCharm::TCharmSemaphore * TCharm::findSema ( int  id  ) 

Find this semaphore, or insert if there isn't one:.

Definition at line 960 of file tcharm.C.

References PUP::s, and sema.

Referenced by getSema(), semaPeek(), and semaPut().

Here is the caller graph for this function:

TCharm::TCharmSemaphore * TCharm::getSema ( int  id  ) 

Block until this semaphore has data:.

Definition at line 980 of file tcharm.C.

References CthSelf(), TCharm::TCharmSemaphore::data, findSema(), PUP::s, suspend(), and TCharm::TCharmSemaphore::thread.

Referenced by semaGet(), and semaGets().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::freeSema ( TCharmSemaphore doomed  ) 

Remove this semaphore from the list.

Definition at line 968 of file tcharm.C.

References TCharm::TCharmSemaphore::id, PUP::s, and sema.

Referenced by semaGet().

Here is the caller graph for this function:

void TCharm::semaPut ( int  id,
void *  data 
)

Store data at the semaphore "id".

The put can come before or after the get.

The put can come before or after the get.

Definition at line 995 of file tcharm.C.

References TCharm::TCharmSemaphore::data, findSema(), resume(), PUP::s, and TCharm::TCharmSemaphore::thread.

Referenced by ArmciVirtualProcessor::ArmciVirtualProcessor(), MBlockChunk::MBlockChunk(), and threadCollide::threadCollide().

Here is the call graph for this function:

Here is the caller graph for this function:

void * TCharm::semaPeek ( int  id  ) 

Retreive data from the semaphore "id", returning NULL if not there.

Retreive data from the semaphore "id", or returns NULL.

Definition at line 1026 of file tcharm.C.

References TCharm::TCharmSemaphore::data, findSema(), and PUP::s.

Here is the call graph for this function:

void * TCharm::semaGets ( int  id  ) 

Retreive data from the semaphore "id".

Blocks if the data is not immediately available.

Blocks if the data is not immediately available.

Definition at line 1020 of file tcharm.C.

References TCharm::TCharmSemaphore::data, getSema(), and PUP::s.

Here is the call graph for this function:

void * TCharm::semaGet ( int  id  ) 

Retreive data from the semaphore "id".

Blocks if the data is not immediately available. Consumes the data, so another put will be required for the next get.

Blocks if the data is not immediately available. Consumes the data, so another put will be required for the next get.

Definition at line 1009 of file tcharm.C.

References TCharm::TCharmSemaphore::data, freeSema(), getSema(), and PUP::s.

Referenced by ampiInit(), ARMCI_Init(), COLLIDE_Init(), and MBLK_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::nodeInit (  )  [static]

Definition at line 62 of file tcharm.C.

References _isAnytimeMigration, and _isStaticInsertion.

Referenced by ampiNodeInit(), and collideNodeInit().

Here is the caller graph for this function:

void TCharm::procInit (  )  [static]

void TCharm::run (  ) 

Definition at line 457 of file tcharm.C.

References initMsg, start(), startTCharmThread(), and tcharm_nothreads.

Referenced by TCharm().

Here is the call graph for this function:

Here is the caller graph for this function:

double TCharm::getTimeOffset (  )  const [inline]

Definition at line 198 of file tcharm_impl.h.

References timeOffset.

Referenced by FORTRAN_AS_C().

Here is the caller graph for this function:

void TCharm::barrier (  ) 

Definition at line 547 of file tcharm.C.

References atBarrier(), and stop().

Referenced by FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::migrateTo ( int  destPE  ) 

Definition at line 401 of file tcharm.C.

References asyncMigrate, Converse::CkMyPe(), CthMigratable(), and suspend().

Referenced by allow_migrate(), and FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::evacuate (  ) 

Definition at line 480 of file tcharm.C.

References CcdCallFnAfter(), CkEmmigrateElement(), and suspend().

Referenced by TCHARM_Evacuate().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::done ( int  exitcode  ) 

Definition at line 568 of file tcharm.C.

References CkReductionMsg::buildNew(), cb, exitWhenDone, isSelfDone, CkReduction::max_int, CkReductionMsg::setCallback(), and stop().

Referenced by FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

int TCharm::add ( const UserData d  ) 

Definition at line 442 of file tcharm.C.

References PUP::d, maxUserData, nUd, and ud.

Referenced by FTN_NAME(), and TCHARM_Register().

Here is the caller graph for this function:

void * TCharm::lookupUserData ( int  ud  ) 

Definition at line 450 of file tcharm.C.

References TCharm::UserData::getData(), nUd, and ud.

Referenced by TCHARM_Get_userdata().

Here is the call graph for this function:

Here is the caller graph for this function:

static TCharm* TCharm::get ( void   )  [inline, static]

static TCharm* TCharm::getNULL ( void   )  [inline, static]

Definition at line 225 of file tcharm_impl.h.

Referenced by FORTRAN_AS_C(), and get().

Here is the caller graph for this function:

CthThread TCharm::getThread (  )  [inline]

Definition at line 226 of file tcharm_impl.h.

References tid.

Referenced by MBlockChunk::migInit(), TCHARM_Set_global(), and TCharmClient1D::tcharmClientInit().

Here is the caller graph for this function:

const CProxy_TCharm& TCharm::getProxy ( void   )  const [inline]

int TCharm::getElement (  )  const [inline]

Definition at line 228 of file tcharm_impl.h.

References TCharm::ThreadInfo::thisElement, and threadInfo.

Referenced by FORTRAN_AS_C_RETURN(), TCHARM_Api_trace(), TCHARM_Element(), and TCHARMLIB_Get_rank().

Here is the caller graph for this function:

int TCharm::getNumElements (  )  const [inline]

Definition at line 229 of file tcharm_impl.h.

References TCharm::ThreadInfo::numElements, and threadInfo.

Referenced by REFINE2D_Init(), ArmciVirtualProcessor::setupThreadPrivate(), TCHARM_Attach_start(), TCHARM_Num_elements(), and TCHARMLIB_Bound_array().

Here is the caller graph for this function:

void TCharm::stopTiming (  )  [inline]

Definition at line 232 of file tcharm_impl.h.

Referenced by stop().

Here is the caller graph for this function:

void TCharm::startTiming (  )  [inline]

Definition at line 233 of file tcharm_impl.h.

Referenced by stop().

Here is the caller graph for this function:

void TCharm::schedule (  )  [inline]

Definition at line 236 of file tcharm_impl.h.

References start(), and stop().

Referenced by async_migrate(), and FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::stop ( void   )  [inline]

Definition at line 244 of file tcharm_impl.h.

References CthSelf(), CthSuspend(), get(), isStopped, startTiming(), stopTiming(), and tid.

Referenced by barrier(), done(), migrate(), schedule(), and suspend().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::start (  )  [inline]

Definition at line 265 of file tcharm_impl.h.

References CthAwaken(), isStopped, and tid.

Referenced by resume(), ResumeFromSync(), run(), and schedule().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::suspend ( void   )  [inline]

void TCharm::resume (  )  [inline]

void TCharm::migrate (  ) 

Definition at line 468 of file tcharm.C.

References stop().

Referenced by MBLK_Migrate(), and TCHARM_Migrate().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::async_migrate (  ) 

Definition at line 490 of file tcharm.C.

References asyncMigrate, and schedule().

Referenced by FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::allow_migrate (  ) 

Definition at line 507 of file tcharm.C.

References migrateTo().

Referenced by FORTRAN_AS_C().

Here is the call graph for this function:

Here is the caller graph for this function:

static void TCharm::activateThread ( void   )  [inline, static]

Definition at line 289 of file tcharm_impl.h.

References CmiIsomallocBlockListActivate(), CtgInstall(), heapBlocks, and threadGlobals.

Referenced by MBlockChunk::apply_single_bc(), pup(), and startTCharmThread().

Here is the call graph for this function:

Here is the caller graph for this function:

static void TCharm::deactivateThread (  )  [inline, static]

Definition at line 304 of file tcharm_impl.h.

References CmiIsomallocBlockListActivate(), and CtgInstall().

Referenced by MBlockChunk::apply_single_bc(), pup(), and startTCharmThread().

Here is the call graph for this function:

Here is the caller graph for this function:

int TCharm::system ( const char *  cmd  ) 

System() call emulation:.

Definition at line 1047 of file tcharm.C.

References callSystemStruct::cmd, callSystemStruct::ret, PUP::s, and suspend().

Referenced by callSystem(), and TCHARM_System().

Here is the call graph for this function:

Here is the caller graph for this function:

void TCharm::callSystem ( const callSystemStruct s  ) 

Definition at line 1058 of file tcharm.C.

References callSystemStruct::cmd, resume(), callSystemStruct::ret, and system().

Here is the call graph for this function:

CthThread TCharm::getTid (  )  [inline]

Definition at line 315 of file tcharm_impl.h.

References tid.


Friends And Related Function Documentation

friend class TCharmAPIRoutine [friend]

Definition at line 85 of file tcharm_impl.h.


Field Documentation

Definition at line 87 of file tcharm_impl.h.

Referenced by clear(), getThread(), getTid(), pup(), pupThread(), start(), stop(), TCharm(), and ~TCharm().

Definition at line 88 of file tcharm_impl.h.

Referenced by activateThread(), clear(), pupThread(), TCharm(), and ~TCharm().

Definition at line 90 of file tcharm_impl.h.

Referenced by activateThread(), pupThread(), TCharm(), and ~TCharm().

Definition at line 96 of file tcharm_impl.h.

Referenced by ckAboutToMigrate(), pup(), resume(), start(), stop(), and TCharm().

Definition at line 96 of file tcharm_impl.h.

Referenced by done(), pup(), and TCharm().

Definition at line 96 of file tcharm_impl.h.

Referenced by done(), pup(), and TCharm().

Definition at line 96 of file tcharm_impl.h.

Referenced by async_migrate(), ckJustMigrated(), migrateTo(), pup(), and TCharm().

Definition at line 105 of file tcharm_impl.h.

Referenced by getElement(), getNumElements(), getProxy(), pup(), and TCharm().

Definition at line 107 of file tcharm_impl.h.

Referenced by clear(), run(), TCharm(), and ~TCharm().

double TCharm::timeOffset [private]

Definition at line 108 of file tcharm_impl.h.

Referenced by getTimeOffset(), pup(), and TCharm().

Short, unordered list of waiting semaphores.

Definition at line 143 of file tcharm_impl.h.

Referenced by findSema(), freeSema(), and pup().

int TCharm::nUd [private]

Definition at line 148 of file tcharm_impl.h.

Referenced by add(), lookupUserData(), pup(), and TCharm().

UserData TCharm::ud[maxUserData] [private]

Definition at line 149 of file tcharm_impl.h.

Referenced by add(), lookupUserData(), and pup().


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

Generated on Mon Sep 21 08:30:33 2020 for Charm++ by  doxygen 1.5.5