#include <tcharm_impl.h>


Public Member Functions | |
| TCharmSemaphore * | findSema (int id) |
| Find this semaphore, or insert if there isn't one:. | |
| TCharmSemaphore * | getSema (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 TCharm * | get (void) |
| static TCharm * | getNULL (void) |
| static void | activateThread (void) |
| static void | deactivateThread (void) |
| static void | activateVariable (const void *ptr) |
| static void | deactivateVariable (const void *ptr) |
Data Fields | |
| CkVec< UserData > | sud |
| CkVec< TCharmSemaphore > | sema |
| Short, unordered list of waiting semaphores. | |
Private Types | |
| enum | { maxUserData = 16 } |
Private Member Functions | |
| void | pupThread (PUP::er &p) |
| void | ResumeFromSync (void) |
Private Attributes | |
| TCharmInitMsg * | initMsg |
| CthThread | tid |
| CmiIsomallocBlockList * | heapBlocks |
| 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 |
Definition at line 68 of file tcharm_impl.h.
anonymous enum [private] |
| TCharm::TCharm | ( | TCharmInitMsg * | initMsg | ) |
Definition at line 143 of file tcharm.C.
References BgAttach(), BgUnsetStartOutOfCore(), CmiIsomallocBlockListNew(), CmiMemoryIs(), CmiTrue, CtgCreate(), CthCreate(), CthCreateMigratable(), CthSelf(), TCHARM_Thread_options::exitWhenDone, exitWhenDone, heapBlocks, initMsg, isSelfDone, isStopped, nUd, TCharmInitMsg::numElements, TCharmInitMsg::opts, resumeAfterMigration, run(), TCHARM_Thread_options::sanityCheck(), skipResume, TCHARM_Thread_options::stackSize, startTCharmThread(), tcharm_nothreads, threadGlobals, tid, and timeOffset.
| TCharm::TCharm | ( | CkMigrateMessage * | msg | ) |
Definition at line 185 of file tcharm.C.
References CmiTrue, heapBlocks, initMsg, threadGlobals, and tid.
| TCharm::~TCharm | ( | ) |
Definition at line 348 of file tcharm.C.
References CmiIsomallocBlockListDelete(), CtgFree(), CthFree(), heapBlocks, initMsg, threadGlobals, and tid.
| TCharm::TCharmSemaphore * TCharm::findSema | ( | int | id | ) |
| 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 | ) |
| 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::procInit | ( | void | ) | [static] |
Definition at line 67 of file tcharm.C.
References TCharmTraceLibList::addTracing(), CkGetArgv(), Converse::CkMyPe(), CmiGetArgFlagDesc(), CmiGetArgIntDesc(), CmiGetArgString(), CmiGetArgStringDesc(), CmiPrintf(), CtgInit(), mapping, and tcharm_nothreads.
| void TCharm::pupThread | ( | PUP::er & | p | ) | [private] |
Definition at line 300 of file tcharm.C.
References BgAttach(), checkPupMismatch(), CmiIsomallocBlockListPup(), CmiMemoryIs(), CtgPup(), CthPup(), heapBlocks, PUP::er::isUnpacking(), p, threadGlobals, and tid.
Referenced by pup().
| void TCharm::ResumeFromSync | ( | void | ) | [private] |
| void TCharm::ckJustMigrated | ( | void | ) | [virtual] |
Definition at line 369 of file tcharm.C.
References ArrayElement::ckJustMigrated(), resume(), and resumeAfterMigration.
| void TCharm::ckJustRestored | ( | void | ) | [virtual] |
| void TCharm::ckAboutToMigrate | ( | void | ) | [virtual] |
Definition at line 394 of file tcharm.C.
References ArrayElement::ckAboutToMigrate(), isStopped, and resumeAfterMigration.
| void TCharm::atBarrier | ( | CkReductionMsg * | m | ) |
| void TCharm::atExit | ( | CkReductionMsg * | m | ) |
| 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] |
Definition at line 206 of file tcharm.C.
References activateThread(), BgOutOfCoreFlag, checkPupMismatch(), CmiMemoryIs(), deactivateThread(), PUP::seekBlock::endBlock(), exitWhenDone, isSelfDone, isStopped, PUP::er::isUnpacking(), nUd, p, TCharm::UserData::pup(), ArrayElement::pup(), pupThread(), resumeAfterMigration, s, PUP::seekBlock::seek(), sema, skipResume, sud, tid, timeOffset, and ud.
| 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] |
| 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().
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] |
Definition at line 197 of file tcharm_impl.h.
Referenced by ampiInit(), ARMCI_Init(), COLLIDE_Init(), FEM_REF_INIT(), FORTRAN_AS_C(), FORTRAN_AS_C_RETURN(), FTN_NAME(), MBLK_Init(), MBLK_Migrate(), ParFUM_SA_Init(), REFINE2D_Init(), stop(), TCHARM_Attach_start(), TCHARM_Element(), TCHARM_Evacuate(), TCHARM_Get_global(), TCHARM_Get_threads(), TCHARM_Get_userdata(), TCHARM_Migrate(), TCHARM_Num_elements(), TCHARM_Register(), TCHARM_Set_global(), TCHARM_Suspend(), and TCHARM_System().
| static TCharm* TCharm::getNULL | ( | void | ) | [inline, static] |
| CthThread TCharm::getThread | ( | void | ) | [inline] |
Definition at line 205 of file tcharm_impl.h.
References tid.
Referenced by ampi::getThread(), MBlockChunk::migInit(), ampiParent::prepareCtv(), ampi::recv(), ampi::send(), TCHARM_Set_global(), and TCharmClient1D::tcharmClientInit().
| const CProxy_TCharm& TCharm::getProxy | ( | void | ) | const [inline] |
Definition at line 206 of file tcharm_impl.h.
Referenced by COLLIDE_Init(), FEM_REF_INIT(), ParFUM_SA_Init(), REFINE2D_Init(), ParFUMShadowArray::setFemMesh(), TCHARM_Attach_start(), TCHARM_Get_threads(), and TCHARMLIB_Bound_array().
| int TCharm::getElement | ( | void | ) | const [inline] |
Definition at line 207 of file tcharm_impl.h.
Referenced by FORTRAN_AS_C_RETURN(), TCHARM_Api_trace(), TCHARM_Element(), and TCHARMLIB_Get_rank().
| int TCharm::getNumElements | ( | void | ) | const [inline] |
Definition at line 208 of file tcharm_impl.h.
Referenced by REFINE2D_Init(), ArmciVirtualProcessor::setupThreadPrivate(), TCHARM_Attach_start(), TCHARM_Num_elements(), and TCHARMLIB_Bound_array().
| void TCharm::stopTiming | ( | void | ) | [inline] |
| void TCharm::startTiming | ( | void | ) | [inline] |
| 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 | ) |
Definition at line 436 of file tcharm.C.
References CthSelf(), CthSuspend(), get(), isStopped, startTiming(), stopTiming(), tcharm_nothreads, and tid.
Referenced by ampiInit(), barrier(), done(), migrate(), schedule(), ampiParent::startCheckpoint(), and suspend().
| 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] |
Definition at line 221 of file tcharm_impl.h.
References stop().
Referenced by ArmciVirtualProcessor::barrier(), ampi::block(), ampi::cartCreate(), ampi::commCreate(), threadCollide::contribute(), evacuate(), ArmciVirtualProcessor::get(), ArmciVirtualProcessor::gets(), getSema(), ampi::graphCreate(), ampi::intercommCreate(), ampi::intercommMerge(), migrateTo(), ArmciVirtualProcessor::notify_wait(), ampi::probe(), MBlockChunk::reduce(), REFINE2D_Init(), ArmciVirtualProcessor::requestAddresses(), ampi::split(), ArmciVirtualProcessor::startCheckpoint(), system(), TCHARM_Suspend(), ArmciVirtualProcessor::wait(), and MBlockChunk::wait_update().
| void TCharm::resume | ( | void | ) | [inline] |
Definition at line 222 of file tcharm_impl.h.
References isStopped, and start().
Referenced by callSystem(), ampiParent::cartChildRegister(), chunk::chunk(), ckJustMigrated(), ampi::generic(), ArmciVirtualProcessor::getAddresses(), ampiParent::graphChildRegister(), ampiParent::groupChildRegister(), ampiParent::intraChildRegister(), ArmciVirtualProcessor::putAck(), ArmciVirtualProcessor::putDataFromGet(), ArmciVirtualProcessor::putDataFromGets(), MBlockChunk::recv(), MBlockChunk::reductionResult(), threadCollide::resultsDone(), ArmciVirtualProcessor::resumeThread(), ampiParent::ResumeThread(), semaPut(), ArmciVirtualProcessor::sendNote(), ampi::setRemoteProxy(), ampiParent::splitChildRegister(), and ampi::unblock().
| 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 | ) |
| static void TCharm::activateThread | ( | void | ) | [inline, static] |
Definition at line 238 of file tcharm_impl.h.
References CmiIsomallocBlockListActivate(), CtgInstall(), heapBlocks, and threadGlobals.
Referenced by MBlockChunk::apply_single_bc(), pup(), startTCharmThread(), and TCharmAPIRoutine::~TCharmAPIRoutine().
| static void TCharm::deactivateThread | ( | void | ) | [inline, static] |
Definition at line 248 of file tcharm_impl.h.
References CmiIsomallocBlockListActivate(), and CtgInstall().
Referenced by MBlockChunk::apply_single_bc(), pup(), startTCharmThread(), and TCharmAPIRoutine::TCharmAPIRoutine().
| 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] |
Definition at line 259 of file tcharm_impl.h.
References CtgUninstall_var(), and threadGlobals.
Referenced by copyDatatype(), ampi::makeAmpiMsg(), makeRednMsg(), and ampi::processMessage().
| 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] |
friend class TCharmAPIRoutine [friend] |
Definition at line 140 of file tcharm_impl.h.
Definition at line 92 of file tcharm_impl.h.
Referenced by ParFUMShadowArray::ckJustMigrated(), femMeshModify::ckJustMigrated(), pup(), TCHARM_Get_global(), and TCHARM_Set_global().
Short, unordered list of waiting semaphores.
Definition at line 105 of file tcharm_impl.h.
Referenced by findSema(), freeSema(), and pup().
TCharmInitMsg* TCharm::initMsg [private] |
CthThread TCharm::tid [private] |
Definition at line 139 of file tcharm_impl.h.
Referenced by clear(), getThread(), getTid(), pup(), pupThread(), start(), stop(), TCharm(), and ~TCharm().
CmiIsomallocBlockList* TCharm::heapBlocks [private] |
Definition at line 141 of file tcharm_impl.h.
Referenced by activateThread(), clear(), pupThread(), TCharm(), ~TCharm(), and TCharmAPIRoutine::~TCharmAPIRoutine().
CtgGlobals TCharm::threadGlobals [private] |
Definition at line 142 of file tcharm_impl.h.
Referenced by activateThread(), activateVariable(), deactivateVariable(), pupThread(), TCharm(), ~TCharm(), and TCharmAPIRoutine::~TCharmAPIRoutine().
bool TCharm::isStopped [private] |
Definition at line 148 of file tcharm_impl.h.
Referenced by ckAboutToMigrate(), pup(), resume(), start(), stop(), and TCharm().
bool TCharm::resumeAfterMigration [private] |
Definition at line 148 of file tcharm_impl.h.
Referenced by ckAboutToMigrate(), ckJustMigrated(), pup(), and TCharm().
bool TCharm::exitWhenDone [private] |
bool TCharm::isSelfDone [private] |
bool TCharm::skipResume [private] |
Definition at line 148 of file tcharm_impl.h.
Referenced by async_migrate(), pup(), ResumeFromSync(), and TCharm().
ThreadInfo TCharm::threadInfo [private] |
Definition at line 149 of file tcharm_impl.h.
double TCharm::timeOffset [private] |
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] |
1.5.5