TCharm Class Reference

#include <tcharm_impl.h>

Inheritance diagram for TCharm:

Inheritance graph
[legend]
Collaboration diagram for TCharm:

Collaboration graph
[legend]

Public Member Functions

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".
 TCharm (TCharmInitMsg *initMsg)
 TCharm (CkMigrateMessage *)
 ~TCharm ()
virtual void ckJustMigrated (void)
virtual void ckJustRestored (void)
virtual void ckAboutToMigrate (void)
void migrateDelayed (int destPE)
void atBarrier (CkReductionMsg *)
void atExit (CkReductionMsg *)
void clear ()
virtual void pup (PUP::er &p)
void run (void)
double getTimeOffset (void) const
void barrier (void)
void migrateTo (int destPE)
void evacuate ()
void done (void)
int add (const UserData &d)
void * lookupUserData (int ud)
CthThread getThread (void)
const CProxy_TCharm & getProxy (void) const
int getElement (void) const
int getNumElements (void) const
void stopTiming (void)
void startTiming (void)
void schedule (void)
void stop (void)
void start (void)
void suspend (void)
void resume (void)
void migrate (void)
void async_migrate (void)
void allow_migrate (void)
int system (const char *cmd)
 System() call emulation:.
void callSystem (const callSystemStruct &s)
CthThread getTid ()

Static Public Member Functions

static void nodeInit (void)
static void procInit (void)
static TCharmget (void)
static TCharmgetNULL (void)
static void activateThread (void)
static void deactivateThread (void)
static void activateVariable (const void *ptr)
static void deactivateVariable (const void *ptr)

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 (void)

Private Attributes

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

Friends

class TCharmAPIRoutine

Data Structures

class  TCharmSemaphore
class  ThreadInfo
class  UserData

Detailed Description

Definition at line 68 of file tcharm_impl.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
maxUserData 

Definition at line 153 of file tcharm_impl.h.


Constructor & Destructor Documentation

TCharm::TCharm ( TCharmInitMsg initMsg  ) 

TCharm::TCharm ( CkMigrateMessage msg  ) 

Definition at line 185 of file tcharm.C.

References CmiTrue, heapBlocks, initMsg, threadGlobals, and tid.

TCharm::~TCharm (  ) 


Member Function Documentation

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

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

Definition at line 983 of file tcharm.C.

References s, and sema.

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

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

Block until this semaphore has data:.

Definition at line 1003 of file tcharm.C.

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

Referenced by semaGet(), and semaGets().

void TCharm::freeSema ( TCharmSemaphore doomed  ) 

Remove this semaphore from the list.

Definition at line 991 of file tcharm.C.

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

Referenced by semaGet().

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 1018 of file tcharm.C.

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

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

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 1049 of file tcharm.C.

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

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 1043 of file tcharm.C.

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

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 1032 of file tcharm.C.

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

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

void TCharm::nodeInit ( void   )  [static]

Definition at line 63 of file tcharm.C.

void TCharm::procInit ( void   )  [static]

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

void TCharm::ResumeFromSync ( void   )  [private]

Definition at line 551 of file tcharm.C.

References skipResume, and start().

void TCharm::ckJustMigrated ( void   )  [virtual]

Definition at line 369 of file tcharm.C.

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

void TCharm::ckJustRestored ( void   )  [virtual]

Definition at line 380 of file tcharm.C.

References ArrayElement::ckJustRestored().

void TCharm::ckAboutToMigrate ( void   )  [virtual]

Definition at line 394 of file tcharm.C.

References ArrayElement::ckAboutToMigrate(), isStopped, and resumeAfterMigration.

void TCharm::migrateDelayed ( int  destPE  ) 

Definition at line 366 of file tcharm.C.

void TCharm::atBarrier ( CkReductionMsg m  ) 

Definition at line 598 of file tcharm.C.

void TCharm::atExit ( CkReductionMsg m  ) 

Definition at line 617 of file tcharm.C.

References CkExit().

void TCharm::clear ( void   ) 

Definition at line 402 of file tcharm.C.

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

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

void TCharm::run ( void   ) 

Definition at line 425 of file tcharm.C.

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

Referenced by TCharm().

double TCharm::getTimeOffset ( void   )  const [inline]

Definition at line 179 of file tcharm_impl.h.

References timeOffset.

Referenced by FORTRAN_AS_C().

void TCharm::barrier ( void   ) 

Definition at line 582 of file tcharm.C.

References stop(), and CkReduction::sum_int.

Referenced by FORTRAN_AS_C().

void TCharm::migrateTo ( int  destPE  ) 

Definition at line 359 of file tcharm.C.

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

Referenced by allow_migrate(), and FORTRAN_AS_C().

void TCharm::evacuate (  ) 

Definition at line 502 of file tcharm.C.

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

Referenced by TCHARM_Evacuate().

void TCharm::done ( void   ) 

Definition at line 605 of file tcharm.C.

References exitWhenDone, isSelfDone, stop(), and CkReduction::sum_int.

Referenced by FORTRAN_AS_C().

int TCharm::add ( const UserData d  ) 

Definition at line 410 of file tcharm.C.

References maxUserData, nUd, and ud.

Referenced by FTN_NAME(), and TCHARM_Register().

void * TCharm::lookupUserData ( int  ud  ) 

Definition at line 418 of file tcharm.C.

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

Referenced by TCHARM_Get_userdata().

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

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

Definition at line 204 of file tcharm_impl.h.

Referenced by FORTRAN_AS_C(), and get().

CthThread TCharm::getThread ( void   )  [inline]

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

int TCharm::getElement ( void   )  const [inline]

int TCharm::getNumElements ( void   )  const [inline]

void TCharm::stopTiming ( void   )  [inline]

Definition at line 211 of file tcharm_impl.h.

Referenced by stop().

void TCharm::startTiming ( void   )  [inline]

Definition at line 212 of file tcharm_impl.h.

Referenced by stop().

void TCharm::schedule ( void   ) 

Definition at line 482 of file tcharm.C.

References start(), and stop().

Referenced by async_migrate(), FORTRAN_AS_C(), ampi::iprobe(), and ampi::yield().

void TCharm::stop ( void   ) 

void TCharm::start ( void   ) 

Definition at line 466 of file tcharm.C.

References CthAwaken(), isStopped, and tid.

Referenced by resume(), ResumeFromSync(), run(), schedule(), and ampi::setInitDoneFlag().

void TCharm::suspend ( void   )  [inline]

void TCharm::resume ( void   )  [inline]

void TCharm::migrate ( void   ) 

Definition at line 489 of file tcharm.C.

References stop().

Referenced by MBLK_Migrate(), and TCHARM_Migrate().

void TCharm::async_migrate ( void   ) 

Definition at line 519 of file tcharm.C.

References schedule(), and skipResume.

Referenced by FORTRAN_AS_C().

void TCharm::allow_migrate ( void   ) 

Definition at line 537 of file tcharm.C.

References migrateTo().

Referenced by FORTRAN_AS_C().

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

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

static void TCharm::activateVariable ( const void *  ptr  )  [inline, static]

Definition at line 252 of file tcharm_impl.h.

References CtgInstall_var(), and threadGlobals.

Referenced by copyDatatype(), ampi::makeAmpiMsg(), makeRednMsg(), and ampi::processMessage().

static void TCharm::deactivateVariable ( const void *  ptr  )  [inline, static]

int TCharm::system ( const char *  cmd  ) 

System() call emulation:.

Definition at line 1070 of file tcharm.C.

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

Referenced by callSystem(), and TCHARM_System().

void TCharm::callSystem ( const callSystemStruct s  ) 

Definition at line 1081 of file tcharm.C.

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

CthThread TCharm::getTid (  )  [inline]

Definition at line 271 of file tcharm_impl.h.

References tid.


Friends And Related Function Documentation

friend class TCharmAPIRoutine [friend]

Definition at line 140 of file tcharm_impl.h.


Field Documentation

Short, unordered list of waiting semaphores.

Definition at line 105 of file tcharm_impl.h.

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

Definition at line 138 of file tcharm_impl.h.

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

Definition at line 139 of file tcharm_impl.h.

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

Definition at line 148 of file tcharm_impl.h.

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

Definition at line 148 of file tcharm_impl.h.

Referenced by ckAboutToMigrate(), ckJustMigrated(), pup(), and TCharm().

Definition at line 148 of file tcharm_impl.h.

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

Definition at line 148 of file tcharm_impl.h.

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

Definition at line 148 of file tcharm_impl.h.

Referenced by async_migrate(), pup(), ResumeFromSync(), and TCharm().

Definition at line 149 of file tcharm_impl.h.

double TCharm::timeOffset [private]

Definition at line 150 of file tcharm_impl.h.

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

int TCharm::nUd [private]

Definition at line 154 of file tcharm_impl.h.

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

UserData TCharm::ud[maxUserData] [private]

Definition at line 155 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 Nov 23 08:00:25 2009 for Charm++ by  doxygen 1.5.5