PPL Logo

libs/ck-libs/ckloop/CkLoop.C File Reference

Go to the source code of this file.

Functions

void CmiPushNode (void *msg)
static int HelperOnCore ()
static void * ndhThreadWork (void *id)
 CpvStaticDeclare (int, chunkHandler)
 CpvStaticDeclare (int, hybridHandler)
 CpvStaticDeclare (int, NdhStealWorkHandler)
static void RegisterCkLoopHdlrs ()

Variables

static CMK_THREADLOCAL
pthread_cond_t 
thdCondition
static CMK_THREADLOCAL
pthread_mutex_t 
thdLock
static FuncCkLoopmainHelper = NULL
static int mainHelperPhyRank = 0
static int numPhysicalPEs = 0
static CurLoopInfopthdLoop = NULL
static pthread_mutex_t ** allLocks = NULL
static pthread_cond_t ** allConds = NULL
static pthread_t * ndhThreads = NULL
static volatile int gCrtCnt = 0
static volatile int exitFlag = 0
static FuncCkLoopglobalCkLoop = NULL
static int _ckloopEP


Function Documentation

void CmiPushNode ( void *  msg  ) 

Definition at line 497 of file machine-common-core.C.

References _Cmi_sleepOnIdle, CmiIdleLock_addMessage(), CmiLock(), CmiPushImmediateMsg(), CmiUnlock(), CmiStateStruct::idle, and MPMCQueuePush().

Referenced by handleOneRecvedMsg(), FuncCkLoop::parallelizeFunc(), and processNodeBcastMsg().

Here is the call graph for this function:

Here is the caller graph for this function:

static int HelperOnCore (  )  [static]

Definition at line 41 of file CkLoop.C.

References xi::fname.

static void* ndhThreadWork ( void *  id  )  [static]

Definition at line 57 of file CkLoop.C.

References allConds, allLocks, CKLOOP_TREE, CmiSetCPUAffinity(), exitFlag, gCrtCnt, FuncCkLoop::getNumHelpers(), FuncCkLoop::getSchedPolicy(), mainHelperPhyRank, numPhysicalPEs, size_t, CurLoopInfo::stealWork(), thdCondition, and thdLock.

Referenced by FuncCkLoop::createPThreads().

Here is the call graph for this function:

Here is the caller graph for this function:

CpvStaticDeclare ( int  ,
chunkHandler   
)

CpvStaticDeclare ( int  ,
hybridHandler   
)

CpvStaticDeclare ( int  ,
NdhStealWorkHandler   
)

static void RegisterCkLoopHdlrs (  )  [static]

Author: Vivek Kale Contributors: Harshitha Menon, Karthik Senthil Kumar

The CkLoop_Hybrid library is a mode of CkLoop that incorporates specific adaptive scheduling strategies aimed at providing a tradeoff between dynamic load balance and spatial locality. It is used in a build of Charm++ where all chares are placed on core 0 of each node (called the drone-mode, or all-drones-mode). It incorporates a strategy called staggered static-dynamic scheduling (from dissertation work of Vivek Kale). The iteration space is first tentatively divided approximately equally to all available PEs. Each PE's share of the iteration space is divided into a static portion, specified by the staticFraction parameter below, and the remaining dynamic portion. The dynamic portion of a PE is divided into chunks of specified chunksize, and enqueued in the task-queue associated with that PE. Each PE works on its static portion, and then on its own task queue (thus preserving spatial locality, as well as persistence of allocations across outer iterations), and after finishing that, steals work from other PE’s task queues.

CkLoop_Hybrid support requires the SMP mode of Charm++ and the additional flags --enable-drone-mode and --enable-task-queue to be passed as build options when Charm++ is built.

Definition at line 556 of file CkLoop.C.

References _charmHandlerIdx, _ckloopEP, envelope::alloc(), BGConverse::BgNodeRank(), CurLoopInfo::chunkSize, CkLoop_DestroyHelpers(), CkLoop_Exit(), CkLoop_Init(), CKLOOP_NODE_QUEUE, CkLoop_Parallelize(), CkLoop_ParallelizeHybrid(), CkLoop_SetSchedPolicy(), CKLOOP_TREE, BGConverse::CkMyNode(), Converse::CkMyPe(), BGConverse::CkMyRank(), BGConverse::CkNodeFirst(), CkRegisterChare(), CkRegisterChareInCharm(), CkRegisterEp(), CkRegisterMsg(), CmiLock(), CmiMyRank(), CmiPushPE(), CmiRegisterHandler(), CmiUnlock(), FuncSingleHelper::createNotifyMsg(), FuncCkLoop::destroyHelpers(), CurLoopInfo::doWorkForMyPe(), loopChunkMsg::endIndex, converseNotifyMsg::eventID, executeChunk(), CurLoopInfo::fnPtr, ForChareMsg, FuncSingleHelper::funcckproxy, FuncSingleHelper::FuncSingleHelper(), CurLoopInfo::getNextChunkIdx(), FuncSingleHelper::getNotifyMsg(), FuncCkLoop::getSchedPolicy(), FuncCkLoop::helperPtr, hybridHandlerFunc(), CurLoopInfo::inited, int, CurLoopInfo::isFree(), CurLoopInfo::localReduce(), loop_info_inited_lock, loopChunkMsg::loopRec, CurLoopInfo::lowerIndex, malloc(), FuncCkLoop::MAX_CHUNKS, memory_order_release, msg, FuncSingleHelper::nextFreeNotifyMsg, FuncSingleHelper::nextFreeTaskBuffer, NODE_Q, FuncSingleHelper::notifyMsg, FuncSingleHelper::notifyMsgBufSize, CurLoopInfo::numChunks, FuncCkLoop::numHelpers, FuncCkLoop::parallelizeFunc(), FuncCkLoop::parallelizeFuncHybrid(), CurLoopInfo::param, CurLoopInfo::paramNum, PE_Q, CharmNotifyMsg::ptr, converseNotifyMsg::ptr, converseNotifyMsg::queueID, CurLoopInfo::redBufs, CurLoopInfo::reportFinished(), CurLoopInfo::runChunk(), FuncCkLoop::schedPolicy, FuncSingleHelper::schedPolicy, envelope::setEpIdx(), envelope::setMsgtype(), envelope::setObjPtr(), FuncCkLoop::setSchedPolicy(), envelope::setSrcPe(), SingleHelperStealWork(), srcRank, CharmNotifyMsg::srcRank, converseNotifyMsg::srcRank, loopChunkMsg::startIndex, CurLoopInfo::staticFraction, CurLoopInfo::stealWork(), FuncSingleHelper::stealWork(), FuncSingleHelper::taskBuffer, FuncSingleHelper::thisCkLoop, FuncSingleHelper::totalHelpers, CurLoopInfo::type, TypeInvalid, CurLoopInfo::upperIndex, UsrToEnv(), and x.

Here is the call graph for this function:


Variable Documentation

CMK_THREADLOCAL pthread_cond_t thdCondition [static]

Definition at line 21 of file CkLoop.C.

Referenced by ndhThreadWork().

CMK_THREADLOCAL pthread_mutex_t thdLock [static]

Definition at line 22 of file CkLoop.C.

Referenced by ndhThreadWork().

FuncCkLoop* mainHelper = NULL [static]

Definition at line 25 of file CkLoop.C.

int mainHelperPhyRank = 0 [static]

Definition at line 26 of file CkLoop.C.

Referenced by FuncCkLoop::createPThreads(), and ndhThreadWork().

int numPhysicalPEs = 0 [static]

Definition at line 27 of file CkLoop.C.

Referenced by FuncCkLoop::createPThreads(), and ndhThreadWork().

CurLoopInfo* pthdLoop = NULL [static]

Definition at line 28 of file CkLoop.C.

pthread_mutex_t** allLocks = NULL [static]

pthread_cond_t** allConds = NULL [static]

pthread_t* ndhThreads = NULL [static]

Definition at line 32 of file CkLoop.C.

Referenced by FuncCkLoop::createPThreads(), and FuncCkLoop::exit().

volatile int gCrtCnt = 0 [static]

Definition at line 34 of file CkLoop.C.

Referenced by FuncCkLoop::createPThreads(), and ndhThreadWork().

volatile int exitFlag = 0 [static]

Definition at line 35 of file CkLoop.C.

Referenced by FuncCkLoop::exit(), and ndhThreadWork().

FuncCkLoop* globalCkLoop = NULL [static]

Definition at line 146 of file CkLoop.C.

int _ckloopEP [static]

Definition at line 554 of file CkLoop.C.

Referenced by RegisterCkLoopHdlrs().


Generated on Mon Sep 21 08:06:51 2020 for Charm++ by  doxygen 1.5.5