CkEnvelope

Charm++ message header. More...

Data Structures

class  envelope

Functions

envelopeUsrToEnv (const void *const msg)
void * EnvToUsr (const envelope *const env)
envelope_allocEnv (const int msgtype, const int size=0, const int prio=0)
void * _allocMsg (const int msgtype, const int size, const int prio=0)

Detailed Description

Charm++ message header.

The class envelope defines a Charm++ message's header.

The first 'CmiReservedHeaderSize' bytes of memory is exclusively reserved for Converse header, which is defined in convere.h and platform specific config files.

After Charm++ envelope comes the payload, i.e. a variable-length amount of user data. Following the user data, optionally, a variable number of bits of priority data can be stored at the end. Function envelope::alloc(msgtype,size,prio) is always used to allocate the whole message. Note that this memory layout must be observed.

The following are a few terms that are used often:

 Envelope pointer        \
 Converse message pointer -> [ [ Converse envelope ]       ]
                             [       Charm envelope        ] 
 User message pointer     -> [ User data/payload ... ]
 Priority pointer         -> [ Priority ints ... ]

The "message pointers" passed to and from users bypass the envelope and point directly* to the user data--the routine "EnvToUsr" below adjusts an envelope (or converse message) pointer into this user message pointer. There is a corresponding routine "UsrToEnv" which takes the user data pointer and returns a pointer to the envelope/converse message.

Unfortunately, in the guts of Charm++ it's not always clear whether you've been given a converse or user message pointer, as both tend to be passed as void *. Confusing the two will invariably result in data corruption and bizarre crashes.

FIXME: Make CkMessage inherit from envelope, which would unify converse, envelope, and user message pointers.


Function Documentation

envelope* UsrToEnv ( const void *const   msg  )  [inline]

Definition at line 350 of file envelope.h.

Referenced by _bcastQD1(), _bcastQD2(), _handlePhase1(), _handlePhase2(), _initCharm(), _prepareImmediateMsg(), _prepareMsg(), _prepareMsgBranch(), _processNewVChareMsg(), _sendStats(), CkArray::allocate(), CkArrayMessage::array_ep(), CkArrayMessage::array_ep_bcast(), CkArrayMessage::array_getSrcPe(), CkArrayMessage::array_hops(), CkArrayMessage::array_ifNotThere(), CkArrayMessage::array_index(), CkArrayMessage::array_setIfNotThere(), ComlibManager::ArrayBroadcast(), CkMulticastMgr::ArraySectionSend(), ComlibManager::ArraySectionSend(), ComlibManager::ArraySend(), NullLB::AtSync(), CkLocRec_buffering::beenReplaced(), CkArray::broadcastHomeElements(), Chare::CkAddThreadListeners(), CkAllocateMarshallMsg(), CkAllocateMarshallMsgNoninline(), CkAllocateMarshallMsgT(), CkAllocBuffer(), CkArrayManagerDeliver(), CkArrayManagerInsert(), CProxy_ArrayBase::ckBroadcast(), CkCopyMsg(), CkCreateAttachedFuture(), CkCreateAttachedFutureSend(), CkCreateChare(), CkCreateGroup(), CkCreateNodeGroup(), CkFreeMsg(), CkGetRefNum(), CkGetSrcPe(), CkMemCheckPT::CkMemCheckPT(), CkMessageToEpIdx(), CkPackMessage(), CkPriorityPtr(), CkPupGroupData(), CkPupMessage(), CkPupNodeGroupData(), CkSemaSignal(), CkSendMsg(), CkSendMsgBranchImmediate(), CkSendMsgBranchInline(), CkSendMsgInline(), CkSendMsgNodeBranchImmediate(), CkSendMsgNodeBranchInline(), CkSendToFuture(), CkSetQueueing(), CkSetRefNum(), CkStartQD(), CkUnpackMessage(), CpdAfterEp(), CpdBeforeEp(), CpdPythonGroup::cpdCheck(), CpdPupMessage(), CkLocMgr::deliver(), CkLocRec_buffering::deliver(), CkLocRec_local::deliver(), CharmStrategy::deliverToIndices(), CkLocMgr::deliverUnknown(), CkLocMgr::demandCreateElement(), CkLocMgr::emigrate(), CkReductionMgr::finishReduction(), ampi::generic(), ComlibSectionInfo::getNewMulticastMessage(), ComlibManager::GroupBroadcast(), ComlibManager::GroupSend(), RectMulticastStrategy::handleNewMulticastMessage(), CkArrayBroadcaster::incoming(), RectMulticastStrategy::insertMessage(), PrioStreaming::insertMessage(), OneTimeMulticastStrategy::insertMessage(), MulticastStrategy::insertMessage(), EachToManyMulticastStrategy::insertMessage(), BroadcastStrategy::insertMessage(), CkLocRec_local::invokeEntry(), RectMulticastStrategy::localMulticast(), MulticastStrategy::localMulticast(), ampi::makeAmpiMsg(), msg_prepareSend(), msg_prepareSend_noinline(), ComlibManager::multicast(), CkArray::prepareCtorMsg(), QdState::propagate(), Event::pup(), CpdList_localQ::pup(), CentralLB::ReceiveMigration(), ArrayElement::recvBroadcast(), CkReductionMgr::ReductionStarting(), OneTimeMulticastStrategy::remoteMulticast(), rewritePEs(), QdState::sendCount(), sendTicketGroupRequest(), sendTicketNodeGroupRequest(), FutureBOC::SetFuture(), FutureBOC::SetSema(), CkArrayReductionMgr::startNodeGroupReduction(), and CkDiskCheckPTInfo::updateBuffer().

void* EnvToUsr ( const envelope *const   env  )  [inline]

Definition at line 354 of file envelope.h.

Referenced by MsgPool::_alloc(), _allocMsg(), _exitHandler(), _initCharm(), _invokeEntryNoTrace(), _processArrayEltInitMsg(), _processArrayEltMsg(), _processFillVidMsg(), _processRODataMsg(), _processROMsgMsg(), _qdCommHandler(), _qdHandler(), _receiveMlogLocationHandler(), bdcastRO(), CkAllocBuffer(), CkAllocMsg(), CkCopyMsg(), CkMemCheckPT::CkMemCheckPT(), CkPackMessage(), CkPupMessage(), CkUnpackMessage(), PipeBroadcastStrategy::deliver(), EachToManyMulticastStrategy::deliver(), ComlibArrayInfo::deliver(), RectMulticastStrategy::forwardMulticast(), CharmMessageHolder::getCharmMessage(), PipeBroadcastStrategy::getFragmentHeader(), ComlibSectionInfo::getNewMulticastMessage(), ComlibSectionInfo::getPeList(), BroadcastStrategy::handleHypercube(), RectMulticastStrategy::handleMessage(), OneTimeMulticastStrategy::handleMessage(), MulticastStrategy::handleMessage(), RectMulticastStrategy::handleMessageForward(), RectMulticastStrategy::handleNewMulticastMessage(), MulticastStrategy::handleNewMulticastMessage(), BroadcastStrategy::handleTree(), RectMulticastStrategy::localMulticast(), MulticastStrategy::localMulticast(), ComlibArrayInfo::localMulticast(), migrationDone(), Event::pup(), CpdList_message::pup(), CpdList_localQ::pup(), recv_array_msg(), CkMulticastMgr::recvPacket(), RectMulticastStrategy::remoteMulticast(), sendMlogLocation(), sendTicketGroupRequest(), sendTicketNodeGroupRequest(), ComlibSectionInfo::unpack(), and CkDiskCheckPTInfo::updateBuffer().

envelope* _allocEnv ( const int  msgtype,
const int  size = 0,
const int  prio = 0 
) [inline]

void* _allocMsg ( const int  msgtype,
const int  size,
const int  prio = 0 
) [inline]

Definition at line 362 of file envelope.h.

References envelope::alloc(), and EnvToUsr().

Referenced by _processNewVChareMsg(), and Stats::operator new().


Generated on Mon Nov 23 07:55:58 2009 for Charm++ by  doxygen 1.5.5