In CHARM++, quiescence is defined as the state in which no processor is executing an entry point, and no messages are awaiting processing.
CHARM++ provides two facilities for detecting quiescence: CkStartQD and CkWaitQD.
CkStartQD registers with the system a callback that should be made the next time quiescence is detected. CkStartQD has two variants which expect the following arguments:
To retrieve the corresponding index of a particular entry method, you must use a static method contained within the CkIndex object corresponding to the chare containing that entry method. The syntax of this call is as follows:
where ChareName is the name of the chare containing the desired entry method, EntryMethod is the name of that entry method, and parameters are the parameters taken by the method. These parameters are only used to resolve the proper EntryMethod; they are otherwise ignored.
Upon quiescence detection, specified callback is called with no parameters.
CkWaitQD, by contrast, does not register a callback. Rather, CkWaitQD blocks and does not return until quiescence is detected. It takes no parameters and returns no value. A call to CkWaitQD simply looks like this:
Keep in mind that CkWaitQD should only be called from threaded entry methods because a call to CkWaitQD suspends the current thread of execution, and if it were called outside of a threaded entry method it would suspend the main thread of execution of the processor from which CkWaitQD was called and the entire program would come to a grinding halt on that processor.
October 08, 2008
Charm Homepage