PPL Logo

arch/util/machine-commthd-util.c File Reference

Go to the source code of this file.

Functions

 CsvDeclare (PCQueue, notifyCommThdMsgBuffer)
 Usage: First: define a function that needs to be invoked on comm thread.
 CpvDeclare (int, notifyCommThdHdlr)
static void commThdHandleNotification (CmiNotifyCommThdMsg *msg)
void CmiInitNotifyCommThdScheme ()
CmiNotifyCommThdMsgCmiCreateNotifyCommThdMsg (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 CmiNotifyCommThd (CmiNotifyCommThdMsg *msg)


Function Documentation

CsvDeclare ( PCQueue  ,
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]

void CmiInitNotifyCommThdScheme (  ) 

CmiNotifyCommThdMsg* CmiCreateNotifyCommThdMsg ( CmiCommThdFnPtr  fn,
int  numParams,
void *  params,
int  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 
)

void CmiNotifyCommThd ( CmiNotifyCommThdMsg msg  ) 

Definition at line 78 of file machine-commthd-util.c.

References CmiPushImmediateMsg().


Generated on Sat May 26 08:08:06 2012 for Charm++ by  doxygen 1.5.5