PPL Logo

NET


Files

file  machine-pxshm.C
 pxshm --> posix shared memory based network layer for communication between processes on the same node This is not going to be the primary mode of communication but only for messages below a certain size between processes on the same node for non-smp version only * contains only pxshm code for

Data Structures

struct  sharedBufHeader
 This struct is used as the first portion of a shared memory region, followed by data. More...
struct  sharedBufData
struct  OutgoingMsgRec
struct  PxshmSendQ
struct  PxshmContext
struct  XpmemSendQ
struct  XpmemContext

Enumerations

enum  entities { SENDER, RECEIVER, SENDER, RECEIVER }
enum  entities { SENDER, RECEIVER, SENDER, RECEIVER }

Functions

void calculateNodeSizeAndRank (char **)
void setupSharedBuffers (void)
void initAllSendQs (void)
void CmiExitPxshm (void)
static void cleanupOnAllSigs (int signo)
void CmiInitPxshm (char **argv)
void tearDownSharedBuffers (void)
void freeSharedBuffers (void)
static int CmiValidPxshm (int node, int size)
int PxshmRank (int dstnode)
void pushSendQ (PxshmSendQ *q, char *msg, int size, int *refcount)
int sendMessage (char *msg, int size, int *refcount, sharedBufData *dstBuf, PxshmSendQ *dstSendQ)
int flushSendQ (PxshmSendQ *q)
int sendMessageRec (OutgoingMsgRec *omg, sharedBufData *dstBuf, PxshmSendQ *dstSendQ)
void CmiSendMessagePxshm (char *msg, int size, int dstnode, int *refcount)
void CmiExitXpmem (void)
void CmiInitXpmem (char **argv)
static int CmiValidXpmem (int node, int size)
int XpmemRank (int dstnode)
void pushSendQ (XpmemSendQ *q, char *msg, int size, int *refcount)
int sendMessage (char *msg, int size, int *refcount, sharedBufData *dstBuf, XpmemSendQ *dstSendQ)
int flushSendQ (XpmemSendQ *sendQ)
int sendMessageRec (OutgoingMsgRec *omg, sharedBufData *dstBuf, XpmemSendQ *dstSendQ)
void CmiSendMessageXpmem (char *msg, int size, int dstnode, int *refcount)

Variables

static int SHMBUFLEN = (1024 * 1024 * 4)
static int SHMMAXSIZE = (1024 * 1024)
static int SENDQSTARTSIZE = 256
int sharedBufHeader::bytes
OSSpinLock sharedBufHeader::lock
volatile int sharedBufHeader::flagSender
char sharedBufHeader::pad1 [CMI_CACHE_LINE_SIZE-sizeof(volatile int)]
volatile int sharedBufHeader::flagReceiver
char sharedBufHeader::pad2 [CMI_CACHE_LINE_SIZE-sizeof(volatile int)]
volatile int sharedBufHeader::turn
sharedBufHeadersharedBufData::header
char * sharedBufData::data
intOutgoingMsgRec::refcount
int OutgoingMsgRec::size
int PxshmSendQ::begin
int PxshmSendQ::end
int PxshmSendQ::numEntries
int PxshmSendQ::rank
int PxshmSendQ::next
OutgoingMsgRecPxshmSendQ::data
int PxshmContext::noderank
int PxshmContext::nodestart
int PxshmContext::nodeend
char PxshmContext::prefixStr [PREFIXSTRLEN]
char ** PxshmContext::recvBufNames
char ** PxshmContext::sendBufNames
sharedBufDataPxshmContext::recvBufs
sharedBufDataPxshmContext::sendBufs
PxshmSendQ ** PxshmContext::sendQs
int PxshmContext::sendCount
int PxshmContext::validCheckCount
int PxshmContext::lockRecvCount
double PxshmContext::validCheckTime
double PxshmContext::sendTime
double PxshmContext::commServerTime
static int sendQ_head_index = -1
PxshmContextpxshmContext = NULL
static int pxshm_freed = 0
static int XPMEMBUFLEN = (1024*1024*4)
static int SENDQSTARTSIZE = 256
sharedBufHeadersharedBufData::header
char * sharedBufData::data
__s64 sharedBufData::segid
intOutgoingMsgRec::refcount
int XpmemSendQ::begin
int XpmemSendQ::end
int XpmemSendQ::numEntries
int XpmemSendQ::rank
int XpmemSendQ::next
OutgoingMsgRecXpmemSendQ::data
int XpmemContext::noderank
int XpmemContext::nodestart
int XpmemContext::nodeend
char XpmemContext::prefixStr [PREFIXSTRLEN]
char ** XpmemContext::recvBufNames
char ** XpmemContext::sendBufNames
sharedBufDataXpmemContext::recvBufs
sharedBufDataXpmemContext::sendBufs
XpmemSendQ ** XpmemContext::sendQs
int XpmemContext::sendCount
int XpmemContext::validCheckCount
int XpmemContext::lockRecvCount
double XpmemContext::validCheckTime
double XpmemContext::sendTime
double XpmemContext::commServerTime
static int sendQ_head_index = -1
XpmemContextxpmemContext = NULL
static int xpmem_fd
static int pxshm_freed = 0

Enumeration Type Documentation

enum entities

Enumerator:
SENDER 
RECEIVER 
SENDER 
RECEIVER 

Definition at line 75 of file machine-pxshm.C.

enum entities

Enumerator:
SENDER 
RECEIVER 
SENDER 
RECEIVER 

Definition at line 78 of file machine-xpmem.C.


Function Documentation

void calculateNodeSizeAndRank ( char **   ) 

Referenced by CmiInitPxshm(), CmiInitXpmem(), CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

void setupSharedBuffers ( void   ) 

Referenced by CmiInitPxshm(), CmiInitXpmem(), CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

void initAllSendQs ( void   ) 

Referenced by CmiInitPxshm(), CmiInitXpmem(), CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

void CmiExitPxshm ( void   ) 

static void cleanupOnAllSigs ( int  signo  )  [static]

Definition at line 177 of file machine-pxshm.C.

References CmiExitPxshm().

Referenced by CmiInitPxshm(), and CmiInitXpmem().

Here is the call graph for this function:

Here is the caller graph for this function:

void CmiInitPxshm ( char **  argv  ) 

void tearDownSharedBuffers ( void   ) 

Referenced by CmiExitPxshm(), CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

void freeSharedBuffers ( void   ) 

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

static int CmiValidPxshm ( int  node,
int  size 
) [inline, static]

Definition at line 325 of file machine-pxshm.C.

References PxshmContext::nodestart, SHMMAXSIZE, and PxshmContext::validCheckCount.

Referenced by CmiInterSendNetworkFunc().

Here is the caller graph for this function:

int PxshmRank ( int  dstnode  ) 

Definition at line 343 of file machine-pxshm.C.

References PxshmContext::nodestart.

Referenced by CmiSendMessagePxshm().

Here is the caller graph for this function:

void pushSendQ ( PxshmSendQ q,
char *  msg,
int  size,
int refcount 
) [inline]

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

int sendMessage ( char *  msg,
int  size,
int refcount,
sharedBufData dstBuf,
PxshmSendQ dstSendQ 
) [inline]

Referenced by CmiSendMessagePxshm(), CmiSendMessageXpmem(), and sendMessageRec().

Here is the caller graph for this function:

int flushSendQ ( PxshmSendQ q  ) 

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the caller graph for this function:

int sendMessageRec ( OutgoingMsgRec omg,
sharedBufData dstBuf,
PxshmSendQ dstSendQ 
)

Definition at line 350 of file machine-pxshm.C.

References OutgoingMsgRec::data, OutgoingMsgRec::refcount, sendMessage(), and OutgoingMsgRec::size.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Here is the call graph for this function:

Here is the caller graph for this function:

void CmiSendMessagePxshm ( char *  msg,
int  size,
int  dstnode,
int refcount 
)

failed to get the lock insert into q and retain the message

copy this message to sharedBuf

Definition at line 364 of file machine-pxshm.C.

References _Cmi_mynode, _Cmi_myphysnode_numprocesses, _Cmi_numnodes, argv, PxshmSendQ::begin, sharedBufHeader::bytes, calculateNodeSizeAndRank(), calloc(), Ck::IO::close(), CmiAlloc(), CmiFree(), CmiMemoryCheck(), CmiNotifyStillIdle(), CmiNumPesOnPhysicalNode(), CmiPhysicalNodeID(), CmiPrintf(), CmiWallTimer(), PxshmContext::commServerTime, CommunicationServerPxshm(), count, sharedBufHeader::count, OutgoingMsgRec::data, PxshmSendQ::data, sharedBufData::data, PxshmSendQ::end, fd, sharedBufHeader::flagReceiver, sharedBufHeader::flagSender, flushSendQ(), free(), freeSharedBuffers(), ftruncate(), handleOneRecvedMsg(), sharedBufData::header, initAllSendQs(), sharedBufHeader::lock, PxshmContext::lockRecvCount, LrtsBarrier(), LrtsPrepareEnvelope(), malloc(), sharedBufData::mutex, name, PxshmSendQ::next, PxshmContext::nodeend, PxshmContext::noderank, PxshmContext::nodesize, PxshmContext::nodestart, PxshmSendQ::numEntries, PxshmContext::prefixStr, pushSendQ(), PxshmRank(), PxshmSendQ::rank, rank, RECEIVER, PxshmContext::recvBufNames, PxshmContext::recvBufs, OutgoingMsgRec::refcount, PUP::s, PxshmContext::sendBufNames, PxshmContext::sendBufs, PxshmContext::sendCount, SENDER, sendMessage(), sendMessageRec(), sendQ_head_index, PxshmContext::sendQs, SENDQSTARTSIZE, PxshmContext::sendTime, setupSharedBuffers(), SHMBUFLEN, PxshmSendQ::size, OutgoingMsgRec::size, snprintf(), tearDownSharedBuffers(), and sharedBufHeader::turn.

Referenced by CmiInterSendNetworkFunc().

Here is the call graph for this function:

Here is the caller graph for this function:

void CmiExitXpmem ( void   ) 

void CmiInitXpmem ( char **  argv  ) 

Definition at line 198 of file machine-xpmem.C.

References _Cmi_mynode, calculateNodeSizeAndRank(), calloc(), cleanupOnAllSigs(), CmiAbort(), CmiPrintf(), CmiReadSize(), initAllSendQs(), XpmemContext::nodesize, Ck::IO::open(), XpmemContext::prefixStr, SENDQSTARTSIZE, setupSharedBuffers(), snprintf(), xpmem_fd, and XPMEMBUFLEN.

Referenced by ConverseInit().

Here is the call graph for this function:

Here is the caller graph for this function:

static int CmiValidXpmem ( int  node,
int  size 
) [inline, static]

Definition at line 309 of file machine-xpmem.C.

References XpmemContext::nodestart, and XpmemContext::validCheckCount.

Referenced by CmiInterSendNetworkFunc().

Here is the caller graph for this function:

int XpmemRank ( int  dstnode  )  [inline]

Definition at line 319 of file machine-xpmem.C.

References XpmemContext::nodestart.

Referenced by CmiSendMessageXpmem().

Here is the caller graph for this function:

void pushSendQ ( XpmemSendQ q,
char *  msg,
int  size,
int refcount 
) [inline]

int sendMessage ( char *  msg,
int  size,
int refcount,
sharedBufData dstBuf,
XpmemSendQ dstSendQ 
) [inline]

int flushSendQ ( XpmemSendQ sendQ  )  [inline]

int sendMessageRec ( OutgoingMsgRec omg,
sharedBufData dstBuf,
XpmemSendQ dstSendQ 
) [inline]

Definition at line 327 of file machine-xpmem.C.

References OutgoingMsgRec::data, OutgoingMsgRec::refcount, sendMessage(), and OutgoingMsgRec::size.

Here is the call graph for this function:

void CmiSendMessageXpmem ( char *  msg,
int  size,
int  dstnode,
int refcount 
)

failed to get the lock insert into q and retain the message

copy this message to sharedBuf

Definition at line 339 of file machine-xpmem.C.

References _Cmi_mynode, _Cmi_numnodes, argv, XpmemSendQ::begin, sharedBufHeader::bytes, calculateNodeSizeAndRank(), calloc(), Ck::IO::close(), CmiAbort(), CmiAlloc(), CmiBarrier(), CmiFree(), CmiGetArgIntDesc(), CmiMemcpy(), CmiMemoryCheck(), CmiNotifyStillIdle(), CmiPrintf(), CmiPushPE(), CmiWallTimer(), XpmemContext::commServerTime, count, sharedBufHeader::count, OutgoingMsgRec::data, XpmemSendQ::data, sharedBufData::data, XpmemSendQ::end, fd, sharedBufHeader::flagReceiver, sharedBufHeader::flagSender, flushSendQ(), xi::fname, free(), freeSharedBuffers(), getpagesize(), handleOneRecvedMsg(), sharedBufData::header, initAllSendQs(), sharedBufHeader::lock, XpmemContext::lockRecvCount, LrtsPrepareEnvelope(), malloc(), sharedBufData::mutex, XpmemSendQ::next, XpmemContext::nodeend, XpmemContext::noderank, XpmemContext::nodesize, XpmemContext::nodestart, XpmemSendQ::numEntries, Ck::IO::open(), XpmemContext::prefixStr, pushSendQ(), XpmemSendQ::rank, rank, RECEIVER, XpmemContext::recvBufNames, XpmemContext::recvBufs, OutgoingMsgRec::refcount, PUP::s, XpmemContext::sendBufNames, XpmemContext::sendBufs, XpmemContext::sendCount, SENDER, sendMessage(), sendMessageRec(), sendQ_head_index, XpmemContext::sendQs, SENDQSTARTSIZE, SendSpanningChildren(), XpmemContext::sendTime, setupSharedBuffers(), XpmemSendQ::size, OutgoingMsgRec::size, snprintf(), tearDownSharedBuffers(), sharedBufHeader::turn, Ck::IO::write(), xpmem_fd, XPMEMBUFLEN, and XpmemRank().

Referenced by CmiInterSendNetworkFunc().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int SHMBUFLEN = (1024 * 1024 * 4) [static]

Definition at line 89 of file machine-pxshm.C.

Referenced by CmiInitPxshm(), and CmiSendMessagePxshm().

int SHMMAXSIZE = (1024 * 1024) [static]

Definition at line 90 of file machine-pxshm.C.

Referenced by CmiInitPxshm(), and CmiValidPxshm().

int SENDQSTARTSIZE = 256 [static]

Definition at line 98 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

OSSpinLock sharedBufHeader::lock [inherited]

Definition at line 101 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

volatile int sharedBufHeader::flagSender [inherited]

Definition at line 105 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

char sharedBufHeader::pad1 [inherited]

Definition at line 106 of file machine-pxshm.C.

volatile int sharedBufHeader::flagReceiver [inherited]

Definition at line 107 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

char sharedBufHeader::pad2 [inherited]

Definition at line 108 of file machine-pxshm.C.

volatile int sharedBufHeader::turn [inherited]

Definition at line 109 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Definition at line 118 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

char* sharedBufData::data [inherited]

Definition at line 119 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Definition at line 124 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), CmiSendMessageXpmem(), and sendMessageRec().

Definition at line 125 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), CmiSendMessageXpmem(), and sendMessageRec().

int PxshmSendQ::begin [inherited]

Definition at line 130 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

int PxshmSendQ::end [inherited]

Definition at line 131 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

Definition at line 132 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

int PxshmSendQ::rank [inherited]

Definition at line 133 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

int PxshmSendQ::next [inherited]

Definition at line 135 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

Definition at line 137 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

Definition at line 143 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiSendMessagePxshm().

Definition at line 144 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), CmiValidPxshm(), and PxshmRank().

Definition at line 144 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

char PxshmContext::prefixStr[PREFIXSTRLEN] [inherited]

Definition at line 145 of file machine-pxshm.C.

Referenced by CmiInitPxshm(), and CmiSendMessagePxshm().

char** PxshmContext::recvBufNames [inherited]

Definition at line 146 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiSendMessagePxshm().

char** PxshmContext::sendBufNames [inherited]

Definition at line 147 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiSendMessagePxshm().

Definition at line 149 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiSendMessagePxshm().

Definition at line 150 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiSendMessagePxshm().

Definition at line 152 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm().

Definition at line 155 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), CmiInitPxshm(), and CmiSendMessagePxshm().

Definition at line 156 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), CmiInitPxshm(), and CmiValidPxshm().

Definition at line 157 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), CmiInitPxshm(), and CmiSendMessagePxshm().

double PxshmContext::validCheckTime [inherited]

Definition at line 158 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), and CmiInitPxshm().

double PxshmContext::sendTime [inherited]

Definition at line 159 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), CmiInitPxshm(), and CmiSendMessagePxshm().

double PxshmContext::commServerTime [inherited]

Definition at line 160 of file machine-pxshm.C.

Referenced by CmiExitPxshm(), CmiInitPxshm(), and CmiSendMessagePxshm().

int sendQ_head_index = -1 [static]

Definition at line 166 of file machine-pxshm.C.

Referenced by CmiSendMessagePxshm(), and CmiSendMessageXpmem().

Definition at line 169 of file machine-pxshm.C.

int pxshm_freed = 0 [static]

Definition at line 282 of file machine-pxshm.C.

Referenced by CmiExitPxshm().

int XPMEMBUFLEN = (1024*1024*4) [static]

Definition at line 92 of file machine-xpmem.C.

Referenced by CmiInitXpmem(), and CmiSendMessageXpmem().

int SENDQSTARTSIZE = 256 [static]

Definition at line 96 of file machine-xpmem.C.

Definition at line 123 of file machine-xpmem.C.

char* sharedBufData::data [inherited]

Definition at line 124 of file machine-xpmem.C.

__s64 sharedBufData::segid [inherited]

Definition at line 125 of file machine-xpmem.C.

Definition at line 131 of file machine-xpmem.C.

int XpmemSendQ::begin [inherited]

Definition at line 138 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

int XpmemSendQ::end [inherited]

Definition at line 139 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

Definition at line 140 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

int XpmemSendQ::rank [inherited]

Definition at line 141 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

int XpmemSendQ::next [inherited]

Definition at line 143 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

Definition at line 145 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

Definition at line 151 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

Definition at line 152 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem(), CmiValidXpmem(), and XpmemRank().

Definition at line 152 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

char XpmemContext::prefixStr[PREFIXSTRLEN] [inherited]

Definition at line 153 of file machine-xpmem.C.

Referenced by CmiInitXpmem(), and CmiSendMessageXpmem().

char** XpmemContext::recvBufNames [inherited]

Definition at line 154 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

char** XpmemContext::sendBufNames [inherited]

Definition at line 155 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

Definition at line 157 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

Definition at line 158 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

Definition at line 160 of file machine-xpmem.C.

Referenced by CmiSendMessageXpmem().

Definition at line 163 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

Definition at line 164 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiValidXpmem().

Definition at line 165 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

double XpmemContext::validCheckTime [inherited]

Definition at line 166 of file machine-xpmem.C.

Referenced by CmiExitXpmem().

double XpmemContext::sendTime [inherited]

Definition at line 167 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

double XpmemContext::commServerTime [inherited]

Definition at line 168 of file machine-xpmem.C.

Referenced by CmiExitXpmem(), and CmiSendMessageXpmem().

int sendQ_head_index = -1 [static]

Definition at line 175 of file machine-xpmem.C.

Definition at line 178 of file machine-xpmem.C.

int xpmem_fd [static]

Definition at line 192 of file machine-xpmem.C.

Referenced by CmiInitXpmem(), and CmiSendMessageXpmem().

int pxshm_freed = 0 [static]

Definition at line 269 of file machine-xpmem.C.


Generated on Mon Sep 21 08:17:01 2020 for Charm++ by  doxygen 1.5.5