NET
[Converse Machine Layer]

Collaboration diagram for NET:
NET implementation of machine layer, ethernet in particular

THE DATAGRAM STREAM. More...


Files

file  machine-dgram.c
 Datagram implementation of Converse NET version

converse basic message header:
d0 d1 d2 d3: DgramHeader
d4 d5: msg length (32-bit number)
hdl: handler
xhdl: extended handler
.

file  machine-eth.c
 UDP implementation of Converse NET version

contains only UDP specific code for:


file  machine-gm.c
 Myrinet API GM implementation of Converse NET version

contains only GM API specific code for:


file  machine-ibud.c
 ibverbs unreliable datagram implementation of Converse NET version

contains only ibverbs specific code for:


file  machine-ibverbs.c
 Ibverbs (infiniband) implementation of Converse NET version

contains only Ibverbs specific code for:


file  machine-mx.c
 Myrinet API GM implementation of Converse NET version

contains only MX API specific code for:


file  machine-pxshm.c
 size = CmiMsgHeaderGetLength(msg); 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
file  machine-sysvshm.c
 size = CmiMsgHeaderGetLength(msg); sysvshm --> sysv 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 sysvshm code for
file  machine-tcp.c
 TCP implementation of Converse NET version

contains only TCP specific code for:


file  machine.c
 Basic NET implementation of Converse machine layer.

Data Structures

struct  DgramHeader
struct  DgramAck
struct  OutgoingMsgStruct
struct  ExplicitDgramStruct
struct  ImplicitDgramStruct
struct  FutureMessageStruct
struct  OtherNodeStruct
struct  CmiIdleState
struct  PendingMsgStruct
struct  CmiCb
struct  CmiRMA
struct  CmiRMAMsg
struct  RMAPutMsg
struct  ibudstruct
struct  infiPacketHeader
struct  infiAddr
 Represents a qp used to send messages to another node There is one for each remote node. More...
struct  infiPacketStruct
struct  infiContext
struct  infiOtherNodeData
struct  infiBuffer
struct  infiCmiChunkMetaDataStruct
struct  infiBufferPool
 At the moment it is a simple pool with just a list of buffers TODO; extend it to make it an element in a linklist of pools. More...
struct  infiCmiChunkPool
struct  infiIncTokenAckPacket
struct  infiRdmaPacket
struct  infiBufferedBcastStruct
struct  infiBufferedBcastPoolStruct
struct  infiDirectRequestPacket
struct  directPollingQNodeStruct
struct  infiDirectHandleStruct
struct  infiDirectHandleTableStruct
struct  PendingSentMsgStruct
struct  sharedBufHeader
 This struct is used as the first portion of a shared memory region, followed by data. More...
struct  sharedBufData
struct  PxshmSendQ
struct  PxshmContext
struct  SysvshmSendQ
struct  SysvshmContext

Typedefs

typedef struct OutgoingMsgStructOutgoingMsg
typedef struct
ExplicitDgramStruct
ExplicitDgram
typedef struct
ImplicitDgramStruct
ImplicitDgram
typedef enum __qp_connection_state qp_connection_state_t
typedef struct
FutureMessageStruct
FutureMessage
typedef struct OtherNodeStructOtherNode
typedef struct PendingMsgStructPendingMsg
typedef struct CmiCb CmiCb
typedef struct CmiRMA CmiRMA
typedef struct CmiRMAMsg CmiRMAMsg
typedef struct RMAPutMsg RMAPutMsg
typedef struct infiPacketStructinfiPacket
typedef struct
infiCmiChunkMetaDataStruct 
infiCmiChunkMetaData
typedef struct infiPacketStructinfiPacket
typedef struct
infiBufferedBcastPoolStruct
infiBufferedBcastPool
typedef struct
infiCmiChunkMetaDataStruct 
infiCmiChunkMetaData
typedef struct
directPollingQNodeStruct 
directPollingQNode
typedef struct
infiDirectHandleStruct 
infiDirectHandle
typedef struct
infiDirectHandleTableStruct 
infiDirectHandleTable
typedef struct
PendingSentMsgStruct
PendingSentMsg

Enumerations

enum  __qp_connection_state { QP_CONN_STATE_PRE_CONNECT = 1, QP_CONN_STATE_CONNECTED, QP_CONN_STATE_CONNECTION_LOST, QP_CONN_STATE_CONNECTION_CLOSED }
enum  { INFI_HEADER_DATA = 21, INFI_DATA }
enum  { INFI_HEADER_DATA = 21, INFI_DATA }
 Stored in the OtherNode structure in machine-dgram.c Store the per node data for ibverbs layer. More...
enum  entities { SENDER, RECEIVER }

Functions

unsigned char computeCheckSum (unsigned char *data, int len)
static void randomCorrupt (char *data, int len)
static void setspeed_atm ()
static void setspeed_eth ()
static void setspeed_gigabit ()
static void extract_args (char **argv)
struct infiOtherNodeDatainitinfiData (int node, int lid, int qpn, int psn)
struct infiOtherNodeDatainitInfiOtherNodeData (int node, int addr[3])
void infiPostInitialRecvs ()
void CommunicationServerSysvshm ()
void CommunicationServerPxshm ()
static void OtherNode_init (OtherNode node)
int CmiLongSendQueue (int forNode, int longerThan)
 Return 1 if our outgoing message queue for this node is longer than this many bytes.
void CmiGmConvertMachineID (unsigned int *mach_id)
void CmiAmmassoNodeAddressesStoreHandler (int pe, struct sockaddr_in *addr, int port)
static void node_addresses_store (ChMessage *msg)
void printNetStatistics (void)
void GarbageCollectMsg (OutgoingMsg ogm)
void DiscardImplicitDgram (ImplicitDgram dg)
static void CommunicationsClock (void)
static void CommunicationsClockCaller (void *ignored)
static void CommunicationPeriodic (void)
static void CommunicationPeriodicCaller (void *ignored)
void DeliverViaNetwork (OutgoingMsg ogm, OtherNode node, int rank, unsigned int broot, int copy)
void SendSpanningChildren (OutgoingMsg ogm, int root, int size, char *msg, unsigned int startpe, int nodesend)
void SendHypercube (OutgoingMsg ogm, int root, int size, char *msg, unsigned int curcycle, int nodesend)
int CmiBarrier ()
int CmiBarrierZero ()
static CmiIdleStateCmiNotifyGetState (void)
static void CmiNotifyBeginIdle (CmiIdleState *s)
static void CmiNotifyStillIdle (CmiIdleState *s)
void CmiNotifyIdle (void)
int CheckSocketsReady (int withDelayMs)
void TransmitAckDatagram (OtherNode node)
void TransmitImplicitDgram (ImplicitDgram dg)
void TransmitImplicitDgram1 (ImplicitDgram dg)
int TransmitAcknowledgement ()
int TransmitDatagram ()
void EnqueueOutgoingDgram (OutgoingMsg ogm, char *ptr, int len, OtherNode node, int rank, int broot)
void AssembleDatagram (OtherNode node, ExplicitDgram dg)
void AssembleReceivedDatagrams (OtherNode node)
void IntegrateMessageDatagram (ExplicitDgram dg)
void IntegrateAckDatagram (ExplicitDgram dg)
void ReceiveDatagram ()
void CmiHandleImmediate ()
static void CommunicationServer (int sleepTime, int where)
void CmiMachineInit (char **argv)
void CmiCommunicationInit (char **argv)
void CmiMachineExit ()
static void sendBarrierMessage (int pe)
static void recvBarrierMessage ()
void handleGetSrc (void *msg)
void handleGetDest (void *msg)
void enqueue_sending (char *msg, int length, OtherNode node, int size)
static void alarmcallback (void *context)
static int processEvent (gm_recv_event_t *e)
static void send_progress ()
static void alarmInterrupt (int arg)
static int gmExit (int code, const char *msg)
static char * getErrorMsg (gm_status_t status)
static void ServiceCharmrun_nolock ()
static void CommunicationServer_nolock (int withDelayMs)
static void processMessage (char *msg, int len)
void drop_send_callback (struct gm_port *p, void *context, gm_status_t status)
void send_callback (struct gm_port *p, void *context, gm_status_t status)
static void send_callback_nothing (struct gm_port *p, void *context, gm_status_t status)
void CmiCheckGmStatus ()
void * CmiDMAAlloc (int size)
int CmiRegisterMemory (void *addr, unsigned int size)
int CmiUnRegisterMemory (void *addr, unsigned int size)
void put_callback (struct gm_port *p, void *context, gm_status_t status)
void * CmiPut (unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size)
void CmiPutCb (unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size, CmiRdmaCallbackFn fn, void *param)
void get_callback_dest (struct gm_port *p, void *context, gm_status_t status)
void * CmiGet (unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size)
void CmiGetCb (unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size, CmiRdmaCallbackFn fn, void *param)
int CmiWaitTest (void *obj)
const char * ibv_wc_status_str (enum ibv_wc_status status)
void infi_unregAndFreeMeta (void *md)
static void * getInfiCmiChunk (int dataSize)
void * infi_CmiAlloc (int size)
void infi_CmiFree (void *ptr)
static void initInfiCmiChunkPools ()
 There are INFINUMPOOLS of memory.
void postInitialRecvs (struct infiBufferPool *recvBufferPool, int numRecvs, int sizePerBuffer)
 Post the buffers as recv work requests.
struct infiBufferPoolallocateInfiBufferPool (int numRecvs, int sizePerBuffer)
static void CommunicationServer_lock (int toBuffer)
static infiPacket newPacket ()
static void EnqueuePacket (OtherNode node, infiPacket packet, int size, struct ibv_mr *dataKey)
 Packetize this data and send it.
static void EnqueueDataPacket (OutgoingMsg ogm, char *data, int size, OtherNode node, int rank, int broot)
static void handoverMessage (char *newmsg, int total_size, int rank, int broot, int toBuffer)
static void processMessage (int nodeNo, int len, char *msg, const int toBuffer)
void processSendWC (struct ibv_wc *sendWC)
void processRecvWC (struct ibv_wc *recvWC, const int toBuffer)
static int pollCq (const int toBuffer, struct ibv_cq *cq)
static uint16_t getLocalLid (struct ibv_context *dev_context, int port)
struct infiAddrinitinfiAddr (int node, int lid, int qpn, int psn)
void createqp (struct ibv_device *dev)
void createah ()
void infi_CmiFreeDirect (void *ptr)
static void fillBufferPools ()
static int pollSendCq (const int toBuffer)
void createLocalQps (struct ibv_device *dev, int ibPort, int myNode, int numNodes, struct infiAddr *localAddr)
static int checkQp (struct ibv_qp *qp)
static void checkAllQps ()
static void send_partial_init ()
void copyInfiAddr (ChInfiAddr *qpList)
static void increaseTokens (OtherNode node)
static int pollRecvCq (const int toBuffer)
static void getFreeTokens (struct infiOtherNodeData *infiData)
static void EnqueueDummyPacket (OtherNode node, int size)
static void EnqueueDataPacket (OutgoingMsg ogm, OtherNode node, int rank, char *data, int size, int broot, int copy)
static void EnqueueRdmaPacket (OutgoingMsg ogm, OtherNode node)
static void processAllBufferedMsgs ()
static void processAsyncEvents ()
static void pollCmiDirectQ ()
static void processRdmaWC (struct ibv_wc *rdmaWC, const int toBuffer)
static void insertBufferedBcast (char *msg, int size, int broot, int asm_rank)
static void increasePostedRecvs (int nodeNo)
static void processRdmaRequest (struct infiRdmaPacket *rdmaPacket, int fromNodeNo, int isBuffered)
static void processRdmaAck (struct infiRdmaPacket *rdmaPacket)
static void EnqueueRdmaAck (struct infiRdmaPacket *rdmaPacket)
static void processDirectWC (struct infiRdmaPacket *rdmaPacket)
static infiBufferedBcastPool createBcastPool ()
static void processBufferedBcast ()
static void processBufferedRdmaAcks ()
static void processBufferedRdmaRequests ()
infiCmiChunkMetaDataregisterMultiSendMesg (char *msg, int size)
static void * getInfiCmiChunkThread (int dataSize)
void addHandleToPollingQ (infiDirectHandle *handle)
static infiDirectHandleTable ** createHandleTable ()
static void calcHandleTableIdx (int handle, int *tableIdx, int *idx)
static void initializeLastDouble (void *recvBuf, int recvBufSize, double initialValue)
struct infiDirectUserHandle CmiDirect_createHandle (int senderNode, void *recvBuf, int recvBufSize, void(*callbackFnPtr)(void *), void *callbackData, double initialValue)
 To be called on the receiver to create a handle and return its number.
void CmiDirect_assocLocalBuffer (struct infiDirectUserHandle *userHandle, void *sendBuf, int sendBufSize)
void CmiDirect_put (struct infiDirectUserHandle *userHandle)
void CmiDirect_readyMark (struct infiDirectUserHandle *userHandle)
void CmiDirect_readyPollQ (struct infiDirectUserHandle *userHandle)
void CmiDirect_ready (struct infiDirectUserHandle *userHandle)
static int receivedDirectMessage (infiDirectHandle *handle)
static const char * getErrorMsg (mx_return_t rc)
static void processStatusCode (mx_status_t status)
static void PumpMsgs (int getone)
static void ReleaseSentMsgs (void)
static void PumpEvents (int getone)
void recv_callback (void *context, uint64_t match_info, int length)
void processFutureMessages (OtherNode node)
void EnqueueOutgoingDgram (OutgoingMsg ogm, char *ptr, int dlen, OtherNode node, int rank, int broot, int copy)
void CmiMXMakeConnection ()
void calculateNodeSizeAndRank (char **)
void setupSharedBuffers ()
void initAllSendQs ()
void CmiInitPxshm (char **argv)
void tearDownSharedBuffers ()
void CmiExitPxshm ()
int CmiValidPxshm (OutgoingMsg ogm, OtherNode node)
int PxshmRank (int dst)
void pushSendQ (PxshmSendQ *q, OutgoingMsg msg)
int sendMessage (OutgoingMsg ogm, sharedBufData *dstBuf, PxshmSendQ *dstSendQ)
int flushSendQ (int dstRank)
void CmiSendMessagePxshm (OutgoingMsg ogm, OtherNode node, int rank, unsigned int broot)
void CmiInitSysvshm (char **argv)
void CmiExitSysvshm ()
int CmiValidSysvshm (OutgoingMsg ogm, OtherNode node)
int SysvshmRank (int dst)
void pushSendQ (SysvshmSendQ *q, OutgoingMsg msg)
int sendMessage (OutgoingMsg ogm, sharedBufData *dstBuf, SysvshmSendQ *dstSendQ)
void CmiSendMessageSysvshm (OutgoingMsg ogm, OtherNode node, int rank, unsigned int broot)
void emptyAllRecvBufs ()
void flushAllSendQs ()
static void CmiNotifyStillIdleSysvshm (CmiIdleState *s)
static void CmiNotifyBeginIdleSysvshm (CmiIdleState *s)
void createShmObjectsAndSems (sharedBufData **bufs, int *bufnames, int issend)
void initSendQ (SysvshmSendQ *q, int size)
OutgoingMsg popSendQ (SysvshmSendQ *q)
void emptyRecvBuf (sharedBufData *recvBuf)
static void handoverSysvshmMessage (char *newmsg, int total_size, int rank, int broot)
void ReceiveDatagram (int node)
int TransmitDatagram (int pe)
static void CmiCheckSocks ()
int CheckSocketsReady (int withDelayMs, int output)
static char * getMaxBuf ()
static void freeMaxBuf (char *buf)
static void IntegrateMessageDatagram (char **msg, int len)
static void open_tcp_sockets ()
static void InternalPrintf (const char *f, va_list l)
int printf (const char *fmt,...)
int CmemInsideMem ()
void CmemCallWhenMemAvail ()
static void ConverseRunPE (int everReturn)
void CmiYield (void)
void ConverseCommonExit (void)
void TokenUpdatePeriodic ()
void getAvailSysMem ()
static void CmiDestoryLocks ()
static void machine_exit (int status)
static void charmrun_abort (const char *)
static void KillEveryone (const char *msg)
static void KillEveryoneCode (int n)
static void KillOnAllSigs (int sigNo)

Variables

static int Cmi_max_dgram_size
static int Cmi_os_buffer_size
static int Cmi_window_size
static int Cmi_half_window
static double Cmi_delay_retransmit
static double Cmi_ack_delay
static int Cmi_dgram_max_data
static int Cmi_comm_periodic_delay
static int Cmi_comm_clock_delay
static int writeableAcks
static int writeableDgrams
static OtherNodenodes_by_pe
static OtherNode nodes
static char statstr [10000]
 Printing Net Statistics -- milind.
static ExplicitDgram Cmi_freelist_explicit
static ImplicitDgram Cmi_freelist_implicit
static int ctrlskt_ready_read
static int dataskt_ready_read
static int dataskt_ready_write
static double Cmi_ack_last
static double Cmi_check_last
int CmiIdleState::nIdles
CmiState CmiIdleState::cs
int getSrcHandler
int getDestHandler
static gm_alarm_t gmalarm
static FILE * gmf
static intgm_stats
static int possible_streamed = 0
static int defrag = 0
static int maxQueueLength = 0
static int pendinglen = 0
static PendingMsg pend_freelist = NULL
static char * msgpool [MAXMSGLEN]
static int msgNums = 0
static int maxMsgSize = 0
static int maxsize
enum ibv_mtu mtu = IBV_MTU_2048
static int mtu_size
static int maxrecvbuffers
static int maxtokens
static int firstBinSize
static int blockThreshold
static int blockAllocRatio
static int packetsize
struct ibv_device * ibudstruct::dev
struct ibudstruct ibud
int infiPacketHeader::nodeNo
int infiPacketStruct::size
char infiPacketStruct::extra [40]
struct infiPacketHeader infiPacketStruct::header
struct ibv_mr * infiPacketStruct::keyHeader
struct OtherNodeStructinfiPacketStruct::destNode
struct infiPacketStructinfiPacketStruct::next
OutgoingMsg infiPacketStruct::ogm
struct ibv_sge infiPacketStruct::elemList [2]
struct ibv_send_wr infiPacketStruct::wr
fd_set infiContext::asyncFds
struct timeval infiContext::tmo
int infiContext::ibPort
struct ibv_pd * infiContext::pd
struct ibv_cq * infiContext::sendCq
struct ibv_cq * infiContext::recvCq
struct ibv_srq * infiContext::srq
struct ibv_mr * infiContext::mr
struct ibv_ah ** infiContext::ah
struct ibv_qp * infiContext::qp
struct infiAddr infiContext::localAddr
struct infiBufferPoolinfiContext::recvBufferPool
infiPacket infiContext::infiPacketFreeList
struct infiPacketHeader infiContext::header
int infiContext::sendCqSize
int infiContext::recvCqSize
void * infiContext::buffer
static struct infiContextcontext
int infiOtherNodeData::totalTokens
int infiOtherNodeData::tokensLeft
int infiOtherNodeData::nodeNo
int infiOtherNodeData::postedRecvs
int infiOtherNodeData::broot
struct infiAddr infiOtherNodeData::qp
char * infiBuffer::buf
int infiBuffer::size
struct ibv_mr * infiBuffer::key
int infiCmiChunkMetaDataStruct::poolIdx
void * infiCmiChunkMetaDataStruct::nextBuf
struct infiCmiChunkHeaderStructinfiCmiChunkMetaDataStruct::owner
int infiCmiChunkMetaDataStruct::count
struct infiBufferinfiBufferPool::buffers
struct infiBufferPoolinfiBufferPool::next
static const char *const __ibv_wc_status_str []
void * infiCmiChunkPool::startBuf
int infiCmiChunkPool::count
infiCmiChunkPool infiCmiChunkPools [INFINUMPOOLS]
enum ibv_mtu mtu = IBV_MTU_2048
static int page_size
static int mtu_size
static int packetSize
static int dataSize
static int rdma
static int rdmaThreshold
static int firstBinSize
static int blockAllocRatio
static int blockThreshold
static int maxRecvBuffers
static int maxTokens
static int sendPacketPoolSize
static double _startTime = 0
static int regCount
static int pktCount
static int msgCount
static int minTokensLeft
static double regTime
static double processBufferedTime
static int processBufferedCount
static int numReg = 0
static int numUnReg = 0
static int numCurReg = 0
static int numAlloc = 0
static int numFree = 0
static int numMultiSendUnreg = 0
static int numMultiSend = 0
static int numMultiSendFree = 0
PCQueue ** queuePool
int infiPacketHeader::psn
int infiRdmaPacket::type
struct ibv_mr infiRdmaPacket::key
struct ibv_mr * infiRdmaPacket::keyPtr
int infiRdmaPacket::remoteSize
char * infiRdmaPacket::remoteBuf
void * infiRdmaPacket::localBuffer
OutgoingMsg infiRdmaPacket::ogm
struct infiRdmaPacketinfiRdmaPacket::next
struct infiRdmaPacketinfiRdmaPacket::prev
char * infiBuffer::buf
struct ibv_mr * infiBuffer::key
struct infiBufferinfiBufferPool::buffers
struct infiBufferPoolinfiBufferPool::next
struct ibv_mr * infiPacketStruct::keyHeader
struct OtherNodeStructinfiPacketStruct::destNode
struct infiPacketStructinfiPacketStruct::next
int infiBufferedBcastStruct::size
int infiBufferedBcastStruct::broot
int infiBufferedBcastStruct::asm_rank
int infiBufferedBcastStruct::valid
struct infiBufferedBcastStruct infiBufferedBcastPoolStruct::bcastList [BCASTLIST_SIZE]
int infiBufferedBcastPoolStruct::count
struct ibv_pd * infiContext::pd
struct ibv_cq * infiContext::sendCq
struct ibv_cq * infiContext::recvCq
struct ibv_srq * infiContext::srq
struct ibv_qp ** infiContext::qp
struct infiAddrinfiContext::localAddr
struct infiBufferPoolinfiContext::recvBufferPool
int infiContext::srqSize
int infiContext::tokensLeft
infiBufferedBcastPool infiContext::bufferedBcastList
struct infiRdmaPacketinfiContext::bufferedRdmaAcks
struct infiRdmaPacketinfiContext::bufferedRdmaRequests
int infiContext::insideProcessBufferedBcasts
static struct infiContextcontext
int infiOtherNodeData::state
int infiOtherNodeData::psn
int infiOtherNodeData::recvPsn
void * infiCmiChunkMetaDataStruct::nextBuf
struct infiCmiChunkHeaderStructinfiCmiChunkMetaDataStruct::owner
int infiCmiChunkMetaDataStruct::parentPe
void * infiCmiChunkPool::startBuf
infiCmiChunkPool ** infiCmiChunkPools
static unsigned int _count = 0
int errno
static int _countAsync = 0
int infiDirectRequestPacket::handle
struct ibv_mr infiDirectRequestPacket::senderKey
void * infiDirectRequestPacket::senderBuf
int infiDirectRequestPacket::senderBufSize
struct directPollingQNodeStructdirectPollingQNodeStruct::next
double * directPollingQNodeStruct::lastDouble
void * infiDirectHandleStruct::buf
int infiDirectHandleStruct::size
struct ibv_mr * infiDirectHandleStruct::key
void(* infiDirectHandleStruct::callbackFnPtr )(void *)
void * infiDirectHandleStruct::callbackData
struct infiDirectUserHandle infiDirectHandleStruct::userHandle
struct infiRdmaPacketinfiDirectHandleStruct::rdmaPacket
directPollingQNode infiDirectHandleStruct::pollingQNode
struct
infiDirectHandleTableStruct
infiDirectHandleTableStruct::next
directPollingQNodeheadDirectPollingQ = NULL
directPollingQNodetailDirectPollingQ = NULL
static infiDirectHandleTable ** sendHandleTable = NULL
static infiDirectHandleTable ** recvHandleTable = NULL
static intrecvHandleCount = NULL
static PendingSentMsg pmpool [MAXPMS]
static int pmNums = 0
static PendingSentMsg sent_handles = NULL
static PendingSentMsg sent_handles_end = NULL
CmiUInt8 MATCH_FILTER = 0x11111111FFFFFFFFLL
CmiUInt8 MATCH_MASK = 0xffffffffffffffffLL
static volatile int gotone = 0
static int maxsize
int sharedBufHeader::bytes
OSSpinLock sharedBufHeader::lock
volatile int sharedBufHeader::flagSender
volatile int sharedBufHeader::flagReceiver
volatile int sharedBufHeader::turn
sharedBufHeadersharedBufData::header
char * sharedBufData::data
int PxshmSendQ::begin
int PxshmSendQ::end
int PxshmSendQ::numEntries
OutgoingMsgPxshmSendQ::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
PxshmContextpxshmContext = NULL
int sharedBufData::shmid
sharedBufHeadersharedBufData::header
char * sharedBufData::data
int SysvshmSendQ::begin
int SysvshmSendQ::end
int SysvshmSendQ::numEntries
OutgoingMsgSysvshmSendQ::data
int SysvshmContext::noderank
int SysvshmContext::nodestart
int SysvshmContext::nodeend
ushort * SysvshmContext::semarray
intSysvshmContext::sendbufnames
intSysvshmContext::recvbufnames
sharedBufDataSysvshmContext::recvBufs
sharedBufDataSysvshmContext::sendBufs
SysvshmSendQ ** SysvshmContext::sendQs
int SysvshmContext::sendCount
int SysvshmContext::validCheckCount
int SysvshmContext::lockRecvCount
double SysvshmContext::validCheckTime
double SysvshmContext::sendTime
double SysvshmContext::commServerTime
SysvshmContextsysvshmContext = NULL
static char sockReadStates [1000] = {0}
static char sockWriteStates [1000] = {0}
static char * maxbuf = NULL
int _kq = -1
struct gm_port * gmport = NULL
int portFinish = 0
mx_endpoint_t endpoint
mx_endpoint_addr_t endpoint_addr
int MX_FILTER = 123456
static uint64_t Cmi_nic_id = 0
int Cmi_commthread = 0
int putSrcHandler
int putDestHandler
int getSrcHandler
int getDestHandler
static unsigned int dataport = 0
static int Cmi_mach_id = 0
static SOCKET dataskt
static int machine_initiated_shutdown = 0
static int already_in_signal_handler = 0


Detailed Description

NET implementation of machine layer, ethernet in particular

THE DATAGRAM STREAM.

Messages are sent using UDP datagrams. The sender allocates a struct for each datagram to be sent. These structs stick around until slightly after the datagram is acknowledged.

Datagrams are transmitted node-to-node (as opposed to pe-to-pe). Each node has an OtherNode struct for every other node in the system. The OtherNode struct contains:

send_queue (all datagram-structs not yet transmitted) send_window (all datagram-structs transmitted but not ack'd)

When an acknowledgement comes in, all packets in the send-window are either marked as acknowledged or pushed back into the send queue for retransmission.

THE OUTGOING MESSAGE

When you send or broadcast a message, the first thing the system does is system creates an OutgoingMsg struct to represent the operation. The OutgoingMsg contains a very direct expression of what you want to do:

OutgoingMsg:

size --- size of message in bytes data --- pointer to the buffer containing the message src --- processor which sent the message dst --- destination processor (-1=broadcast, -2=broadcast all) freemode --- see below. refcount --- see below.

The OutgoingMsg is kept around until the transmission is done, then it is garbage collected --- the refcount and freemode fields are to assist garbage collection.

The freemode indicates which kind of buffer-management policy was used (sync, async, or freeing). The sync policy is handled superficially by immediately converting sync sends into freeing sends. Thus, the freemode can either be 'A' (async) or 'F' (freeing). If the freemode is 'F', then garbage collection involves freeing the data and the OutgoingMsg structure itself. If the freemode is 'A', then the only cleanup is to change the freemode to 'X', a condition which is then detectable by CmiAsyncMsgSent. In this case, the actual freeing of the OutgoingMsg is done by CmiReleaseCommHandle.

When the transmission is initiated, the system computes how many datagrams need to be sent, total. This number is stored in the refcount field. Each time a datagram is delivered, the refcount is decremented, when it reaches zero, cleanup is performed. There are two exceptions to this rule. Exception 1: if the OutgoingMsg is a send (not a broadcast) and can be performed with shared memory, the entire datagram system is bypassed, the message is simply delivered and freed, not using the refcount mechanism at all. Exception 2: If the message is a broadcast, then part of the broadcast that can be done via shared memory is performed prior to initiating the datagram/refcount system.

DATAGRAM FORMATS AND MESSAGE FORMATS

Datagrams have this format:

srcpe (16 bits) --- source processor number. magic ( 8 bits) --- magic number to make sure DG is good. dstrank ( 8 bits) --- destination processor rank. seqno (32 bits) --- packet sequence number. data (XX byte) --- user data.

The only reason the srcpe is in there is because the receiver needs to know which receive window to use. The dstrank field is needed because transmission is node-to-node. Once the message is assembled by the node, it must be delivered to the appropriate PE. The dstrank field is used to encode certain special-case scenarios. If the dstrank is DGRAM_BROADCAST, the transmission is a broadcast, and should be delivered to all processors in the node. If the dstrank is DGRAM_ACKNOWLEDGE, the datagram is an acknowledgement datagram, in which case the srcpe is the number of the acknowledger, the seqno is always zero, and the user data is a list of the seqno's being acknowledged. There may be other dstrank codes for special functions.

To send a message, one chops it up into datagrams and stores those datagrams in a send-queue. These outgoing datagrams aren't stored in the explicit format shown above. Instead, they are stored as ImplicitDgrams, which contain the datagram header and a pointer to the user data (which is in the user message buffer, which is in the OutgoingMsg). At transmission time these are combined together.

The combination of the datagram header with the user's data is performed right in the user's message buffer. Note that the datagram header is exactly 64 bits. One simply overwrites 64 bits of the user's message with a datagram header, sends the datagram straight from the user's message buffer, then restores the user's buffer to its original state. There is a small problem with the first datagram of the message: one needs 64 bits of space to store the datagram header. To make sure this space is there, we added a 64-bit unused space to the front of the Cmi message header. In addition to this, we also add 32 bits to the Cmi message header to make room for a length-field, making it possible to identify message boundaries.

CONCURRENCY CONTROL

This has changed recently.

EFFICIENCY NOTES

The sender-side does little copying. The async and freeing send routines do no copying at all. The sync send routines copy the message, then use the freeing-send routines. The other alternative is to not copy the message, and use the async send mechanism combined with a blocking wait. Blocking wait seems like a bad idea, since it could take a VERY long time to get all those datagrams out the door.

The receiver side, unfortunately, must copy. To avoid copying, it would have to receive directly into a preallocated message buffer. Unfortunately, this can't work: there's no way to know how much memory to preallocate, and there's no way to know which datagram is coming next. Thus, we receive into fixed-size (large) datagram buffers. These are then inspected, and the messages extracted from them.

Note that we are allocating a large number of structs: OutgoingMsg's, ImplicitDgrams, ExplicitDgrams. By design, each of these structs is a fixed-size structure. Thus, we can do memory allocation by simply keeping a linked-list of unused structs around. The only place where expensive memory allocation is performed is in the sync routines.

Since the datagrams from one node to another are fully ordered, there is slightly more ordering than is needed: in theory, the datagrams of one message don't need to be ordered relative to the datagrams of another. This was done to simplify the sequencing mechanisms: implementing a fully-ordered stream is much simpler than a partially-ordered one. It also makes it possible to modularize, layering the message transmitter on top of the datagram-sequencer. In other words, it was just easier this way. Hopefully, this won't cause serious degradation: LAN's rarely get datagrams out of order anyway.

A potential efficiency problem is the lack of message-combining. One datagram could conceivably contain several messages. This might be more efficient, it's not clear how much overhead is involved in sending a short datagram. Message-combining isn't really ``integrated'' into the design of this software, but you could fudge it as follows. Whenever you pull a short datagram from the send-queue, check the next one to see if it's also a short datagram. If so, pack them together into a ``combined'' datagram. At the receive side, simply check for ``combined'' datagrams, and treat them as if they were simply two datagrams. This would require extra copying. I have no idea if this would be worthwhile.


Typedef Documentation

typedef struct OutgoingMsgStruct * OutgoingMsg

typedef struct OtherNodeStruct * OtherNode

typedef struct PendingMsgStruct * PendingMsg

typedef struct CmiCb CmiCb

Definition at line 1060 of file machine-gm.c.

typedef struct CmiRMA CmiRMA

Definition at line 1069 of file machine-gm.c.

typedef struct CmiRMAMsg CmiRMAMsg

Definition at line 1075 of file machine-gm.c.

typedef struct RMAPutMsg RMAPutMsg

Definition at line 1087 of file machine-gm.c.

typedef struct infiPacketStruct* infiPacket

typedef struct infiPacketStruct* infiPacket


Enumeration Type Documentation

Enumerator:
QP_CONN_STATE_PRE_CONNECT 
QP_CONN_STATE_CONNECTED 
QP_CONN_STATE_CONNECTION_LOST 
QP_CONN_STATE_CONNECTION_CLOSED 

Definition at line 259 of file machine-dgram.c.

anonymous enum

Enumerator:
INFI_HEADER_DATA 
INFI_DATA 

Definition at line 123 of file machine-ibud.c.

anonymous enum

Stored in the OtherNode structure in machine-dgram.c Store the per node data for ibverbs layer.

Enumerator:
INFI_HEADER_DATA 
INFI_DATA 

Definition at line 296 of file machine-ibverbs.c.

enum entities

Enumerator:
SENDER 
RECEIVER 

Definition at line 81 of file machine-pxshm.c.


Function Documentation

unsigned char computeCheckSum ( unsigned char *  data,
int  len 
)

static void randomCorrupt ( char *  data,
int  len 
) [static]

Definition at line 82 of file machine-dgram.c.

Referenced by ReceiveDatagram().

static void setspeed_atm (  )  [static]

Definition at line 113 of file machine-dgram.c.

References Cmi_ack_delay, and Cmi_delay_retransmit.

Referenced by extract_args().

static void setspeed_eth (  )  [static]

Definition at line 122 of file machine-dgram.c.

References Cmi_ack_delay, and Cmi_delay_retransmit.

Referenced by extract_args().

static void setspeed_gigabit (  )  [static]

Definition at line 131 of file machine-dgram.c.

References Cmi_ack_delay, and Cmi_delay_retransmit.

Referenced by extract_args().

static void extract_args ( char **  argv  )  [static]

struct infiOtherNodeData * initinfiData ( int  node,
int  lid,
int  qpn,
int  psn 
) [read]

struct infiOtherNodeData * initInfiOtherNodeData ( int  node,
int  addr[3] 
) [read]

void infiPostInitialRecvs (  ) 

void CommunicationServerSysvshm (  )  [inline]

void CommunicationServerPxshm (  )  [inline]

static void OtherNode_init ( OtherNode  node  )  [static]

int CmiLongSendQueue ( int  forNode,
int  longerThan 
)

Return 1 if our outgoing message queue for this node is longer than this many bytes.

Definition at line 472 of file machine-dgram.c.

References CmiCommLock(), CmiCommUnlock(), ImplicitDgramStruct::datalen, ImplicitDgramStruct::next, and OtherNodeStruct::send_queue_h.

void CmiGmConvertMachineID ( unsigned int mach_id  ) 

Definition at line 992 of file machine-gm.c.

Referenced by node_addresses_store().

void CmiAmmassoNodeAddressesStoreHandler ( int  pe,
struct sockaddr_in *  addr,
int  port 
)

static void node_addresses_store ( ChMessage msg  )  [static]

void printNetStatistics ( void   ) 

void GarbageCollectMsg ( OutgoingMsg  ogm  ) 

void DiscardImplicitDgram ( ImplicitDgram  dg  ) 

static void CommunicationsClock ( void   )  [static]

static void CommunicationsClockCaller ( void *  ignored  )  [static]

Definition at line 762 of file machine-dgram.c.

References CcdCallFnAfter(), CmiCommLock(), CmiCommUnlock(), and CommunicationsClock().

Referenced by KillOnAllSigs().

static void CommunicationPeriodic ( void   )  [static]

static void CommunicationPeriodicCaller ( void *  ignored  )  [static]

Definition at line 781 of file machine-dgram.c.

References CcdCallFnAfter(), and CommunicationPeriodic().

void DeliverViaNetwork ( OutgoingMsg  ogm,
OtherNode  node,
int  rank,
unsigned int  broot,
int  copy 
)

void SendSpanningChildren ( OutgoingMsg  ogm,
int  root,
int  size,
char *  msg,
unsigned int  startpe,
int  nodesend 
)

void SendHypercube ( OutgoingMsg  ogm,
int  root,
int  size,
char *  msg,
unsigned int  curcycle,
int  nodesend 
)

int CmiBarrier ( void   ) 

The call of CmiBarrier is usually before the initialization of trace module of Charm++, therefore, the START_EVENT and END_EVENT are disabled here. -Chao Mei

Definition at line 837 of file machine-dgram.c.

int CmiBarrierZero ( void   ) 

Definition at line 842 of file machine-dgram.c.

static CmiIdleState* CmiNotifyGetState ( void   )  [static]

static void CmiNotifyBeginIdle ( CmiIdleState s  )  [static]

Definition at line 41 of file machine-eth.c.

References CmiIdleState::nIdles, and CmiIdleState::sleepMs.

static void CmiNotifyStillIdle ( CmiIdleState s  )  [static]

void CmiNotifyIdle ( void   ) 

Definition at line 79 of file machine-eth.c.

References CmiNotifyStillIdle(), s, and CmiIdleState::sleepMs.

int CheckSocketsReady ( int  withDelayMs  ) 

void TransmitAckDatagram ( OtherNode  node  ) 

int TransmitImplicitDgram ( ImplicitDgram  dg  ) 

void TransmitImplicitDgram1 ( ImplicitDgram  dg  ) 

int TransmitAcknowledgement (  ) 

int TransmitDatagram (  ) 

void EnqueueOutgoingDgram ( OutgoingMsg  ogm,
char *  ptr,
int  len,
OtherNode  node,
int  rank,
int  broot 
)

void AssembleDatagram ( OtherNode  node,
ExplicitDgram  dg 
)

void AssembleReceivedDatagrams ( OtherNode  node  ) 

void IntegrateMessageDatagram ( ExplicitDgram  dg  ) 

void IntegrateAckDatagram ( ExplicitDgram  dg  ) 

void ReceiveDatagram (  ) 

void CmiHandleImmediate (  ) 

static void CommunicationServer ( int  sleepTime,
int  where 
) [static]

void CmiMachineInit ( char **  argv  ) 

void CmiCommunicationInit ( char **  argv  ) 

Definition at line 821 of file machine-eth.c.

void CmiMachineExit (  ) 

static void sendBarrierMessage ( int  pe  )  [static]

Definition at line 829 of file machine-eth.c.

References OtherNodeStruct::addr, dataskt, and nodes.

Referenced by CmiBarrier(), and CmiBarrierZero().

static void recvBarrierMessage (  )  [static]

Definition at line 844 of file machine-eth.c.

References dataskt, and s.

Referenced by CmiBarrier(), and CmiBarrierZero().

void handleGetSrc ( void *  msg  ) 

void handleGetDest ( void *  msg  ) 

void enqueue_sending ( char *  msg,
int  length,
OtherNode  node,
int  size 
)

static void alarmcallback ( void *  context  )  [static]

Definition at line 143 of file machine-gm.c.

static int processEvent ( gm_recv_event_t *  e  )  [static]

Definition at line 466 of file machine-gm.c.

References msg, processMessage(), size, and status().

Referenced by CommunicationServer_nolock().

static void send_progress (  )  [static]

static void alarmInterrupt ( int  arg  )  [static]

static int gmExit ( int  code,
const char *  msg 
) [static]

Definition at line 1026 of file machine-gm.c.

References machine_exit().

static char * getErrorMsg ( gm_status_t  status  )  [static]

Definition at line 1033 of file machine-gm.c.

Referenced by PumpEvents(), recv_callback(), and send_callback().

static void ServiceCharmrun_nolock (  )  [static]

Definition at line 293 of file machine-gm.c.

References CheckSocketsReady(), and ctrlskt_ready_read.

static void CommunicationServer_nolock ( int  withDelayMs  )  [static]

Definition at line 307 of file machine-gm.c.

References processEvent().

static void processMessage ( char *  msg,
int  len 
) [static]

void drop_send_callback ( struct gm_port *  p,
void *  context,
gm_status_t  status 
)

Definition at line 507 of file machine-gm.c.

References CmiMyPe(), PendingMsgStruct::msg, msg, and printf().

Referenced by send_callback().

void send_callback ( struct gm_port *  p,
void *  context,
gm_status_t  status 
)

static void send_callback_nothing ( struct gm_port *  p,
void *  context,
gm_status_t  status 
) [static]

Definition at line 751 of file machine-gm.c.

void CmiCheckGmStatus (  ) 

void* CmiDMAAlloc ( int  size  ) 

Definition at line 1089 of file machine-gm.c.

int CmiRegisterMemory ( void *  addr,
unsigned int  size 
)

Definition at line 1095 of file machine-gm.c.

References CmiPrintf().

int CmiUnRegisterMemory ( void *  addr,
unsigned int  size 
)

Definition at line 1107 of file machine-gm.c.

References CmiPrintf().

void put_callback ( struct gm_port *  p,
void *  context,
gm_status_t  status 
)

void* CmiPut ( unsigned int  sourceId,
unsigned int  targetId,
void *  Saddr,
void *  Taddr,
unsigned int  size 
)

void CmiPutCb ( unsigned int  sourceId,
unsigned int  targetId,
void *  Saddr,
void *  Taddr,
unsigned int  size,
CmiRdmaCallbackFn  fn,
void *  param 
)

void get_callback_dest ( struct gm_port *  p,
void *  context,
gm_status_t  status 
)

void* CmiGet ( unsigned int  sourceId,
unsigned int  targetId,
void *  Saddr,
void *  Taddr,
unsigned int  size 
)

void CmiGetCb ( unsigned int  sourceId,
unsigned int  targetId,
void *  Saddr,
void *  Taddr,
unsigned int  size,
CmiRdmaCallbackFn  fn,
void *  param 
)

int CmiWaitTest ( void *  obj  ) 

Definition at line 1321 of file machine-gm.c.

References CmiRMA::completed, CmiRMA::ready, and RMAPutMsg::stat.

const char* ibv_wc_status_str ( enum ibv_wc_status  status  ) 

Definition at line 191 of file machine-ibud.c.

References __ibv_wc_status_str.

Referenced by pollCq().

void infi_unregAndFreeMeta ( void *  md  ) 

Definition at line 225 of file machine-ibud.c.

References free().

Referenced by infi_freeMultipleSend().

static void * getInfiCmiChunk ( int  dataSize  )  [inline, static]

void* infi_CmiAlloc ( int  size  ) 

Definition at line 318 of file machine-ibud.c.

References CmiMemLock(), CmiMemUnlock(), getInfiCmiChunk(), and getInfiCmiChunkThread().

Referenced by CmiAlloc().

void infi_CmiFree ( void *  ptr  ) 

this is a part of a received mult message it will be freed correctly later

Definition at line 335 of file machine-ibud.c.

References CmiMemLock(), CmiMemUnlock(), CmiMyRank(), infiCmiChunkPool::count, free(), infi_CmiFreeDirect(), size, and infiCmiChunkPool::startBuf.

Referenced by CmiFree().

static void initInfiCmiChunkPools (  )  [static]

There are INFINUMPOOLS of memory.

The first pool is of size firstBinSize. The ith pool is of size firstBinSize*2^i

Definition at line 391 of file machine-ibud.c.

References infiCmiChunkPool::count, infiCmiChunkPool::size, size, and infiCmiChunkPool::startBuf.

void postInitialRecvs ( struct infiBufferPool recvBufferPool,
int  numRecvs,
int  sizePerBuffer 
)

Post the buffers as recv work requests.

Definition at line 413 of file machine-ibud.c.

References infiBuffer::buf, infiBufferPool::buffers, free(), infiBuffer::key, malloc(), and infiContext::qp.

Referenced by increasePostedRecvs(), and infiPostInitialRecvs().

struct infiBufferPool * allocateInfiBufferPool ( int  numRecvs,
int  sizePerBuffer 
) [read]

static void CommunicationServer_lock ( int  toBuffer  )  [inline, static]

Definition at line 969 of file machine-ibud.c.

References CmiCommLock(), CmiCommUnlock(), and CommunicationServer_nolock().

static infiPacket newPacket (  )  [inline, static]

static void EnqueuePacket ( OtherNode  node,
infiPacket  packet,
int  size,
struct ibv_mr *  dataKey 
) [inline, static]

static void EnqueueDataPacket ( OutgoingMsg  ogm,
char *  data,
int  size,
OtherNode  node,
int  rank,
int  broot 
) [inline, static]

static void handoverMessage ( char *  newmsg,
int  total_size,
int  rank,
int  broot,
int  toBuffer 
) [inline, static]

static void processMessage ( int  nodeNo,
int  len,
char *  msg,
const int  toBuffer 
) [inline, static]

This simple state machine determines if this packet marks the beginning of a new message

if this packet was the last packet in a message ie state was reset to infi_header_data

Definition at line 804 of file machine-ibud.c.

References OtherNodeStruct::asm_fill, OtherNodeStruct::asm_msg, OtherNodeStruct::asm_rank, OtherNodeStruct::asm_total, infiOtherNodeData::broot, Cmi_dgram_max_data, CmiAbort(), CmiAlloc(), CmiPrintf(), INFI_DATA, INFI_HEADER_DATA, OtherNodeStruct::infiData, infiOtherNodeData::nodeNo, nodes, and infiOtherNodeData::state.

static void processSendWC ( struct ibv_wc *  sendWC  )  [inline]

Definition at line 870 of file machine-ibud.c.

Referenced by pollCq(), and pollSendCq().

static void processRecvWC ( struct ibv_wc *  recvWC,
const int  toBuffer 
) [inline]

static int pollCq ( const int  toBuffer,
struct ibv_cq *  cq 
) [inline, static]

Definition at line 919 of file machine-ibud.c.

References CmiAbort(), ibv_wc_status_str(), processRecvWC(), processSendWC(), and status().

static uint16_t getLocalLid ( struct ibv_context *  dev_context,
int  port 
) [static]

Definition at line 998 of file machine-ibud.c.

Referenced by createLocalQps(), and createqp().

struct infiAddr* initinfiAddr ( int  node,
int  lid,
int  qpn,
int  psn 
) [read]

Definition at line 1007 of file machine-ibud.c.

References infiAddr::lid, malloc(), infiAddr::psn, and infiAddr::qpn.

void createqp ( struct ibv_device *  dev  ) 

void createah (  ) 

void infi_CmiFreeDirect ( void *  ptr  ) 

static void fillBufferPools (  )  [inline, static]

static int pollSendCq ( const int  toBuffer  )  [inline, static]

void createLocalQps ( struct ibv_device *  dev,
int  ibPort,
int  myNode,
int  numNodes,
struct infiAddr localAddr 
)

static int checkQp ( struct ibv_qp *  qp  )  [static]

Definition at line 420 of file machine-ibverbs.c.

Referenced by checkAllQps().

static void checkAllQps (  )  [static]

static void send_partial_init (  )  [static]

Referenced by KillOnAllSigs().

void copyInfiAddr ( ChInfiAddr qpList  ) 

static void increaseTokens ( OtherNode  node  )  [inline, static]

static int pollRecvCq ( const int  toBuffer  )  [inline, static]

Definition at line 1317 of file machine-ibverbs.c.

References CmiAbort(), processRecvWC(), infiContext::recvCq, and status().

static void getFreeTokens ( struct infiOtherNodeData infiData  )  [inline, static]

Definition at line 964 of file machine-ibverbs.c.

References CommunicationServer_nolock(), and infiContext::tokensLeft.

Referenced by processRdmaRequest().

static void EnqueueDummyPacket ( OtherNode  node,
int  size 
) [inline, static]

static void EnqueueDataPacket ( OutgoingMsg  ogm,
OtherNode  node,
int  rank,
char *  data,
int  size,
int  broot,
int  copy 
) [inline, static]

static void EnqueueRdmaPacket ( OutgoingMsg  ogm,
OtherNode  node 
) [inline, static]

static void processAllBufferedMsgs (  )  [inline, static]

static void processAsyncEvents (  )  [inline, static]

static void pollCmiDirectQ (  )  [static]

has been received and delete this node

first in the pollingQ

only node in pollingQ

last node is being deleted

Definition at line 3126 of file machine-ibverbs.c.

References CmiPrintf(), directPollingQNodeStruct::handle, headDirectPollingQ, directPollingQNodeStruct::next, receivedDirectMessage(), infiDirectUserHandle::recverBuf, tailDirectPollingQ, and infiDirectHandleStruct::userHandle.

static void processRdmaWC ( struct ibv_wc *  rdmaWC,
const int  toBuffer 
) [inline, static]

static void insertBufferedBcast ( char *  msg,
int  size,
int  broot,
int  asm_rank 
) [static]

static void increasePostedRecvs ( int  nodeNo  )  [inline, static]

static void processRdmaRequest ( struct infiRdmaPacket rdmaPacket,
int  fromNodeNo,
int  isBuffered 
) [inline, static]

static void processRdmaAck ( struct infiRdmaPacket rdmaPacket  )  [inline, static]

static void EnqueueRdmaAck ( struct infiRdmaPacket rdmaPacket  )  [inline, static]

static void processDirectWC ( struct infiRdmaPacket rdmaPacket  )  [inline, static]

static infiBufferedBcastPool createBcastPool (  )  [inline, static]

static void processBufferedBcast (  )  [inline, static]

static void processBufferedRdmaAcks (  )  [inline, static]

static void processBufferedRdmaRequests (  )  [inline, static]

infiCmiChunkMetaData* registerMultiSendMesg ( char *  msg,
int  size 
) [read]

static void* getInfiCmiChunkThread ( int  dataSize  )  [inline, static]

void addHandleToPollingQ ( infiDirectHandle handle  ) 

static infiDirectHandleTable** createHandleTable (  )  [inline, static]

Definition at line 2792 of file machine-ibverbs.c.

References _Cmi_numnodes, and malloc().

Referenced by CmiDirect_assocLocalBuffer(), and CmiDirect_createHandle().

static void calcHandleTableIdx ( int  handle,
int tableIdx,
int idx 
) [inline, static]

static void initializeLastDouble ( void *  recvBuf,
int  recvBufSize,
double  initialValue 
) [inline, static]

initialize the last double in the buffer to bufize

Definition at line 2806 of file machine-ibverbs.c.

Referenced by CmiDirect_createHandle(), CmiDirect_ready(), and CmiDirect_readyMark().

struct infiDirectUserHandle CmiDirect_createHandle ( int  senderNode,
void *  recvBuf,
int  recvBufSize,
void(*)(void *)  callbackFnPtr,
void *  callbackData,
double  initialValue 
) [read]

void CmiDirect_assocLocalBuffer ( struct infiDirectUserHandle userHandle,
void *  sendBuf,
int  sendBufSize 
)

void CmiDirect_put ( struct infiDirectUserHandle userHandle  ) 

void CmiDirect_readyMark ( struct infiDirectUserHandle userHandle  ) 

void CmiDirect_readyPollQ ( struct infiDirectUserHandle userHandle  ) 

void CmiDirect_ready ( struct infiDirectUserHandle userHandle  ) 

static int receivedDirectMessage ( infiDirectHandle handle  )  [static]

static const char * getErrorMsg ( mx_return_t  rc  )  [static]

Definition at line 914 of file machine-mx.c.

static void processStatusCode ( mx_status_t  status  )  [static]

Definition at line 927 of file machine-mx.c.

References CmiPrintf().

Referenced by recv_callback().

static void PumpMsgs ( int  getone  )  [static]

static void ReleaseSentMsgs ( void   )  [static]

Definition at line 385 of file machine-mx.c.

References PendingSentMsgStruct::handle, and PendingSentMsgStruct::next.

static void PumpEvents ( int  getone  )  [static]

void recv_callback ( void *  context,
uint64_t  match_info,
int  length 
)

void processFutureMessages ( OtherNode  node  ) 

void EnqueueOutgoingDgram ( OutgoingMsg  ogm,
char *  ptr,
int  dlen,
OtherNode  node,
int  rank,
int  broot,
int  copy 
)

void CmiMXMakeConnection (  ) 

void calculateNodeSizeAndRank ( char **  argv  ) 

void setupSharedBuffers (  ) 

void initAllSendQs (  ) 

void CmiInitPxshm ( char **  argv  ) 

void tearDownSharedBuffers (  ) 

void CmiExitPxshm (  ) 

int CmiValidPxshm ( OutgoingMsg  ogm,
OtherNode  node 
) [inline]

int PxshmRank ( int  dst  )  [inline]

Definition at line 269 of file machine-pxshm.c.

References PxshmContext::nodestart.

Referenced by CmiSendMessagePxshm().

void pushSendQ ( PxshmSendQ q,
OutgoingMsg  msg 
) [inline]

int sendMessage ( OutgoingMsg  ogm,
sharedBufData dstBuf,
PxshmSendQ dstSendQ 
) [inline]

int flushSendQ ( int  dstRank  )  [inline]

void CmiSendMessagePxshm ( OutgoingMsg  ogm,
OtherNode  node,
int  rank,
unsigned int  broot 
)

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

copy this message to sharedBuf

Definition at line 284 of file machine-pxshm.c.

References _Cmi_mynode, _Cmi_numnodes, PxshmSendQ::begin, sharedBufHeader::bytes, calculateNodeSizeAndRank(), CmiAlloc(), CmiGetArgIntDesc(), CmiMemoryCheck(), CmiNotifyStillIdle(), CmiPushPE(), CmiWallTimer(), PxshmContext::commServerTime, CommunicationServerPxshm(), sharedBufHeader::count, createShmObjectsAndSems(), PxshmSendQ::data, sharedBufData::data, OutgoingMsgStruct::data, OutgoingMsgStruct::dst, emptyAllRecvBufs(), emptyRecvBuf(), PxshmSendQ::end, errno, sharedBufHeader::flagReceiver, sharedBufHeader::flagSender, flushAllSendQs(), flushSendQ(), free(), GarbageCollectMsg(), sharedBufData::header, initAllSendQs(), initSendQ(), sharedBufHeader::lock, PxshmContext::lockRecvCount, malloc(), msg, sharedBufData::mutex, PxshmContext::nodeend, PxshmContext::noderank, PxshmContext::nodesize, PxshmContext::nodestart, PxshmSendQ::numEntries, popSendQ(), PxshmContext::prefixStr, printf(), ptr, pushSendQ(), PxshmRank(), RECEIVER, PxshmContext::recvBufNames, PxshmContext::recvBufs, OutgoingMsgStruct::refcount, s, PxshmContext::sendBufNames, PxshmContext::sendBufs, PxshmContext::sendCount, SENDER, SendHypercube(), sendMessage(), PxshmContext::sendQs, SendSpanningChildren(), PxshmContext::sendTime, setupSharedBuffers(), PxshmSendQ::size, size, OutgoingMsgStruct::size, OutgoingMsgStruct::src, tearDownSharedBuffers(), and sharedBufHeader::turn.

Referenced by KillOnAllSigs().

void CmiInitSysvshm ( char **  argv  ) 

void CmiExitSysvshm (  ) 

int CmiValidSysvshm ( OutgoingMsg  ogm,
OtherNode  node 
) [inline]

int SysvshmRank ( int  dst  )  [inline]

Definition at line 215 of file machine-sysvshm.c.

References SysvshmContext::nodestart.

Referenced by CmiSendMessageSysvshm().

void pushSendQ ( SysvshmSendQ q,
OutgoingMsg  msg 
) [inline]

int sendMessage ( OutgoingMsg  ogm,
sharedBufData dstBuf,
SysvshmSendQ dstSendQ 
) [inline]

void CmiSendMessageSysvshm ( OutgoingMsg  ogm,
OtherNode  node,
int  rank,
unsigned int  broot 
)

void emptyAllRecvBufs (  )  [inline]

void flushAllSendQs (  )  [inline]

static void CmiNotifyStillIdleSysvshm ( CmiIdleState s  )  [static]

Definition at line 312 of file machine-sysvshm.c.

References CommunicationServerSysvshm().

Referenced by KillOnAllSigs().

static void CmiNotifyBeginIdleSysvshm ( CmiIdleState s  )  [static]

Definition at line 317 of file machine-sysvshm.c.

References CmiNotifyStillIdle().

Referenced by KillOnAllSigs().

void createShmObjectsAndSems ( sharedBufData **  bufs,
int bufnames,
int  issend 
)

void initSendQ ( SysvshmSendQ q,
int  size 
)

OutgoingMsg popSendQ ( SysvshmSendQ q  )  [inline]

void emptyRecvBuf ( sharedBufData recvBuf  )  [inline]

static void handoverSysvshmMessage ( char *  newmsg,
int  total_size,
int  rank,
int  broot 
) [inline, static]

Definition at line 609 of file machine-sysvshm.c.

References CmiPushPE(), SendHypercube(), and SendSpanningChildren().

Referenced by emptyRecvBuf().

void ReceiveDatagram ( int  node  ) 

Definition at line 430 of file machine-tcp.c.

int TransmitDatagram (