
|
Converse provides a scheduler for message delivery: methods can be registered to the scheduler, and then messages allocated through CmiAlloc can be sent to the correspondent method in a remote processor. This is done through the converse header (which has few common fields, but is architecture dependent).
In converse the CsdScheduleForever() routine will run an infinite while loop that looks for available messages to process from the unprocessed message queues. The details of the queues and the order in which they are emptied is hidden behind CsdNextMessage(), which is used to dequeue the next message for processing by the converse scheduler. When a message is taken from the queue it is then passed into CmiHandleMessage() which calls the handler associated with the message.
Incoming messages that are destined for Charm++ will be passed to the charm scheduling routines.
Definition at line 13 of file conv-lists.C.
| typedef void* CdsFifo |
Definition at line 16 of file conv-lists.h.
| void CsdBeginIdle | ( | void | ) |
| void CsdStillIdle | ( | void | ) |
| void CsdEndIdle | ( | void | ) |
Definition at line 1573 of file convcore.c.
References CcdRaiseCondition().
Referenced by CsdScheduleCount(), and CsdScheduleForever().
| void CmiHandleMessage | ( | void * | msg | ) |
Takes a message and calls its corresponding handler.
Definition at line 1587 of file convcore.c.
References CmiHandlerInfo::hdlr, and CmiHandlerInfo::userPtr.
Referenced by CldHopHandler(), CldReadytoExec(), CldTokenHandler(), CmiDeliverSpecificMsg(), CmiImmediateMsgHandler(), ComlibNotifyMigrationDone(), CpdDeliverMessageInt(), CpdDeliverSingleMessage(), CpdFreezeModeScheduler(), and handleDebugMessage().
| void CmiDeliversInit | ( | ) |
| CpvDeclare | ( | void * | , | |
| CsdObjQueue | ||||
| ) |
| void CsdSchedulerState_new | ( | CsdSchedulerState_t * | s | ) |
Definition at line 1631 of file convcore.c.
References CsdSchedulerState_t::gridQ, CsdSchedulerState_t::localCounter, CsdSchedulerState_t::localQ, CsdSchedulerState_t::nodeLock, CsdSchedulerState_t::nodeQ, CsdSchedulerState_t::objQ, and CsdSchedulerState_t::schedQ.
Referenced by CpdFreezeModeScheduler().
| void* CsdNextMessage | ( | CsdSchedulerState_t * | s | ) |
Dequeue and return the next message from the unprocessed message queues.
This function encapsulates the multiple queues that exist for holding unprocessed messages and the rules for the order in which to check them. There are five (5) different Qs that converse uses to store and retrieve unprocessed messages. These are: Q Purpose Type internal DeQ logic -----------------------------------------------------------
The PE queues hold messages that are destined for a specific PE. There is one such queue for every PE within a charm node. The node queues hold messages that are destined to that node. There is only one of each node queue within a charm node. Finally there is also a charm++ message queue for each PE.
The offnode queues are meant for holding messages that arrive from outside the node. The onnode queues hold messages that are generated within the same charm node.
The PE and node level offnode queues are accessed via functions CmiGetNonLocal() and CmiGetNonLocalNodeQ(). These are implemented separately by each machine layer and hide the implementation specifics for each layer.
The PE onnode queue is implemented as a FIFO CkQ and is initialized via a call to CdsFifo_Create(). The node local queue and the scheduler queue are both priority queues. They are initialized via calls to CqsCreate() which gives each of them three separate internal queues for different priority ranges (-ve, 0 and +ve). Access to these queues is via pointers stored in the struct CsdSchedulerState that is passed into this function.
The order in which these queues are checked is described below. The function proceeds to the next queue in the list only if it does not find any messages in the current queue. The first message that is found is returned, terminating the call. (1) offnode queue for this PE (2) onnode queue for this PE (3) offnode queue for this node (4) highest priority msg from onnode queue or scheduler queue
Definition at line 1699 of file convcore.c.
References CdsFifo_Dequeue(), CmiGetNonLocal(), CmiGetNonLocalNodeQ(), CmiLock(), CmiUnlock(), CqsDequeue(), CqsEmpty(), CqsGetPriority(), CqsPrioGT(), CsdSchedulerState_t::gridQ, CsdSchedulerState_t::localCounter, CsdSchedulerState_t::localQ, msg, CsdSchedulerState_t::nodeLock, CsdSchedulerState_t::nodeQ, CsdSchedulerState_t::objQ, and CsdSchedulerState_t::schedQ.
Referenced by CpdCharmInit(), CsdScheduleCount(), CsdScheduleForever(), and CsdSchedulePoll().
| void* CsdNextLocalNodeMessage | ( | CsdSchedulerState_t * | s | ) |
Definition at line 1753 of file convcore.c.
References CmiLock(), CmiUnlock(), CqsDequeue(), CqsEmpty(), msg, CsdSchedulerState_t::nodeLock, and CsdSchedulerState_t::nodeQ.
Referenced by CsdScheduleNodePoll().
Definition at line 1770 of file convcore.c.
References CsdScheduleCount(), CsdScheduleForever(), and CsdSchedulePoll().
Referenced by _CkExit(), CharmLibExit(), CkExit(), CkLocalNodeBranch(), CmiDeliverMsgs(), ConverseInit(), ConverseRunPE(), CthStandinCode(), and KillOnAllSigs().
| void CkClearAllArrayElements | ( | ) |
| void machine_OffloadAPIProgress | ( | ) |
Referenced by CsdScheduleForever(), and KillOnAllSigs().
| void CsdScheduleForever | ( | void | ) |
The main scheduler loop that repeatedly executes messages from a queue, forever.
Definition at line 1811 of file convcore.c.
References CsdEndIdle(), CsdNextMessage(), machine_OffloadAPIProgress(), and msg.
Referenced by CsdScheduler().
Definition at line 1873 of file convcore.c.
References CsdEndIdle(), CsdNextMessage(), and msg.
Referenced by CsdScheduler().
| void CsdSchedulePoll | ( | void | ) |
Definition at line 1892 of file convcore.c.
References CsdNextMessage(), and msg.
Referenced by CsdScheduler(), and LrtsInitCpuTopo().
| void CsdScheduleNodePoll | ( | void | ) |
| void CmiDeliverSpecificMsg | ( | int | handler | ) |
Definition at line 1922 of file convcore.c.
References CdsFifo_Dequeue(), CdsFifo_Enqueue(), CmiGetNonLocal(), CmiHandleMessage(), and msg.
Referenced by _propMapInit(), and CmiInitCPUAffinity().
| CpvStaticDeclare | ( | CthThread | , | |
| CthMainThread | ||||
| ) |
| CpvStaticDeclare | ( | CthThread | , | |
| CthSchedulingThread | ||||
| ) |
| CpvStaticDeclare | ( | CthThread | , | |
| CthSleepingStandins | ||||
| ) |
| CpvDeclare | ( | int | , | |
| CthResumeNormalThreadIdx | ||||
| ) |
| CpvStaticDeclare | ( | int | , | |
| CthResumeSchedulingThreadIdx | ||||
| ) |
| void CthStandinCode | ( | ) |
Definition at line 1978 of file convcore.c.
References CsdScheduler().
Referenced by CthSuspendSchedulingThread().
| static CthThread CthSuspendNormalThread | ( | ) | [static] |
| void CthEnqueueSchedulingThread | ( | CthThreadToken * | token, | |
| int | s, | |||
| int | pb, | |||
| unsigned int * | prio | |||
| ) |
Definition at line 2068 of file convcore.c.
Referenced by CthResumeSchedulingThread(), CthSchedInit(), and CthSuspendSchedulingThread().
| CthThread CthSuspendSchedulingThread | ( | ) |
Definition at line 1992 of file convcore.c.
References CthCreate(), CthEnqueueSchedulingThread(), CthGetNext(), CthSetStrategy(), and CthStandinCode().
Referenced by CthSchedInit().
| void CthResumeNormalThread | ( | CthThreadToken * | token | ) |
Definition at line 2010 of file convcore.c.
References CthResume(), CthTraceResume(), free(), and CthThreadToken::thread.
Referenced by CthSchedInit().
| void CthResumeSchedulingThread | ( | CthThreadToken * | token | ) |
Definition at line 2039 of file convcore.c.
References CthEnqueueSchedulingThread(), CthGetToken(), CthResume(), CthSelf(), CthSetNext(), CthTraceResume(), and CthThreadToken::thread.
Referenced by CthSchedInit().
| void CthEnqueueNormalThread | ( | CthThreadToken * | token, | |
| int | s, | |||
| int | pb, | |||
| unsigned int * | prio | |||
| ) |
| void CthSetStrategyDefault | ( | CthThread | t | ) |
Definition at line 2075 of file convcore.c.
References CthEnqueueNormalThread(), CthSetStrategy(), and CthSuspendNormalThread().
Referenced by CpmThread2(), CpmThreadSize2(), Cpthread_create3(), and CthThreadBaseInit().
| void CthSchedInit | ( | ) |
Definition at line 2082 of file convcore.c.
References CmiRegisterHandler(), CthEnqueueSchedulingThread(), CthResumeNormalThread(), CthResumeSchedulingThread(), CthSelf(), CthSetStrategy(), and CthSuspendSchedulingThread().
Referenced by ConverseCommonInit().
| void CsdInit | ( | char ** | argv | ) |
Definition at line 2102 of file convcore.c.
References CdsFifo_Create(), CmiCreateLock(), CmiGetArgIntDesc(), CmiLock(), CmiMyRank(), CmiNodeAllBarrier(), and CqsCreate().
Referenced by ConverseCommonInit().
| CdsFifo CdsFifo_Create | ( | void | ) |
Definition at line 15 of file conv-lists.C.
Referenced by ConverseInit(), CpdBgInit(), CpdInit(), Cpthread_cond_init(), Cpthread_mutex_init(), CkObjectMsgQ::create(), CsdInit(), OtherNode_init(), and waitqd_QDChare::waitQD().
Definition at line 16 of file conv-lists.C.
| void CdsFifo_Enqueue | ( | CdsFifo | q, | |
| void * | elt | |||
| ) |
Definition at line 17 of file conv-lists.C.
Referenced by _enqObjQueue(), BgProcessMessageFreezeMode(), CMI_VMI_Common_Receive(), CMI_VMI_RDMA_Get_Notification_Handler(), CMI_VMI_Send_Spanning_Children(), CMI_VMI_Stream_Completion_Handler(), CmiAsyncBroadcastAllFn(), CmiAsyncSendFn(), CmiDeliverSpecificMsg(), CmiFreeBroadcastAllFn(), CmiFreeSendFn(), CmiGetNonLocal(), CmiPushPE(), CmiSendSelf(), CmiSyncBroadcastAllFn(), CmiSyncSendFn(), CpdDeliverMessageInt(), CpdDeliverSingleMessage(), CpdFreezeModeScheduler(), Cpthread_cond_wait(), Cpthread_mutex_lock(), Cpthread_mutex_trylock(), KillOnAllSigs(), CkObjectMsgQ::process(), and waitqd_QDChare::waitQD().
| void * CdsFifo_Dequeue | ( | CdsFifo | q | ) |
Definition at line 18 of file conv-lists.C.
Referenced by BgProcessMessageFreezeMode(), CmiDeliverSpecificMsg(), CmiGetNonLocal(), CpdDeliverMessageInt(), CpdDeliverSingleMessage(), CpdFreezeModeScheduler(), CpdGetNextMessageConditional(), Cpthread_cond_broadcast(), Cpthread_cond_signal(), CsdNextMessage(), waitqd_QDChare::onQD(), CkObjectMsgQ::process(), and processFutureMessages().
| void CdsFifo_Push | ( | CdsFifo | q, | |
| void * | elt | |||
| ) |
Definition at line 19 of file conv-lists.C.
| void * CdsFifo_Pop | ( | CdsFifo | q | ) |
Definition at line 20 of file conv-lists.C.
Referenced by Cpthread_cond_wait(), and Cpthread_mutex_unlock().
| void CdsFifo_Destroy | ( | CdsFifo | q | ) |
Definition at line 21 of file conv-lists.C.
Referenced by ConverseExit(), Cpthread_cond_destroy(), Cpthread_mutex_destroy(), waitqd_QDChare::onQD(), and CkObjectMsgQ::~CkObjectMsgQ().
| void ** CdsFifo_Enumerate | ( | CdsFifo | q | ) |
Definition at line 23 of file conv-lists.C.
Referenced by BgProcessMessageFreezeMode(), CpdDeliverSingleMessage(), CpdFreezeModeScheduler(), Cpthread_mutex_destroy(), Cpthread_mutex_trylock(), waitqd_QDChare::onQD(), processFutureMessages(), and PumpMsgsBlocking().
| void * CdsFifo_Peek | ( | CdsFifo | q | ) |
Definition at line 24 of file conv-lists.C.
Referenced by Cpthread_cond_wait(), Cpthread_mutex_lock(), and Cpthread_mutex_unlock().
Definition at line 27 of file conv-lists.C.
Referenced by CpdList_localQ::getLength(), CkObjectMsgQ::length(), processFutureMessages(), and CpdList_localQ::pup().
1.5.5