
|
The machine layer of Converse consist of few common files to all architectures, shown in this module, which are:
Files | |
| file | machine.c |
| MPI based machine layer. | |
| file | immediate.c |
| Immediate message implementation. | |
| file | machine-smp.c |
| Common function reimplementation for SMP machines
OS Threads. | |
| file | machine-smp.h |
| structures for the SMP versions | |
| file | machine.h |
| common machine header | |
| file | pcqueue.h |
| Producer-Consumer Queues
This queue implementation enables a producer and a consumer to communicate via a queue. | |
| file | persist-comm.c |
| Support for persistent communication setup. | |
| file | machine.c |
| VMI machine layer. | |
| file | machine.h |
| VMI machine layer. | |
Modules | |
| NET | |
| NET implementation of machine layer, ethernet in particular
THE DATAGRAM STREAM. | |
Data Structures | |
| struct | CmiIdleLock |
| struct | CmiStateStruct |
| struct | CmiNodeStateStruct |
| struct | CmiMemorySMPSeparation_t |
| This data type is at least one cache line of padding, used to avoid cache line thrashing on SMP systems. More... | |
| struct | CircQueueStruct |
| The simple version of pcqueue has dropped the function of being expanded if the queue is full. More... | |
| struct | PCQueueStruct |
| struct | _PersistentRequestMsg |
| struct | _PersistentReqGrantedMsg |
| struct | _PersistentDestoryMsg |
Typedefs | |
| typedef struct CmiStateStruct * | CmiState |
| typedef struct CmiNodeStateStruct | CmiNodeState |
| typedef struct CircQueueStruct * | CircQueue |
| typedef struct PCQueueStruct * | PCQueue |
| typedef struct _PersistentRequestMsg | PersistentRequestMsg |
| typedef struct _PersistentReqGrantedMsg | PersistentReqGrantedMsg |
| typedef struct _PersistentDestoryMsg | PersistentDestoryMsg |
Functions | |
| void | CmiPushImmediateMsg (void *msg) |
| void | CmiDelayImmediate () |
| void | CmiHandleImmediateMessage (void *msg) |
| void | CmiHandleImmediate () |
| void | CmiStateInit (int pe, int rank, CmiState state) |
| void | CommunicationServerInit () |
| CmiState | CmiGetState () |
| CmiNodeLock | CmiCreateLock (void) |
| void | CmiDestroyLock (CmiNodeLock lk) |
| void | CmiYield (void) |
| static DWORD WINAPI | call_startfn (LPVOID vindex) |
| void | CmiNodeBarrierCount (int nThreads) |
| static void | CmiStartThreads (char **argv) |
| static void | CmiDestoryLocks () |
| void | CmiCommLock (void) |
| void | CmiCommUnlock (void) |
| static void * | call_startfn (void *vindex) |
| static PCQueue | PCQueueCreate (void) |
| static void | PCQueueDestroy (PCQueue Q) |
| static int | PCQueueEmpty (PCQueue Q) |
| static int | PCQueueLength (PCQueue Q) |
| static char * | PCQueueTop (PCQueue Q) |
| static char * | PCQueuePop (PCQueue Q) |
| CpvDeclare (PersistentSendsTable *, persistentSendsTableHead) | |
| CpvDeclare (PersistentSendsTable *, persistentSendsTableTail) | |
| CpvDeclare (int, persistentSendsTableCount) | |
| CpvDeclare (PersistentReceivesTable *, persistentReceivesTableHead) | |
| CpvDeclare (PersistentReceivesTable *, persistentReceivesTableTail) | |
| CpvDeclare (int, persistentReceivesTableCount) | |
| CpvDeclare (PersistentHandle *, phs) | |
| CpvDeclare (int, phsSize) | |
| CpvDeclare (int, curphs) | |
| void | initRecvSlot (PersistentReceivesTable *slot) |
| void | initSendSlot (PersistentSendsTable *slot) |
| void | swapSendSlotBuffers (PersistentSendsTable *slot) |
| void | swapRecvSlotBuffers (PersistentReceivesTable *slot) |
| PersistentHandle | getFreeSendSlot () |
| PersistentHandle | getFreeRecvSlot () |
| PersistentHandle | CmiCreatePersistent (int destPE, int maxBytes) |
| PersistentHandle | CmiCreateNodePersistent (int destNode, int maxBytes) |
| static void | persistentRequestHandler (void *env) |
| static void | persistentReqGrantedHandler (void *env) |
| PersistentReq | CmiCreateReceiverPersistent (int maxBytes) |
| PersistentHandle | CmiRegisterReceivePersistent (PersistentReq recvHand) |
| void | persistentDestoryHandler (void *env) |
| void | CmiDestoryPersistent (PersistentHandle h) |
| void | CmiDestoryAllPersistent () |
| void | CmiPersistentInit () |
| void | CmiUsePersistentHandle (PersistentHandle *p, int n) |
| void | CmiPersistentOneSend () |
Variables | |
| int | _immediateReady = 0 |
| int | _immRunning = 0 |
| static void * | currentImmediateMsg = NULL |
| static struct CmiStateStruct | Cmi_default_state |
| CmiNodeLock | CmiMemLock_lock |
| CmiNodeLock | cmiMemoryLock |
| static HANDLE | comm_mutex |
| static DWORD | Cmi_state_key = 0xFFFFFFFF |
| static CmiState | Cmi_state_vector = 0 |
| static volatile HANDLE | barrier_mutex = PTHREAD_MUTEX_INITIALIZER |
| static volatile int | barrier_wait [2] = {0,0} |
| static volatile int | barrier_which = 0 |
| int | _Cmi_noprocforcommthread = 0 |
| static __thread struct CmiStateStruct | Cmi_mystate |
| int | barrier = 0 |
| pthread_cond_t | barrier_cond = PTHREAD_COND_INITIALIZER |
| static int | comm_mutex_isLocked = 0 |
| FILE * | debugLog |
| int | CircQueueStruct::push |
| CmiMemorySMPSeparation_t | CircQueueStruct::pad1 |
| int | CircQueueStruct::pull |
| CmiMemorySMPSeparation_t | CircQueueStruct::pad2 |
| char * | CircQueueStruct::data [PCQueueSize] |
| CmiMemorySMPSeparation_t | PCQueueStruct::pad1 |
| CircQueue CMK_SMP_volatile | PCQueueStruct::tail |
| CmiMemorySMPSeparation_t | PCQueueStruct::pad2 |
| int | PCQueueStruct::len |
| CmiNodeLock | PCQueueStruct::lock |
| int | persistentRequestHandlerIdx |
| int | persistentReqGrantedHandlerIdx |
| int | persistentDestoryHandlerIdx |
| CmiNodeLock | CmiMemLock_lock |
| CmiNodeLock | cmiMemoryLock |
The machine layer of Converse consist of few common files to all architectures, shown in this module, which are:
These files describe the common characteristics of all implementations, and provide converse, and every language built on top of it the same functional interface in all machines, however different they are.
In addition to these common files, there are files called "machine.c" which are the real implementation for the different architectures. Every file is in a different directory, and get selected for compilation at compile time through the "build" script. With this implementation, only one single machine layer can be compiled into the runtime system. Changing architecture needs a different compilation.
| typedef struct CmiStateStruct * CmiState |
| typedef struct CmiNodeStateStruct CmiNodeState |
| typedef struct CircQueueStruct * CircQueue |
| typedef struct PCQueueStruct * PCQueue |
| typedef struct _PersistentRequestMsg PersistentRequestMsg |
| typedef struct _PersistentReqGrantedMsg PersistentReqGrantedMsg |
| typedef struct _PersistentDestoryMsg PersistentDestoryMsg |
| void CmiPushImmediateMsg | ( | void * | msg | ) |
Definition at line 35 of file immediate.c.
References CmiLock(), and CmiUnlock().
Referenced by CmiHandleImmediate(), CmiNotifyCommThd(), CmiPushNode(), CmiPushPE(), CmiSendNodeSelf(), CmiSendSelf(), and KillOnAllSigs().
| void CmiDelayImmediate | ( | ) |
Definition at line 55 of file immediate.c.
References CQdCreate(), and currentImmediateMsg.
Referenced by _processForNodeBocMsg(), CldAskLoadHandler(), and CkNodeReductionMgr::RecvMsg().
| void CmiHandleImmediateMessage | ( | void * | msg | ) |
Definition at line 72 of file immediate.c.
References CQdProcess(), CmiHandlerInfo::hdlr, and CmiHandlerInfo::userPtr.
Referenced by CmiHandleImmediate().
| void CmiHandleImmediate | ( | ) |
Definition at line 95 of file immediate.c.
References CmiHandleImmediateMessage(), CmiPushImmediateMsg(), CmiTryLock(), CmiUnlock(), currentImmediateMsg, msg, and PCQueuePop().
Referenced by AdvanceCommunication(), CmiSendNodeSelf(), CmiSendSelf(), CommunicationServer(), CommunicationServerThread(), KillOnAllSigs(), and SendMsgBuf().
Referenced by call_startfn(), CmiStartThreads(), and KillOnAllSigs().
| void CommunicationServerInit | ( | ) |
Definition at line 3445 of file convcore.c.
References CQdCpvInit().
Referenced by call_startfn(), and KillOnAllSigs().
| CmiState CmiGetState | ( | ) |
Definition at line 107 of file machine-smp.c.
References Cmi_default_state, and Cmi_state_key.
Referenced by CmiGetNonLocal(), CmiGetNonLocalNodeQ(), CmiMyPe(), CmiMyRank(), CmiNotifyGetState(), CmiPushPE(), CommunicationServer(), ConverseRunPE(), KillOnAllSigs(), MachineSpecificSendForMPI(), and PumpMsgsBlocking().
| CmiNodeLock CmiCreateLock | ( | void | ) |
Definition at line 119 of file machine-smp.c.
References malloc().
Referenced by _initCharm(), CkNodeReductionMgr::CkNodeReductionMgr(), CldModuleGeneralInit(), CmiAmmassoOpenQueuePairs(), CmiInitCPUAffinity(), CmiIsomallocBlockListPup(), CmiStartThreads(), ConverseInit(), craynid_init(), CsdInit(), establishQPConnection(), FEM_Init(), CkArrayReductionMgr::init(), LBDatabase::initnodeFn(), KillOnAllSigs(), LrtsInitCpuTopo(), mempool_init(), NodeGroup::NodeGroup(), PCQueueCreate(), PCQueuePop(), CkNodeReductionMgr::pup(), CkArrayReductionMgr::pup(), and SendMsgBuf().
| void CmiDestroyLock | ( | CmiNodeLock | lk | ) |
Definition at line 125 of file machine-smp.c.
References free().
Referenced by CmiMachineExit(), and NodeGroup::~NodeGroup().
| void CmiYield | ( | void | ) |
Definition at line 130 of file machine-smp.c.
Referenced by ConverseExit(), KillOnAllSigs(), and SendMsgBuf().
| static DWORD WINAPI call_startfn | ( | LPVOID | vindex | ) | [static] |
Definition at line 158 of file machine-smp.c.
References _Cmi_mynodesize, Cmi_state_key, CommunicationServerInit(), CommunicationServerThread(), ConverseRunPE(), and PerrorExit().
Referenced by CmiStartThreads().
| void CmiNodeBarrierCount | ( | int | nThreads | ) |
| static void CmiStartThreads | ( | char ** | argv | ) | [static] |
Definition at line 207 of file machine-smp.c.
References _Cmi_mynode, _Cmi_mynodesize, barrier_mutex, call_startfn(), calloc(), Cmi_commthread, Cmi_nodestart, Cmi_state_key, CmiCreateLock(), CmiStateInit(), comm_mutex, PerrorExit(), and printf().
| static void CmiDestoryLocks | ( | ) | [static] |
| void CmiCommLock | ( | void | ) |
Definition at line 368 of file machine-smp.c.
References CmiAbort(), and CmiLock().
Referenced by CmiLongSendQueue(), CommunicationsClockCaller(), CommunicationServer(), CommunicationServer_lock(), and KillOnAllSigs().
| void CmiCommUnlock | ( | void | ) |
Definition at line 374 of file machine-smp.c.
References CmiAbort(), and CmiUnlock().
Referenced by CmiLongSendQueue(), CommunicationsClockCaller(), CommunicationServer(), CommunicationServer_lock(), and KillOnAllSigs().
| static void* call_startfn | ( | void * | vindex | ) | [static] |
Definition at line 398 of file machine-smp.c.
References _Cmi_mynode, _Cmi_mynodesize, Cmi_mystate, Cmi_nodestart, Cmi_state_key, CmiStateInit(), CommunicationServer(), CommunicationServerInit(), and ConverseRunPE().
| static PCQueue PCQueueCreate | ( | void | ) | [static] |
Definition at line 153 of file pcqueue.h.
References calloc(), CmiCreateLock(), PCQueueStruct::head, PCQueueStruct::len, PCQueueStruct::lock, malloc(), and PCQueueStruct::tail.
Referenced by CmiInitNotifyCommThdScheme(), ConverseRunPE(), cpd_memory_single_pup(), PCQueuePop(), and SendMsgBuf().
| static void PCQueueDestroy | ( | PCQueue | Q | ) | [static] |
Definition at line 176 of file pcqueue.h.
References free(), PCQueueStruct::head, CircQueueStruct::next, and PCQueueStruct::tail.
Referenced by cpd_memory_single_pup(), and PCQueuePop().
Definition at line 187 of file pcqueue.h.
References PCQueueStruct::len.
Referenced by CmiGetNonLocalNodeQ(), getInfiCmiChunkThread(), KillOnAllSigs(), PCQueuePop(), PumpMsgsBlocking(), and SendMsgBuf().
Definition at line 192 of file pcqueue.h.
References PCQueueStruct::len.
Referenced by EnqueueMsg(), getInfiCmiChunkThread(), PCQueuePop(), and PumpMsgs().
| static char* PCQueueTop | ( | PCQueue | Q | ) | [static] |
Definition at line 197 of file pcqueue.h.
References CmiLock(), CmiUnlock(), CircQueueStruct::data, data, PCQueueStruct::head, PCQueueStruct::len, PCQueueStruct::lock, and CircQueueStruct::pull.
Referenced by PCQueuePop().
| static char* PCQueuePop | ( | PCQueue | Q | ) | [static] |
The beginning of definitions for simple pcqueue
Definition at line 216 of file pcqueue.h.
References calloc(), CmiAbort(), CmiCreateLock(), CmiLock(), CmiUnlock(), CircQueueStruct::data, data, free(), PCQueueStruct::head, PCQueueStruct::len, PCQueueStruct::lock, malloc(), CircQueueStruct::next, PCQueueStruct::pad1, PCQueueStruct::pad2, PCQueueCreate(), PCQueueDestroy(), PCQueueEmpty(), PCQueueLength(), PCQueueTop(), CircQueueStruct::pull, CircQueueStruct::push, and PCQueueStruct::tail.
Referenced by CmiCreateNotifyCommThdMsg(), CmiGetNonLocal(), CmiGetNonLocalNodeQ(), CmiHandleImmediate(), cpd_memory_single_pup(), getInfiCmiChunkThread(), KillOnAllSigs(), processBcastQs(), and SendMsgBuf().
| CpvDeclare | ( | PersistentSendsTable * | , | |
| persistentSendsTableHead | ||||
| ) |
| CpvDeclare | ( | PersistentSendsTable * | , | |
| persistentSendsTableTail | ||||
| ) |
| CpvDeclare | ( | int | , | |
| persistentSendsTableCount | ||||
| ) |
| CpvDeclare | ( | PersistentReceivesTable * | , | |
| persistentReceivesTableHead | ||||
| ) |
| CpvDeclare | ( | PersistentReceivesTable * | , | |
| persistentReceivesTableTail | ||||
| ) |
| CpvDeclare | ( | int | , | |
| persistentReceivesTableCount | ||||
| ) |
| CpvDeclare | ( | PersistentHandle * | , | |
| phs | ||||
| ) |
| CpvDeclare | ( | int | , | |
| phsSize | ||||
| ) |
| CpvDeclare | ( | int | , | |
| curphs | ||||
| ) |
| void initRecvSlot | ( | PersistentReceivesTable * | slot | ) |
Referenced by getFreeRecvSlot().
| void initSendSlot | ( | PersistentSendsTable * | slot | ) |
Referenced by getFreeSendSlot().
| void swapSendSlotBuffers | ( | PersistentSendsTable * | slot | ) |
Definition at line 64 of file persist-comm.c.
| void swapRecvSlotBuffers | ( | PersistentReceivesTable * | slot | ) |
Definition at line 82 of file persist-comm.c.
| PersistentHandle getFreeSendSlot | ( | ) |
Definition at line 100 of file persist-comm.c.
References initSendSlot(), and malloc().
Referenced by CmiCreatePersistent(), and CmiRegisterReceivePersistent().
| PersistentHandle getFreeRecvSlot | ( | ) |
Definition at line 116 of file persist-comm.c.
References initRecvSlot(), and malloc().
Referenced by CmiCreateReceiverPersistent(), and persistentRequestHandler().
| PersistentHandle CmiCreatePersistent | ( | int | destPE, | |
| int | maxBytes | |||
| ) |
Definition at line 149 of file persist-comm.c.
| PersistentHandle CmiCreateNodePersistent | ( | int | destNode, | |
| int | maxBytes | |||
| ) |
Definition at line 181 of file persist-comm.c.
References CmiCreatePersistent(), and CmiNodeFirst().
| static void persistentRequestHandler | ( | void * | env | ) | [static] |
Definition at line 189 of file persist-comm.c.
References _PersistentReqGrantedMsg::buf, CmiAlloc(), CmiFree(), Converse::CmiSyncSendAndFree(), _PersistentReqGrantedMsg::destHandler, getFreeRecvSlot(), _PersistentRequestMsg::maxBytes, msg, _PersistentRequestMsg::requestorPE, _PersistentRequestMsg::sourceHandler, and _PersistentReqGrantedMsg::sourceHandler.
Referenced by CmiPersistentInit().
| static void persistentReqGrantedHandler | ( | void * | env | ) | [static] |
Definition at line 222 of file persist-comm.c.
References _PersistentReqGrantedMsg::buf, CmiFree(), CmiNodeOf(), _PersistentReqGrantedMsg::destHandler, LrtsSendPersistentMsg(), msg, and _PersistentReqGrantedMsg::sourceHandler.
Referenced by CmiPersistentInit().
| PersistentReq CmiCreateReceiverPersistent | ( | int | maxBytes | ) |
Definition at line 253 of file persist-comm.c.
| PersistentHandle CmiRegisterReceivePersistent | ( | PersistentReq | recvHand | ) |
Definition at line 280 of file persist-comm.c.
| void persistentDestoryHandler | ( | void * | env | ) |
Definition at line 306 of file persist-comm.c.
References CmiFree(), _PersistentDestoryMsg::destHandlerIndex, free(), and msg.
Referenced by CmiPersistentInit().
| void CmiDestoryPersistent | ( | PersistentHandle | h | ) |
Definition at line 337 of file persist-comm.c.
References CmiAlloc(), Converse::CmiSyncSendAndFree(), _PersistentDestoryMsg::destHandlerIndex, free(), and msg.
| void CmiDestoryAllPersistent | ( | ) |
| void CmiPersistentInit | ( | ) |
Definition at line 395 of file persist-comm.c.
| void CmiUsePersistentHandle | ( | PersistentHandle * | p, | |
| int | n | |||
| ) |
Definition at line 429 of file persist-comm.c.
| void CmiPersistentOneSend | ( | ) |
| int _immediateReady = 0 |
| int _immRunning = 0 |
void* currentImmediateMsg = NULL [static] |
Definition at line 25 of file immediate.c.
Referenced by CmiDelayImmediate(), and CmiHandleImmediate().
struct CmiStateStruct Cmi_default_state [static] |
Definition at line 92 of file machine-smp.c.
Definition at line 94 of file machine-smp.c.
static CmiNodeLock comm_mutex [static] |
Definition at line 96 of file machine-smp.c.
Referenced by CmiDestoryLocks(), and CmiStartThreads().
static pthread_key_t Cmi_state_key = 0xFFFFFFFF [static] |
Definition at line 101 of file machine-smp.c.
Referenced by call_startfn(), CmiGetState(), and CmiStartThreads().
static CmiState Cmi_state_vector = 0 [static] |
Definition at line 102 of file machine-smp.c.
pthread_mutex_t barrier_mutex = PTHREAD_MUTEX_INITIALIZER [static] |
Definition at line 184 of file machine-smp.c.
Referenced by CmiDestoryLocks(), CmiNodeBarrierCount(), and CmiStartThreads().
volatile int barrier_wait[2] = {0,0} [static] |
Definition at line 185 of file machine-smp.c.
volatile int barrier_which = 0 [static] |
Definition at line 186 of file machine-smp.c.
Definition at line 267 of file machine-smp.c.
Referenced by _initCharm(), CmiNotifyStillIdle(), CmiPushNode(), CmiPushPE(), ConverseCommonInit(), and KillOnAllSigs().
__thread struct CmiStateStruct Cmi_mystate [static] |
Definition at line 332 of file machine-smp.c.
| pthread_cond_t barrier_cond = PTHREAD_COND_INITIALIZER |
Definition at line 333 of file machine-smp.c.
int comm_mutex_isLocked = 0 [static] |
Definition at line 367 of file machine-smp.c.
| FILE* debugLog |
Referenced by KillOnAllSigs(), and SendMsgBuf().
int CircQueueStruct::push [inherited] |
CmiMemorySMPSeparation_t CircQueueStruct::pad1 [inherited] |
int CircQueueStruct::pull [inherited] |
CmiMemorySMPSeparation_t CircQueueStruct::pad2 [inherited] |
char* CircQueueStruct::data[PCQueueSize] [inherited] |
CmiMemorySMPSeparation_t PCQueueStruct::pad1 [inherited] |
CircQueue CMK_SMP_volatile PCQueueStruct::tail [inherited] |
Definition at line 96 of file pcqueue.h.
Referenced by PCQueueCreate(), PCQueueDestroy(), and PCQueuePop().
CmiMemorySMPSeparation_t PCQueueStruct::pad2 [inherited] |
int PCQueueStruct::len [inherited] |
Definition at line 100 of file pcqueue.h.
Referenced by PCQueueCreate(), PCQueueEmpty(), PCQueueLength(), PCQueuePop(), and PCQueueTop().
CmiNodeLock PCQueueStruct::lock [inherited] |
Definition at line 102 of file pcqueue.h.
Referenced by PCQueueCreate(), PCQueuePop(), and PCQueueTop().
Definition at line 49 of file persist-comm.c.
Definition at line 50 of file persist-comm.c.
Definition at line 51 of file persist-comm.c.
Definition at line 353 of file converse.h.
Definition at line 265 of file machine-smp.c.
1.5.5