Go to the source code of this file.
Functions | |
CsvDeclare (CMIQueue, notifyCommThdMsgBuffer) | |
Usage: First: define a function that needs to be invoked on comm thread. | |
CpvDeclare (int, notifyCommThdHdlr) | |
static void | commThdHandleNotification (CmiNotifyCommThdMsg *msg) |
void | CmiInitNotifyCommThdScheme (void) |
CmiNotifyCommThdMsg * | CmiCreateNotifyCommThdMsg (CmiCommThdFnPtr fn, int numParams, void *params, int toKeep) |
void | CmiFreeNotifyCommThdMsg (CmiNotifyCommThdMsg *msg) |
void | CmiResetNotifyCommThdMsg (CmiNotifyCommThdMsg *msg, CmiCommThdFnPtr fn, int numParams, void *params, int toKeep) |
void | CmiPushImmediateMsg (void *) |
void | CmiNotifyCommThd (CmiNotifyCommThdMsg *msg) |
CsvDeclare | ( | CMIQueue | , | |
notifyCommThdMsgBuffer | ||||
) |
Usage: First: define a function that needs to be invoked on comm thread.
E.g. void CommThdSayHello(int numParams, void *params) { int src = *(int *)params; CkPrintf("Notification from source %d\n", src); }
Second: create a notification msg and push it to comm thread. E.g. int *argv = (int *)malloc(sizeof(int)*1); *argv = SRCIDX; CmiNotifyCommThdMsg *one = CmiCreateNotifyCommThdMsg(CommThdSayHello, 1, (void *)(argv), 0); CmiNotifyCommThd(one); Since we have set "toKeep" 0, the msg itself with the input arguments will be freed by the comm thread after the msg is processed. Otherwise, the developer has to be responsible for freeing such message.
CpvDeclare | ( | int | , | |
notifyCommThdHdlr | ||||
) |
static void commThdHandleNotification | ( | CmiNotifyCommThdMsg * | msg | ) | [static] |
Definition at line 24 of file machine-commthd-util.C.
References CmiFreeNotifyCommThdMsg(), CmiNotifyCommThdMsg::fn, CmiNotifyCommThdMsg::numParams, CmiNotifyCommThdMsg::params, and CmiNotifyCommThdMsg::toKeep.
Referenced by CmiInitNotifyCommThdScheme().
void CmiInitNotifyCommThdScheme | ( | void | ) |
Definition at line 30 of file machine-commthd-util.C.
References CmiMyRank(), CmiNodeAllBarrier(), CmiRegisterHandler(), commThdHandleNotification(), and malloc().
Referenced by ConverseRunPE().
CmiNotifyCommThdMsg* CmiCreateNotifyCommThdMsg | ( | CmiCommThdFnPtr | fn, | |
int | numParams, | |||
void * | params, | |||
int | toKeep | |||
) |
Definition at line 50 of file machine-commthd-util.C.
References CmiNotifyCommThdMsg::fn, malloc(), CmiNotifyCommThdMsg::numParams, CmiNotifyCommThdMsg::params, and CmiNotifyCommThdMsg::toKeep.
void CmiFreeNotifyCommThdMsg | ( | CmiNotifyCommThdMsg * | msg | ) |
Definition at line 64 of file machine-commthd-util.C.
References free(), and CmiNotifyCommThdMsg::params.
Referenced by commThdHandleNotification().
void CmiResetNotifyCommThdMsg | ( | CmiNotifyCommThdMsg * | msg, | |
CmiCommThdFnPtr | fn, | |||
int | numParams, | |||
void * | params, | |||
int | toKeep | |||
) |
Definition at line 71 of file machine-commthd-util.C.
References CmiNotifyCommThdMsg::fn, CmiNotifyCommThdMsg::numParams, CmiNotifyCommThdMsg::params, and CmiNotifyCommThdMsg::toKeep.
void CmiNotifyCommThd | ( | CmiNotifyCommThdMsg * | msg | ) |
Definition at line 80 of file machine-commthd-util.C.
References CmiPushImmediateMsg().