#include <tcharm_impl.h>
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) |
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". | |
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 TCharm * | get () noexcept |
static TCharm * | getNULL () noexcept |
static void | activateThread (void) noexcept |
static void | deactivateThread () noexcept |
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 () |
Private Attributes | |
CthThread | tid |
CmiIsomallocBlockList * | heapBlocks |
CtgGlobals | threadGlobals |
bool | isStopped |
bool | exitWhenDone |
bool | isSelfDone |
bool | asyncMigrate |
ThreadInfo | threadInfo |
TCharmInitMsg * | initMsg |
double | timeOffset |
int | nUd |
UserData | ud [maxUserData] |
Friends | |
class | TCharmAPIRoutine |
Data Structures | |
class | TCharmSemaphore |
class | ThreadInfo |
class | UserData |
Definition at line 82 of file tcharm_impl.h.
anonymous enum [private] |
TCharm::TCharm | ( | TCharmInitMsg * | initMsg | ) |
Definition at line 168 of file tcharm.C.
References asyncMigrate, CmiIsomallocBlockListNew(), CmiMemoryIs(), CtgCreate(), CthCreate(), CthCreateMigratable(), CthSelf(), TCHARM_Thread_options::exitWhenDone, exitWhenDone, heapBlocks, initMsg, isSelfDone, isStopped, nUd, TCharmInitMsg::numElements, TCharm::ThreadInfo::numElements, TCharmInitMsg::opts, run(), TCHARM_Thread_options::sanityCheck(), TCHARM_Thread_options::stackSize, startTCharmThread(), tcharm_nomig, tcharm_nothreads, TCharm::ThreadInfo::thisElement, threadGlobals, threadInfo, tid, timeOffset, and TCharm::ThreadInfo::tProxy.
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.
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().
void TCharm::ResumeFromSync | ( | void | ) | [private] |
void TCharm::ckJustMigrated | ( | void | ) | [virtual] |
Definition at line 415 of file tcharm.C.
References asyncMigrate, ArrayElement::ckJustMigrated(), and resume().
void TCharm::ckJustRestored | ( | void | ) | [virtual] |
Definition at line 423 of file tcharm.C.
References ArrayElement::ckJustRestored().
void TCharm::ckAboutToMigrate | ( | void | ) | [virtual] |
Definition at line 428 of file tcharm.C.
References ArrayElement::ckAboutToMigrate(), and isStopped.
void TCharm::atBarrier | ( | ) |
void TCharm::atExit | ( | CkReductionMsg * | msg | ) |
void TCharm::clear | ( | ) |
Definition at line 434 of file tcharm.C.
References CmiIsomallocBlockListDelete(), CthFree(), heapBlocks, initMsg, and tid.
void TCharm::pup | ( | PUP::er & | p | ) | [virtual] |
Definition at line 243 of file tcharm.C.
References _BgOutOfCoreFlag, activateThread(), asyncMigrate, checkPupMismatch(), CmiMemoryIs(), deactivateThread(), PUP::seekBlock::endBlock(), exitWhenDone, isSelfDone, PUP::er::isSizing(), isStopped, PUP::er::isUnpacking(), nUd, TCharm::ThreadInfo::numElements, p, TCharm::UserData::pup(), pupThread(), PUP::s, PUP::seekBlock::seek(), sema, sud, tcharm_nomig, TCharm::ThreadInfo::thisElement, threadInfo, tid, timeOffset, and ud.
TCharm::TCharmSemaphore * TCharm::findSema | ( | int | id | ) |
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().
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 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().
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.
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.
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().
void TCharm::nodeInit | ( | ) | [static] |
Definition at line 62 of file tcharm.C.
References _isAnytimeMigration, and _isStaticInsertion.
Referenced by ampiNodeInit(), and collideNodeInit().
void TCharm::procInit | ( | ) | [static] |
Definition at line 76 of file tcharm.C.
References TCharmTraceLibList::addTracing(), argv, CkGetArgv(), Converse::CkMyPe(), CmiGetArgFlagDesc(), CmiGetArgIntDesc(), CmiGetArgString(), CmiGetArgStringDesc(), CmiPrintf(), CtgInit(), mapping, tcharm_initted, tcharm_nomig, tcharm_nothreads, and tcharm_stacksize.
void TCharm::run | ( | ) |
Definition at line 457 of file tcharm.C.
References initMsg, start(), startTCharmThread(), and tcharm_nothreads.
Referenced by TCharm().
double TCharm::getTimeOffset | ( | ) | const [inline] |
Definition at line 198 of file tcharm_impl.h.
References timeOffset.
Referenced by FORTRAN_AS_C().
void TCharm::barrier | ( | ) |
Definition at line 547 of file tcharm.C.
References atBarrier(), and stop().
Referenced by FORTRAN_AS_C().
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().
void TCharm::evacuate | ( | ) |
Definition at line 480 of file tcharm.C.
References CcdCallFnAfter(), CkEmmigrateElement(), and suspend().
Referenced by TCHARM_Evacuate().
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().
Definition at line 442 of file tcharm.C.
References PUP::d, maxUserData, nUd, and ud.
Referenced by FTN_NAME(), and TCHARM_Register().
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().
static TCharm* TCharm::get | ( | void | ) | [inline, static] |
Definition at line 218 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] |
Definition at line 225 of file tcharm_impl.h.
Referenced by FORTRAN_AS_C(), and get().
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().
const CProxy_TCharm& TCharm::getProxy | ( | void | ) | const [inline] |
Definition at line 227 of file tcharm_impl.h.
References threadInfo, and TCharm::ThreadInfo::tProxy.
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 | ( | ) | 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().
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().
void TCharm::stopTiming | ( | ) | [inline] |
Definition at line 232 of file tcharm_impl.h.
Referenced by stop().
void TCharm::startTiming | ( | ) | [inline] |
Definition at line 233 of file tcharm_impl.h.
Referenced by stop().
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().
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().
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().
void TCharm::suspend | ( | void | ) | [inline] |
Definition at line 272 of file tcharm_impl.h.
References stop().
Referenced by ArmciVirtualProcessor::barrier(), threadCollide::contribute(), evacuate(), ArmciVirtualProcessor::get(), ArmciVirtualProcessor::gets(), getSema(), migrateTo(), ArmciVirtualProcessor::msgBcast(), ArmciVirtualProcessor::notify_wait(), MBlockChunk::reduce(), REFINE2D_Init(), ArmciVirtualProcessor::requestAddresses(), ArmciVirtualProcessor::startCheckpoint(), system(), TCHARM_Suspend(), ArmciVirtualProcessor::wait(), and MBlockChunk::wait_update().
void TCharm::resume | ( | ) | [inline] |
Definition at line 273 of file tcharm_impl.h.
References isStopped, and start().
Referenced by callSystem(), chunk::chunk(), ckJustMigrated(), ArmciVirtualProcessor::getAddresses(), ArmciVirtualProcessor::putAck(), ArmciVirtualProcessor::putDataFromGet(), ArmciVirtualProcessor::putDataFromGets(), MBlockChunk::recv(), ArmciVirtualProcessor::recvMsgBcast(), MBlockChunk::reductionResult(), threadCollide::resultsDone(), ArmciVirtualProcessor::resumeThread(), semaPut(), and ArmciVirtualProcessor::sendNote().
void TCharm::migrate | ( | ) |
Definition at line 468 of file tcharm.C.
References stop().
Referenced by MBLK_Migrate(), and TCHARM_Migrate().
void TCharm::async_migrate | ( | ) |
Definition at line 490 of file tcharm.C.
References asyncMigrate, and schedule().
Referenced by FORTRAN_AS_C().
void TCharm::allow_migrate | ( | ) |
Definition at line 507 of file tcharm.C.
References migrateTo().
Referenced by FORTRAN_AS_C().
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().
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().
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().
void TCharm::callSystem | ( | const callSystemStruct & | s | ) |
Definition at line 1058 of file tcharm.C.
References callSystemStruct::cmd, resume(), callSystemStruct::ret, and system().
CthThread TCharm::getTid | ( | ) | [inline] |
friend class TCharmAPIRoutine [friend] |
Definition at line 85 of file tcharm_impl.h.
CthThread TCharm::tid [private] |
Definition at line 87 of file tcharm_impl.h.
Referenced by clear(), getThread(), getTid(), pup(), pupThread(), start(), stop(), TCharm(), and ~TCharm().
CmiIsomallocBlockList* TCharm::heapBlocks [private] |
Definition at line 88 of file tcharm_impl.h.
Referenced by activateThread(), clear(), pupThread(), TCharm(), and ~TCharm().
CtgGlobals TCharm::threadGlobals [private] |
Definition at line 90 of file tcharm_impl.h.
Referenced by activateThread(), pupThread(), TCharm(), and ~TCharm().
bool TCharm::isStopped [private] |
Definition at line 96 of file tcharm_impl.h.
Referenced by ckAboutToMigrate(), pup(), resume(), start(), stop(), and TCharm().
bool TCharm::exitWhenDone [private] |
bool TCharm::isSelfDone [private] |
bool TCharm::asyncMigrate [private] |
Definition at line 96 of file tcharm_impl.h.
Referenced by async_migrate(), ckJustMigrated(), migrateTo(), pup(), and TCharm().
ThreadInfo TCharm::threadInfo [private] |
Definition at line 105 of file tcharm_impl.h.
Referenced by getElement(), getNumElements(), getProxy(), pup(), and TCharm().
TCharmInitMsg* TCharm::initMsg [private] |
double TCharm::timeOffset [private] |
Definition at line 130 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 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] |