PPL Logo

Converse Machine Layer
[Converse]

Collaboration diagram for Converse Machine Layer:
Common structures for all implementations of the machine layer

The machine layer of Converse consist of few common files to all architectures, shown in this module, which are:

More...


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 CmiStateStructCmiState
typedef struct CmiNodeStateStruct CmiNodeState
typedef struct CircQueueStructCircQueue
typedef struct PCQueueStructPCQueue
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

Detailed Description

Common structures for all implementations of the machine layer

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 Documentation

typedef struct CmiStateStruct * CmiState

typedef struct CircQueueStruct * CircQueue

typedef struct PCQueueStruct * PCQueue


Function Documentation

void CmiPushImmediateMsg ( void *  msg  ) 

void CmiDelayImmediate (  ) 

void CmiHandleImmediateMessage ( void *  msg  ) 

Definition at line 72 of file immediate.c.

References CQdProcess(), CmiHandlerInfo::hdlr, and CmiHandlerInfo::userPtr.

Referenced by CmiHandleImmediate().

void CmiHandleImmediate (  ) 

void CmiStateInit ( int  pe,
int  rank,
CmiState  state 
)

void CommunicationServerInit (  ) 

Definition at line 3445 of file convcore.c.

References CQdCpvInit().

Referenced by call_startfn(), and KillOnAllSigs().

CmiState CmiGetState (  ) 

CmiNodeLock CmiCreateLock ( void   ) 

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]

void CmiNodeBarrierCount ( int  nThreads  ) 

Definition at line 188 of file machine-smp.c.

References barrier_mutex, and sleep().

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

static void CmiDestoryLocks (  )  [static]

Definition at line 249 of file machine-smp.c.

References barrier_mutex, and comm_mutex.

void CmiCommLock ( void   ) 

void CmiCommUnlock ( void   ) 

static void* call_startfn ( void *  vindex  )  [static]

static PCQueue PCQueueCreate ( void   )  [static]

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().

static int PCQueueEmpty ( PCQueue  Q  )  [static]

static int PCQueueLength ( PCQueue  Q  )  [static]

Definition at line 192 of file pcqueue.h.

References PCQueueStruct::len.

Referenced by EnqueueMsg(), getInfiCmiChunkThread(), PCQueuePop(), and PumpMsgs().

static char* PCQueueTop ( PCQueue  Q  )  [static]

static char* PCQueuePop ( PCQueue  Q  )  [static]

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]

static void persistentReqGrantedHandler ( void *  env  )  [static]

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  ) 

void CmiDestoryAllPersistent (  ) 

Definition at line 368 of file persist-comm.c.

References CmiPrintf(), and free().

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 (  ) 

Definition at line 444 of file persist-comm.c.

Referenced by _skipCldEnqueue().


Variable Documentation

Definition at line 15 of file immediate.c.

Referenced by ConverseRunPE(), and KillOnAllSigs().

Definition at line 17 of file immediate.c.

Referenced by CmiSendNodeSelf(), and KillOnAllSigs().

void* currentImmediateMsg = NULL [static]

Definition at line 25 of file immediate.c.

Referenced by CmiDelayImmediate(), and CmiHandleImmediate().

Definition at line 86 of file machine-smp.c.

Referenced by CmiGetState().

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.

__thread struct CmiStateStruct Cmi_mystate [static]

Definition at line 271 of file machine-smp.c.

Referenced by call_startfn().

int barrier = 0

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().

Definition at line 78 of file pcqueue.h.

Referenced by PCQueuePop().

Definition at line 80 of file pcqueue.h.

Definition at line 82 of file pcqueue.h.

Referenced by PCQueuePop(), and PCQueueTop().

Definition at line 84 of file pcqueue.h.

char* CircQueueStruct::data[PCQueueSize] [inherited]

Definition at line 86 of file pcqueue.h.

Referenced by PCQueuePop(), and PCQueueTop().

Definition at line 94 of file pcqueue.h.

Referenced by PCQueuePop().

CircQueue CMK_SMP_volatile PCQueueStruct::tail [inherited]

Definition at line 96 of file pcqueue.h.

Referenced by PCQueueCreate(), PCQueueDestroy(), and PCQueuePop().

Definition at line 98 of file pcqueue.h.

Referenced by PCQueuePop().

int PCQueueStruct::len [inherited]

Definition at line 100 of file pcqueue.h.

Referenced by PCQueueCreate(), PCQueueEmpty(), PCQueueLength(), PCQueuePop(), and PCQueueTop().

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.


Generated on Fri May 25 08:00:57 2012 for Charm++ by  doxygen 1.5.5