#include <CkLoop.h>
Public Member Functions | |
FuncCkLoop (int mode_, int numThreads_) | |
FuncCkLoop (CkMigrateMessage *m) | |
~FuncCkLoop () | |
void | registerHelper (HelperNotifyMsg *msg) |
void | createPThreads () |
void | exit () |
void | init (int mode_, int numThreads_) |
int | getNumHelpers () |
CkLoop_sched | getSchedPolicy () |
void | setSchedPolicy (CkLoop_sched schedPolicy) |
void | parallelizeFunc (HelperFn func, int paramNum, void *param, int numChunks, int lowerRange, int upperRange, int sync=1, void *redResult=NULL, REDUCTION_TYPE type=CKLOOP_NONE, CallerFn cfunc=NULL, int cparamNum=0, void *cparam=NULL) |
void | parallelizeFuncHybrid (float sf, HelperFn func, int paramNum, void *param, int numChunks, int lowerRange, int upperRange, int sync=1, void *redResult=NULL, REDUCTION_TYPE type=CKLOOP_NONE, CallerFn cfunc=NULL, int cparamNum=0, void *cparam=NULL) |
void | destroyHelpers () |
void | reduce (void **redBufs, void *redBuf, REDUCTION_TYPE type, int numChunks) |
void | pup (PUP::er &p) |
Static Public Attributes | |
static int | MAX_CHUNKS = 64 |
Private Attributes | |
int | mode |
int | numHelpers |
FuncSingleHelper ** | helperPtr |
CkLoop_sched | schedPolicy |
Friends | |
class | FuncSingleHelper |
Definition at line 228 of file CkLoop.h.
FuncCkLoop::FuncCkLoop | ( | CkMigrateMessage * | m | ) |
FuncCkLoop::~FuncCkLoop | ( | ) | [inline] |
Definition at line 245 of file CkLoop.h.
References BGConverse::CkMyNodeSize(), CmiDestroyLock(), CmiFree(), helperPtr, and loop_info_inited_lock.
void FuncCkLoop::registerHelper | ( | HelperNotifyMsg * | msg | ) |
Definition at line 540 of file CkLoop.C.
References helperPtr, HelperNotifyMsg::localHelper, HelperNotifyMsg::srcRank, and FuncSingleHelper::thisCkLoop.
void FuncCkLoop::createPThreads | ( | ) |
Definition at line 101 of file CkLoop.C.
References allConds, allLocks, attr, CmiNumCores(), CmiOnCore(), gCrtCnt, mainHelperPhyRank, malloc(), ndhThreads, ndhThreadWork(), numHelpers, and numPhysicalPEs.
Referenced by init().
void FuncCkLoop::exit | ( | ) |
Definition at line 123 of file CkLoop.C.
References allConds, allLocks, exitFlag, free(), mode, ndhThreads, and numHelpers.
Definition at line 152 of file CkLoop.C.
References CKLOOP_LIST, CKLOOP_NODE_QUEUE, CKLOOP_TREE, BGConverse::CkMyNode(), BGConverse::CkMyNodeSize(), BGConverse::CkNodeFirst(), CmiCreateLock(), createPThreads(), helperPtr, loop_info_inited_lock, MAX_CHUNKS, mode, numHelpers, schedPolicy, and traceRegisterUserEvent().
Referenced by FuncCkLoop(), and pup().
int FuncCkLoop::getNumHelpers | ( | ) | [inline] |
Definition at line 265 of file CkLoop.h.
References numHelpers.
Referenced by ndhThreadWork().
CkLoop_sched FuncCkLoop::getSchedPolicy | ( | ) | [inline] |
Definition at line 268 of file CkLoop.h.
References schedPolicy.
Referenced by ndhThreadWork(), and RegisterCkLoopHdlrs().
void FuncCkLoop::setSchedPolicy | ( | CkLoop_sched | schedPolicy | ) | [inline] |
Definition at line 271 of file CkLoop.h.
References CKLOOP_NODE_QUEUE.
Referenced by RegisterCkLoopHdlrs().
void FuncCkLoop::parallelizeFunc | ( | HelperFn | func, | |
int | paramNum, | |||
void * | param, | |||
int | numChunks, | |||
int | lowerRange, | |||
int | upperRange, | |||
int | sync = 1 , |
|||
void * | redResult = NULL , |
|||
REDUCTION_TYPE | type = CKLOOP_NONE , |
|||
CallerFn | cfunc = NULL , |
|||
int | cparamNum = 0 , |
|||
void * | cparam = NULL | |||
) |
Definition at line 202 of file CkLoop.C.
References allConds, allLocks, CKLOOP_NODE_QUEUE, CKLOOP_NONE, CKLOOP_TREE, BGConverse::CkMyNodeSize(), BGConverse::CkMyRank(), CmiMyRank(), CmiPushNode(), CmiPushPE(), converseNotifyMsg::eventID, envelope::getEvent(), FuncSingleHelper::getNewTask(), FuncSingleHelper::getNotifyMsg(), CurLoopInfo::getRedBufs(), helperPtr, MAX_CHUNKS, mode, NODE_Q, FuncSingleHelper::notifyMsg, numHelpers, PE_Q, CharmNotifyMsg::ptr, converseNotifyMsg::ptr, converseNotifyMsg::queueID, reduce(), schedPolicy, CurLoopInfo::set(), envelope::setObjPtr(), converseNotifyMsg::srcRank, CurLoopInfo::stealWork(), FuncSingleHelper::taskBuffer, UsrToEnv(), and CurLoopInfo::waitLoopDone().
Referenced by RegisterCkLoopHdlrs().
void FuncCkLoop::parallelizeFuncHybrid | ( | float | sf, | |
HelperFn | func, | |||
int | paramNum, | |||
void * | param, | |||
int | numChunks, | |||
int | lowerRange, | |||
int | upperRange, | |||
int | sync = 1 , |
|||
void * | redResult = NULL , |
|||
REDUCTION_TYPE | type = CKLOOP_NONE , |
|||
CallerFn | cfunc = NULL , |
|||
int | cparamNum = 0 , |
|||
void * | cparam = NULL | |||
) |
Definition at line 381 of file CkLoop.C.
References CKLOOP_DOUBLE_MAX, CKLOOP_DOUBLE_SUM, CKLOOP_FLOAT_SUM, CKLOOP_INT_SUM, CKLOOP_NONE, CmiHandleMessage(), CmiPushPE(), CurLoopInfo::doWorkForMyPe(), CurLoopInfo::getRedBufs(), loopChunkMsg::loopRec, MAX_CHUNKS, msg, numHelpers, reduce(), CurLoopInfo::set(), CurLoopInfo::setReductionType(), CurLoopInfo::setStaticFraction(), TaskQueuePop(), values, and CurLoopInfo::waitLoopDoneHybrid().
Referenced by RegisterCkLoopHdlrs().
void FuncCkLoop::destroyHelpers | ( | ) |
Definition at line 495 of file CkLoop.C.
References _charmHandlerIdx, Converse::CkMyPe(), CmiMyRank(), CmiPushPE(), ForChareMsg, numHelpers, envelope::setEpIdx(), envelope::setMsgtype(), envelope::setSrcPe(), and UsrToEnv().
Referenced by RegisterCkLoopHdlrs().
void FuncCkLoop::reduce | ( | void ** | redBufs, | |
void * | redBuf, | |||
REDUCTION_TYPE | type, | |||
int | numChunks | |||
) |
Definition at line 509 of file CkLoop.C.
References CKLOOP_DOUBLE_MAX, CKLOOP_DOUBLE_SUM, CKLOOP_FLOAT_SUM, and CKLOOP_INT_SUM.
Referenced by parallelizeFunc(), and parallelizeFuncHybrid().
void FuncCkLoop::pup | ( | PUP::er & | p | ) |
Definition at line 546 of file CkLoop.C.
References init(), PUP::er::isUnpacking(), mode, and numHelpers.
friend class FuncSingleHelper [friend] |
int FuncCkLoop::MAX_CHUNKS = 64 [static] |
Definition at line 232 of file CkLoop.h.
Referenced by init(), parallelizeFunc(), parallelizeFuncHybrid(), and RegisterCkLoopHdlrs().
int FuncCkLoop::mode [private] |
int FuncCkLoop::numHelpers [private] |
Definition at line 236 of file CkLoop.h.
Referenced by createPThreads(), destroyHelpers(), exit(), getNumHelpers(), init(), parallelizeFunc(), parallelizeFuncHybrid(), pup(), and RegisterCkLoopHdlrs().
FuncSingleHelper** FuncCkLoop::helperPtr [private] |
Definition at line 237 of file CkLoop.h.
Referenced by init(), parallelizeFunc(), RegisterCkLoopHdlrs(), registerHelper(), and ~FuncCkLoop().
CkLoop_sched FuncCkLoop::schedPolicy [private] |
Definition at line 238 of file CkLoop.h.
Referenced by getSchedPolicy(), init(), parallelizeFunc(), and RegisterCkLoopHdlrs().