MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Element.h>
Public Member Functions | |
void | addMsg (ObjId mid) |
void | addMsgAndFunc (ObjId mid, FuncId fid, BindIndex bindIndex) |
const Cinfo * | cinfo () const |
void | clearAllMsgs () |
Used upon ending of MOOSE session, to rapidly clear out messages. More... | |
void | clearBinding (BindIndex b) |
virtual Element * | copyElement (Id newParent, Id newId, unsigned int n, bool toGlobal) const =0 |
virtual char * | data (unsigned int rawIndex, unsigned int fieldIndex=0) const =0 |
void | digestMessages () |
void | dropAllMsgsFromSrc (Id src) |
void | dropMsg (ObjId mid) |
Element (Id id, const Cinfo *c, const string &name) | |
unsigned int | findBinding (MsgFuncBinding b) const |
ObjId | findCaller (FuncId fid) const |
unsigned int | getFieldsOfOutgoingMsg (ObjId mid, vector< pair< BindIndex, FuncId > > &ret) const |
unsigned int | getInputMsgs (vector< ObjId > &caller, FuncId fid) const |
unsigned int | getInputsWithTgtIndex (vector< pair< Id, unsigned int > > &ret, const DestFinfo *finfo) const |
const vector< MsgFuncBinding > * | getMsgAndFunc (BindIndex b) const |
unsigned int | getMsgSourceAndSender (FuncId fid, vector< ObjId > &src, vector< string > &sender) const |
unsigned int | getMsgTargetAndFunctions (DataId srcDataId, const SrcFinfo *finfo, vector< ObjId > &tgt, vector< string > &func) const |
vector< ObjId > | getMsgTargets (DataId srcDataId, const SrcFinfo *finfo) const |
const string & | getName () const |
unsigned int | getNeighbors (vector< Id > &ret, const Finfo *finfo) const |
virtual unsigned int | getNode (unsigned int dataIndex) const =0 |
Returns node number of specified dataIndex. More... | |
virtual unsigned int | getNumOnNode (unsigned int node) const =0 |
int | getTick () const |
virtual bool | hasFields () const =0 |
bool | hasMsgs (BindIndex b) const |
Id | id () const |
void | innerSetTick (unsigned int tick) |
bool | isDoomed () const |
virtual bool | isGlobal () const =0 |
True if there is a copy of every dataEntry on all nodes. More... | |
virtual unsigned int | localDataStart () const =0 |
Returns index of first data entry on this node. More... | |
void | markAsDoomed () |
void | markRewired () |
const vector< MsgDigest > & | msgDigest (unsigned int index) |
const vector< ObjId > & | msgIn () const |
virtual unsigned int | numData () const =0 |
Returns number of data entries across all nodes. More... | |
virtual unsigned int | numField (unsigned int rawIndex) const =0 |
Returns number of field entries for specified data. More... | |
virtual unsigned int | numLocalData () const =0 |
Returns number of local data entries on this node. More... | |
void | printMsgDigest (unsigned int srcIndex, unsigned int dataIndex) const |
void | putOffNodeTargetsInDigest (unsigned int srcNum, vector< vector< bool > > &targetNodes) |
void | putTargetsInDigest (unsigned int srcNum, const MsgFuncBinding &mfb, const FuncOrder &fo, vector< vector< bool > > &targetNodes) |
virtual unsigned int | rawIndex (unsigned int dataIndex) const =0 |
void | replaceCinfo (const Cinfo *newCinfo) |
Support function for zombieSwap, replaces Cinfo. More... | |
virtual void | resize (unsigned int newNumData)=0 |
virtual void | resizeField (unsigned int rawIndex, unsigned int newNumField)=0 |
void | setName (const string &val) |
void | setTick (int t) |
void | showFields () const |
void | showMsg () const |
virtual unsigned int | startDataIndex (unsigned int nodeNum) const =0 |
Returns start dataIndex on specified node. More... | |
virtual unsigned int | totNumLocalField () const =0 |
virtual void | zombieSwap (const Cinfo *zCinfo) |
virtual func, this base version must be called by all derived classes More... | |
virtual | ~Element () |
Static Public Member Functions | |
static void | destroyElementTree (const vector< Id > &tree) |
Private Member Functions | |
unsigned int | getInputs (vector< Id > &ret, const DestFinfo *finfo) const |
unsigned int | getOutputs (vector< Id > &ret, const SrcFinfo *finfo) const |
Private Attributes | |
const Cinfo * | cinfo_ |
Stores the unique identifier for Element. More... | |
Id | id_ |
Name of the Element. More... | |
bool | isDoomed_ |
True if the element is marked for destruction. More... | |
bool | isRewired_ |
True if messages have been changed and need to digestMessages. More... | |
vector< ObjId > | m_ |
vector< vector< MsgFuncBinding > > | msgBinding_ |
vector< vector< MsgDigest > > | msgDigest_ |
string | name_ |
int | tick_ |
Returns tick on which element is scheduled. -1 for disabled. More... | |
Base class for all object lookups. Provides the MOOSE interface so that it handles messaging, class info, and basic fields. Does not do data.
This is the main constructor, used by Shell::innerCreate which makes most Elements. Also used to create base Elements to init the simulator in main.cpp. Id is the Id of the new Element Cinfo is the class name is its name numData is the number of data entries, defaults to a singleton. The isGlobal flag specifies whether the created objects should be replicated on all nodes, or partitioned without replication.
Definition at line 17 of file Element.cpp.
|
virtual |
Destructor
Definition at line 31 of file Element.cpp.
References Msg::deleteMsg(), id_, m_, markAsDoomed(), msgBinding_, and Id::zeroOut().
void Element::addMsg | ( | ObjId | mid | ) |
Pushes the Msg mid onto the list. The position on the list does not matter.
Definition at line 79 of file Element.cpp.
References m_, and markRewired().
Referenced by Msg::Msg().
Pushes back the specified Msg and Func pair into the properly indexed place on the msgBinding_ vector.
Definition at line 128 of file Element.cpp.
References markRewired(), and msgBinding_.
Referenced by SrcFinfo::addMsg(), OneToAllMsg::copy(), OneToOneDataIndexMsg::copy(), OneToOneMsg::copy(), SingleMsg::copy(), DiagonalMsg::copy(), SparseMsg::copy(), testMsgField(), and testSendMsg().
const Cinfo * Element::cinfo | ( | ) | const |
Gets the class information for this Element
Definition at line 66 of file Element.cpp.
References cinfo_.
Referenced by ReadCell::addCaConc(), ReadCell::addCanonicalChannel(), addClockMsg(), ReadCell::addSpikeGen(), Stoich::allocateModelObject(), assignParam(), Dsolve::buildMeshJunctions(), Dsolve::buildNeuroMeshJunctions(), Dsolve::calcJunction(), SetGet::checkSet(), PostMaster::clearPendingRecv(), convertConcToNumRateUsingMesh(), FieldElement::copyElement(), DataElement::DataElement(), HSolve::deepSearchForCompartment(), HSolve::deleteIncomingMessages(), Neutral::destroy(), Shell::doAddMsg(), doClassSpecificMessaging(), Shell::doLoadModel(), fillSegIndex(), fillSegments(), VoxelPoolsBase::filterCrossRateTerms(), findAllConnectedCompartments(), findFuncMsgSrc(), Neutral::getClass(), getCompt(), Neutral::getDestFields(), Msg::getDestFieldsOnE1(), Msg::getDestFieldsOnE2(), Neutral::getMsgDestFunctions(), Neutral::getMsgDests(), getMsgSourceAndSender(), getMsgTargetAndFunctions(), Neutral::getNeighbors(), Neutral::getOutgoingMsgs(), Stoich::getProxyPools(), getReactantVols(), Neutral::getSourceFields(), Msg::getSrcFieldsOnE1(), Msg::getSrcFieldsOnE2(), Neutral::getValueFields(), Shell::innerAddMsg(), innerCopyElements(), Neutral::isA(), isOffSolverReac(), isPartOfDend(), ReadKkit::loadTab(), localGet(), Stoich::locateOffSolverReacs(), Eref::msgDigest(), GetOpFunc1< T, L, A >::op(), GetEpFunc1< T, L, A >::op(), ReadCspace::printMol(), putFuncsInOrder(), putOffNodeTargetsInDigest(), ReadCell::read(), DataElement::resize(), Gsolve::setCompartment(), ZombiePoolInterface::setCompartment(), Stoich::setCompartment(), Ksolve::setDsolve(), Gsolve::setDsolve(), Stoich::setDsolve(), Stoich::setKsolve(), Gsolve::setN(), Gsolve::setNinit(), HSolve::setSeed(), ZombieFunction::setSolver(), ZombieReac::setSolver(), ZombieMMenz::setSolver(), ZombieEnz::setSolver(), Neuron::setSpineAndPsdMesh(), Gsolve::setStoich(), SteadyState::setStoich(), Ksolve::setStoich(), Dsolve::setStoich(), EndoMesh::setSurround(), setTick(), ReadKkit::setupSlaveMsg(), SetGet::strGet(), SetGet::strSet(), HSolveUtils::targets(), Stoich::unZombifyModel(), Stoich::unZombifyPools(), Pool::vGetIsBuffered(), ZombiePool::vSetSolver(), ZombieCaConc::vSetSolver(), ZombieHHChannel::vSetSolver(), ZombieCompartment::vSetSolver(), DataElement::zombieSwap(), ZombieFunction::zombify(), CplxEnzBase::zombify(), ReacBase::zombify(), EnzBase::zombify(), CaConcBase::zombify(), PoolBase::zombify(), HHChannelBase::zombify(), moose::CompartmentBase::zombify(), Stoich::zombifyModel(), and DataElement::~DataElement().
void Element::clearAllMsgs | ( | ) |
Used upon ending of MOOSE session, to rapidly clear out messages.
Used upon ending of MOOSE session, to rapidly clear out messages, secure in the knowledge that the data structures will be destroyed separately.
Definition at line 150 of file Element.cpp.
References m_, markAsDoomed(), msgBinding_, and msgDigest_.
void Element::clearBinding | ( | BindIndex | b | ) |
Clears out all Msgs on specified BindIndex. Used in Shell::set
Definition at line 136 of file Element.cpp.
References Msg::deleteMsg(), markRewired(), and msgBinding_.
|
pure virtual |
Copier
Implemented in GlobalDataElement, MsgElement, LocalDataElement, and FieldElement.
Referenced by innerCopyElements().
|
pure virtual |
Looks up specified field data entry. On regular objects just returns the data entry specified by the rawIndex. On FieldElements like synapses, does a second lookup on the field index. Note that the index is NOT a DataIndex: it is instead the raw index of the data on the current node. Index is also NOT the character offset, but the index to the data array in whatever type the data may be.
The DataIndex has to be filtered through the nodeMap to find a) if the entry is here, and b) what its raw index is.
Returns 0 if either index is out of range.
Implemented in MsgElement, DataElement, and FieldElement.
Referenced by buildFinfoElement(), Eref::data(), FieldElement::data(), DataElement::DataElement(), main(), Cinfo::makeCinfoElements(), FieldElement::numField(), FieldElement::resizeField(), testArith(), testCreateMsg(), testFibonacci(), testGet(), testSendMsg(), testSetGetSynapse(), and testSetGetVec().
|
static |
Destroys all Elements in tree, being efficient about not trying to traverse through clearing messages to doomed Elements. Assumes tree includes all child elements. Typically the Neutral::destroy function builds up this tree and then calls this function.
Definition at line 676 of file Element.cpp.
References Id::destroy().
Referenced by Neutral::destroy().
void Element::digestMessages | ( | ) |
Rebuild digested message array; traverse all messages to do so
Definition at line 569 of file Element.cpp.
References findNumDigest(), msgBinding_, msgDigest_, name_, numData(), Shell::numNodes(), putFuncsInOrder(), putOffNodeTargetsInDigest(), and putTargetsInDigest().
Referenced by msgDigest().
void Element::dropAllMsgsFromSrc | ( | Id | src | ) |
Drop all messages arriving from src onto current Element, regardless of which field they come from.
Definition at line 197 of file Element.cpp.
References Msg::deleteMsg(), Msg::e1(), Msg::e2(), Id::element(), Msg::getMsg(), and m_.
Referenced by setTick().
void Element::dropMsg | ( | ObjId | mid | ) |
Removes the specified msg from the list.
Called from ~Msg. This requires the usual scan through all msgs, and could get inefficient.
Definition at line 113 of file Element.cpp.
References isDoomed(), m_, markRewired(), and msgBinding_.
Referenced by Msg::~Msg().
unsigned int Element::findBinding | ( | MsgFuncBinding | b | ) | const |
Returns the binding index of the specified entry. Returns ~0 on failure.
Definition at line 374 of file Element.cpp.
References msgBinding_.
Referenced by findCaller(), getInputMsgs(), and getMsgSourceAndSender().
Returns the first Msg that calls the specified Fid, on current Element. Returns 0 on failure.
Definition at line 350 of file Element.cpp.
References BADINDEX, Msg::e1(), Msg::e2(), findBinding(), Msg::getMsg(), and m_.
Referenced by HSolve::deleteIncomingMessages(), Shell::innerMove(), Neutral::isDescendant(), Neutral::parent(), Neutral::path(), and testAssortedMsg().
unsigned int Element::getFieldsOfOutgoingMsg | ( | ObjId | mid, |
vector< pair< BindIndex, FuncId > > & | ret | ||
) | const |
Fills in vector, each entry of which identifies the src and dest fields respectively. Src field is local and identified by BindIndex Dest field is a FuncId on the remote Element.
Definition at line 1009 of file Element.cpp.
References msgBinding_.
Referenced by Msg::getDestFieldsOnE1(), Msg::getDestFieldsOnE2(), Msg::getSrcFieldsOnE1(), Msg::getSrcFieldsOnE2(), and testMsgSrcDestFields().
More general function. Fills up vector of ObjIds that call the specified Fid on current Element. Returns # found
Definition at line 984 of file Element.cpp.
References Msg::e1(), Msg::e2(), findBinding(), Msg::getMsg(), and m_.
Referenced by getInputs(), getInputsWithTgtIndex(), and insertSharedMsgs().
Fills in vector of Ids sending messeges to this DestFinfo on this Element. Returns # found
Definition at line 887 of file Element.cpp.
References Msg::e1(), Msg::e2(), DestFinfo::getFid(), getInputMsgs(), Msg::getMsg(), and id().
Referenced by getNeighbors().
unsigned int Element::getInputsWithTgtIndex | ( | vector< pair< Id, unsigned int > > & | ret, |
const DestFinfo * | finfo | ||
) | const |
Returns vectors of sources of messages to a field or data element. To go with each entry, also return the field or data index of target.
Returns vectors of sources of messages to a field or data element. To go with each entry, also return the field or data index of target. Needed to track which inputs go to with field index of current element. So if A–>x0, B–>x1, and C–>x2, it will return A, B, C, no matter in which order the messages were created. If there are multiple messages to x0, it will return the first.
Definition at line 918 of file Element.cpp.
References Eref::dataIndex(), Msg::e1(), Msg::e2(), Eref::fieldIndex(), Msg::firstTgt(), DestFinfo::getFid(), getInputMsgs(), Msg::getMsg(), hasFields(), and id().
const vector< MsgFuncBinding > * Element::getMsgAndFunc | ( | BindIndex | b | ) | const |
gets the Msg/Func binding information for specified bindIndex. This is a vector. Returns 0 on failure.
Definition at line 300 of file Element.cpp.
References msgBinding_.
Referenced by Neutral::child(), Neutral::children(), convertConcToNumRateUsingVol(), getMsgTargetAndFunctions(), EnzBase::getNumPrd(), ReacBase::getNumPrd(), EnzBase::getNumSub(), ReacBase::getNumSub(), Neutral::getOutgoingMsgs(), getOutputs(), getReactantVols(), and innerCopyMsgs().
unsigned int Element::getMsgSourceAndSender | ( | FuncId | fid, |
vector< ObjId > & | src, | ||
vector< string > & | sender | ||
) | const |
Fills in matching vectors of destination ObjIds and the destination function, for the specified source Finfo and dataId on this Element. Used in Neutral::msgDests and Neutral::msgDestFunctions. Returns number of dests found.
Definition at line 828 of file Element.cpp.
References cinfo(), Msg::e1(), Msg::e2(), findBinding(), Msg::getMsg(), id(), m_, and Cinfo::srcFinfoName().
Referenced by testMsgSrcDestFields().
unsigned int Element::getMsgTargetAndFunctions | ( | DataId | srcDataId, |
const SrcFinfo * | finfo, | ||
vector< ObjId > & | tgt, | ||
vector< string > & | func | ||
) | const |
Fills in matching vectors of destination ObjIds and the destination function, for the specified source Finfo and dataId on this Element. Used in Neutral::msgDests and Neutral::msgDestFunctions. Returns number of dests found.
Definition at line 772 of file Element.cpp.
References cinfo(), Cinfo::destFinfoName(), Msg::e1(), Msg::e2(), SrcFinfo::getBindIndex(), Msg::getMsg(), getMsgAndFunc(), name, numData(), Msg::sources(), and Msg::targets().
Referenced by Stoich::allocateModelObject(), Neutral::getMsgDestFunctions(), Neutral::getMsgDests(), and testMsgSrcDestFields().
Enumerates msg targets. Will get confused if some are across nodes.
Definition at line 856 of file Element.cpp.
References ALLDATA, SrcFinfo::getBindIndex(), Eref::msgDigest(), and numData().
Referenced by Adaptor::reinit(), and ChemCompt::setEntireVolume().
const string & Element::getName | ( | ) | const |
Returns name of Element
Definition at line 56 of file Element.cpp.
References name_.
Referenced by ReadCell::addChannel(), SharedFinfo::addMsg(), Shell::adopt(), ReadCell::buildChannels(), buildFromProto(), checkChildren(), checkForSpine(), Neutral::child(), FieldElement::copyElement(), Shell::doAddMsg(), doClassSpecificMessaging(), Shell::doMove(), fillSegIndex(), NeuroNode::filterSpines(), NeuroMesh::filterSpines(), findModelParent(), Msg::getDestFieldsOnE1(), Msg::getDestFieldsOnE2(), Neutral::getName(), Msg::getSrcFieldsOnE1(), Msg::getSrcFieldsOnE2(), Shell::innerAddMsg(), Shell::innerMove(), isPartOfDend(), Dsolve::mapXfersBetweenDsolves(), operator<<(), Neutral::path(), FieldElementFinfoBase::postCreationFunc(), ReadCspace::printMol(), Arith::process(), showMsg(), SetGet::strGet(), SetGet::strSet(), testCopy(), testCopyFieldElement(), testMsgField(), testStrSet(), HHChannel2D::vReinit(), HHChannel::vReinit(), wildcardTestFunc(), and FieldElement::zombieSwap().
Fills in vector of Ids connected to this Finfo on this Element. Returns # found
Definition at line 949 of file Element.cpp.
References SharedFinfo::dest(), getInputs(), getOutputs(), and SharedFinfo::src().
Referenced by ReadCell::buildCompartment(), findAllConnectedCompartments(), findFuncMsgSrc(), findMeshOfEnz(), findParentComptOfReac(), Neutral::getNeighbors(), isOffSolverReac(), moose::VClamp::reinit(), ZombieReac::setSolver(), ZombieMMenz::setSolver(), ZombieEnz::setSolver(), HSolveUtils::targets(), testShellAddMsg(), and testTwoReacGetNeighbors().
|
pure virtual |
Returns node number of specified dataIndex.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by HopFunc1< A >::dataOpVec(), FieldElement::getNode(), Eref::getNode(), and Eref::isDataHere().
|
pure virtual |
Returns number of data (or, if relevant, field) entries on specified node.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by HopFunc1< A >::dataOpVec(), and HopFunc2< A1, A2 >::opVec().
Fills in vector of Ids receiving messages from this SrcFinfo. Returns # found
Definition at line 749 of file Element.cpp.
References Msg::e1(), Msg::e2(), SrcFinfo::getBindIndex(), Msg::getMsg(), getMsgAndFunc(), and id().
Referenced by getNeighbors().
int Element::getTick | ( | ) | const |
Returns Clock tick used by object. -1 means none. -2 means none for now because I am a zombie, but if I should be unzombified please put me back on my default clock tick.
Definition at line 186 of file Element.cpp.
References tick_.
Referenced by Streamer::addTable(), Neutral::getDt(), Neutral::getTick(), Table::reinit(), Streamer::reinit(), and Stoich::unZombifyModel().
|
pure virtual |
True if this is a FieldElement having an array of fields on each data entry. Clearly not true for the base Element.
Implemented in MsgElement, DataElement, and FieldElement.
Referenced by Neutral::child(), Shell::doFind(), OneToOneMsg::firstTgt(), getInputsWithTgtIndex(), innerGetVec(), moose_ObjId_getLength(), GetHopFunc< A >::opGetVec(), HopFunc1< A >::opVec(), OpFunc1Base< ProcPtr >::opVecBuffer(), Neutral::path(), OneToOneMsg::sources(), and OneToOneMsg::targets().
bool Element::hasMsgs | ( | BindIndex | b | ) | const |
Returns true if there are one or more Msgs on the specified BindIndex
Definition at line 307 of file Element.cpp.
References msgBinding_.
Referenced by Clock::buildTicks(), and NeuroMesh::transmitSpineInfo().
Id Element::id | ( | ) | const |
Returns the Id on this Elm
Definition at line 71 of file Element.cpp.
References id_.
Referenced by SharedFinfo::addMsg(), Stoich::allocateModelObject(), Neutral::buildTree(), Neutral::child(), HSolve::deleteIncomingMessages(), OneToOneDataIndexMsg::findOtherEnd(), OneToOneMsg::findOtherEnd(), DiagonalMsg::findOtherEnd(), Msg::getE1(), Msg::getE2(), getInputs(), getInputsWithTgtIndex(), getMsgSourceAndSender(), getOutputs(), Eref::id(), innerCopyElements(), innerCopyMsgs(), Neutral::isDescendant(), Eref::objId(), printGrid(), showFields(), CplxEnzBase::zombify(), ReacBase::zombify(), EnzBase::zombify(), and Stoich::zombifyModel().
void Element::innerSetTick | ( | unsigned int | tick | ) |
Direct assignment of tick field, without doing any of the message manipulation
Definition at line 191 of file Element.cpp.
References tick_.
bool Element::isDoomed | ( | ) | const |
Definition at line 701 of file Element.cpp.
References isDoomed_.
Referenced by dropMsg(), and Stoich::unZombifyPools().
|
pure virtual |
True if there is a copy of every dataEntry on all nodes.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by HopFunc1< A >::dataOpVec(), PostMaster::dispatchSetBuf(), filterOffNodeTargets(), FieldElement::getNumOnNode(), FieldElement::isGlobal(), GetHopFunc< A >::opGetVec(), HopFunc1< A >::opVec(), HopFunc2< A1, A2 >::opVec(), putTargetsInDigest(), PostMaster::remoteFieldGetVec(), PostMaster::remoteGet(), PostMaster::remoteGetVec(), and testCopyFieldElement().
|
pure virtual |
Returns index of first data entry on this node.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by GetHopFunc< A >::getLocalFieldVec(), GetHopFunc< A >::getLocalVec(), innerGetVec(), FieldElement::localDataStart(), HopFunc1< A >::localFieldOpVec(), HopFunc1< A >::localOpVec(), OpFunc1Base< ProcPtr >::opVecBuffer(), OpFunc2Base< A1, A2 >::opVecBuffer(), putTargetsInDigest(), SparseMsg::randomConnect(), SrcFinfo0::send(), SrcFinfo1< T >::send(), SrcFinfo2< T1, T2 >::send(), SrcFinfo3< T1, T2, T3 >::send(), SrcFinfo4< T1, T2, T3, T4 >::send(), SrcFinfo5< T1, T2, T3, T4, T5 >::send(), SrcFinfo6< T1, T2, T3, T4, T5, T6 >::send(), SrcFinfo1< T >::sendTo(), SrcFinfo2< T1, T2 >::sendTo(), SrcFinfo1< T >::sendVec(), OneToOneMsg::sources(), OneToOneMsg::targets(), SparseMsg::updateAfterFill(), ReacBase::zombify(), CplxEnzBase::zombify(), EnzBase::zombify(), CaConcBase::zombify(), PoolBase::zombify(), HHChannelBase::zombify(), and moose::CompartmentBase::zombify().
void Element::markAsDoomed | ( | ) |
Set flag to state that Element is due for destruction. Useful to avoid following messages that will soon be gone.
Definition at line 696 of file Element.cpp.
References isDoomed_.
Referenced by clearAllMsgs(), and ~Element().
void Element::markRewired | ( | ) |
Set flag to state that the messages on this Element have changed, and need to be re-digested.
Definition at line 706 of file Element.cpp.
References isRewired_.
Referenced by addMsg(), addMsgAndFunc(), clearBinding(), dropMsg(), SparseMsg::randomConnect(), OneToAllMsg::setI1(), SingleMsg::setI1(), SingleMsg::setI2(), DiagonalMsg::setStride(), SingleMsg::setTargetField(), SparseMsg::transpose(), and SparseMsg::updateAfterFill().
const vector< MsgDigest > & Element::msgDigest | ( | unsigned int | index | ) |
Raw lookup into MsgDigest vector. One for each MsgSrc X ObjEntry. If the messages have been rewired, this call triggers the re-parsing of all messages before returning the digested msgs.
Definition at line 289 of file Element.cpp.
References digestMessages(), isRewired_, and msgDigest_.
Referenced by Eref::msgDigest(), and testSendMsg().
const vector< ObjId > & Element::msgIn | ( | ) | const |
Returns all incoming Msgs.
Definition at line 387 of file Element.cpp.
References m_.
Referenced by Neutral::getIncomingMsgs().
|
pure virtual |
Returns number of data entries across all nodes.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by ObjId::bad(), SetGet::checkSet(), DataElement::DataElement(), digestMessages(), Shell::doFind(), fillErefsFromMatrix(), DiagonalMsg::findOtherEnd(), getMsgTargetAndFunctions(), getMsgTargets(), Neutral::getNumData(), innerCopyElements(), FieldElement::numData(), GetHopFunc< A >::opGetVec(), SparseMsg::pairFill(), printGrid(), printMsgDigest(), putOffNodeTargetsInDigest(), SparseMsg::randomConnect(), SrcFinfo0::send(), SrcFinfo2< T1, T2 >::send(), SrcFinfo3< T1, T2, T3 >::send(), SrcFinfo4< T1, T2, T3, T4 >::send(), SrcFinfo5< T1, T2, T3, T4, T5 >::send(), SrcFinfo6< T1, T2, T3, T4, T5, T6 >::send(), SrcFinfo2< T1, T2 >::sendTo(), OneToAllMsg::sources(), SingleMsg::sources(), OneToOneMsg::sources(), OneToOneDataIndexMsg::sources(), DiagonalMsg::sources(), SparseMsg::SparseMsg(), OneToAllMsg::targets(), SingleMsg::targets(), OneToOneDataIndexMsg::targets(), OneToOneMsg::targets(), DiagonalMsg::targets(), testCellDiffn(), testCopyFieldElement(), testCylDiffnWithStoich(), testSetGetSynapse(), testSmallCellDiffn(), and testTaperingCylDiffn().
|
pure virtual |
Returns number of field entries for specified data.
Implemented in MsgElement, DataElement, and FieldElement.
Referenced by GetHopFunc< A >::getLocalFieldVec(), Neutral::getNumField(), innerGetVec(), HopFunc1< A >::localFieldOpVec(), HopFunc1< A >::localOpVec(), HopFunc2< A1, A2 >::opVec(), OpFunc1Base< ProcPtr >::opVecBuffer(), OpFunc2Base< A1, A2 >::opVecBuffer(), OneToOneMsg::sources(), OneToOneMsg::targets(), testCopyFieldElement(), and testSyncSynapseSize().
|
pure virtual |
Returns number of local data entries on this node.
Implemented in MsgElement, DataElement, and FieldElement.
Referenced by GetHopFunc< A >::getLocalVec(), innerGetVec(), HopFunc1< A >::localOpVec(), FieldElement::numLocalData(), HopFunc2< A1, A2 >::opVec(), OpFunc1Base< ProcPtr >::opVecBuffer(), OpFunc2Base< A1, A2 >::opVecBuffer(), putTargetsInDigest(), SparseMsg::randomConnect(), SrcFinfo1< T >::send(), SrcFinfo1< T >::sendTo(), SrcFinfo1< T >::sendVec(), OneToOneMsg::targets(), SparseMsg::updateAfterFill(), ZombieFunction::zombify(), CplxEnzBase::zombify(), ReacBase::zombify(), EnzBase::zombify(), CaConcBase::zombify(), PoolBase::zombify(), HHChannelBase::zombify(), and moose::CompartmentBase::zombify().
void Element::printMsgDigest | ( | unsigned int | srcIndex, |
unsigned int | dataIndex | ||
) | const |
Utility function for debugging
Definition at line 711 of file Element.cpp.
References msgBinding_, msgDigest_, and numData().
void Element::putOffNodeTargetsInDigest | ( | unsigned int | srcNum, |
vector< vector< bool > > & | targetNodes | ||
) |
Inner function that adds off-node targets to the MsgDigest
Definition at line 517 of file Element.cpp.
References cinfo(), Msg::e1(), Msg::e2(), MsgFuncBinding::fid, Msg::getMsg(), Cinfo::getOpFunc(), OpFunc::makeHopFunc(), MsgFuncBinding::mid, msgBinding_, msgDigest_, numData(), and Shell::numNodes().
Referenced by digestMessages().
void Element::putTargetsInDigest | ( | unsigned int | srcNum, |
const MsgFuncBinding & | mfb, | ||
const FuncOrder & | fo, | ||
vector< vector< bool > > & | targetNodes | ||
) |
Inner function that adds targets to a single function in the MsgDigest
Definition at line 466 of file Element.cpp.
References Msg::e1(), Msg::e2(), filterOffNodeTargets(), FuncOrder::func(), Msg::getMsg(), isGlobal(), localDataStart(), MsgFuncBinding::mid, msgBinding_, msgDigest_, Shell::myNode(), numLocalData(), Shell::numNodes(), Msg::sources(), and Msg::targets().
Referenced by digestMessages().
|
pure virtual |
Converts dataIndex to index on current node. No error check.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by Eref::data(), Neutral::getNumField(), FieldElement::rawIndex(), and Neutral::setNumField().
void Element::replaceCinfo | ( | const Cinfo * | newCinfo | ) |
Support function for zombieSwap, replaces Cinfo.
Definition at line 740 of file Element.cpp.
References cinfo_.
Referenced by Pool::vSetIsBuffered(), FieldElement::zombieSwap(), DataElement::zombieSwap(), and MsgElement::zombieSwap().
|
pure virtual |
Changes the number of entries in the data. Not permitted for FieldElements since they are just fields on the data.
Implemented in MsgElement, DataElement, FieldElement, and LocalDataElement.
Referenced by LookupField< L, A >::getVec(), Neutral::setNumData(), and Stoich::zombifyModel().
|
pure virtual |
Changes the number of fields on the specified data entry. Doesn't do anything for the regular Element.
Implemented in MsgElement, DataElement, and FieldElement.
Referenced by SparseMsg::randomConnect(), Neutral::setNumField(), and SparseMsg::updateAfterFill().
void Element::setName | ( | const string & | val | ) |
Changes name of Element
Definition at line 61 of file Element.cpp.
References name_.
Referenced by Neutral::setName(), testGet(), and testStrGet().
void Element::setTick | ( | int | t | ) |
Assigns clock tick to be used by object. -1 means none. This function does substantial message manipulation to set up the message from the Clock object to the current object to define the Tick. Furthermore, if the object has both init and proc methods, it will set them both up, with the init method on 't-1' and the proc method on 't'
Definition at line 251 of file Element.cpp.
References addClockMsg(), cinfo(), cinfo_, dropAllMsgsFromSrc(), Cinfo::findFinfo(), Cinfo::name(), and tick_.
Referenced by innerCopyElements(), Shell::innerCreate(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), Streamer::reinit(), Neutral::setTick(), Stoich::unZombifyModel(), and zombieSwap().
void Element::showFields | ( | ) | const |
Utility function for printing out all fields and their values
Definition at line 623 of file Element.cpp.
References cinfo_, Id::eref(), Cinfo::finfoMap(), id(), and name.
void Element::showMsg | ( | ) | const |
Utility function for traversing and displaying all messages
Definition at line 313 of file Element.cpp.
References cinfo_, Msg::e1(), Msg::e2(), Cinfo::finfoMap(), SrcFinfo::getBindIndex(), Msg::getMsg(), getName(), m_, msgBinding_, Finfo::name(), and name_.
|
pure virtual |
Returns start dataIndex on specified node.
Implemented in MsgElement, GlobalDataElement, LocalDataElement, and FieldElement.
Referenced by HopFunc1< A >::dataOpVec(), and FieldElement::startDataIndex().
|
pure virtual |
Returns number of field entries on local node. If this is not a FieldElement, returns numLocalData, assuming 1 field per data.
Implemented in MsgElement, DataElement, and FieldElement.
|
virtual |
virtual func, this base version must be called by all derived classes
zombieSwap: replaces the Cinfo and data of the zombie. Allocates a new data block using zCinfo, that matches the number of entries of the old data block. Deletes old data. The base version calls the Clock object to assign a suitable default clock.
Reimplemented in MsgElement, DataElement, and FieldElement.
Definition at line 159 of file Element.cpp.
References Clock::lookupDefaultTick(), Cinfo::name(), setTick(), and tick_.
Referenced by ReadKkit::buildSumTotal(), ReadKkit::setupSlaveMsg(), DataElement::zombieSwap(), MsgElement::zombieSwap(), ZombieFunction::zombify(), ReacBase::zombify(), CplxEnzBase::zombify(), EnzBase::zombify(), CaConcBase::zombify(), PoolBase::zombify(), HHChannelBase::zombify(), and moose::CompartmentBase::zombify().
|
private |
Stores the unique identifier for Element.
Class information
Definition at line 406 of file Element.h.
Referenced by cinfo(), replaceCinfo(), setTick(), showFields(), and showMsg().
|
private |
|
private |
True if the element is marked for destruction.
Definition at line 446 of file Element.h.
Referenced by isDoomed(), and markAsDoomed().
|
private |
True if messages have been changed and need to digestMessages.
Definition at line 443 of file Element.h.
Referenced by markRewired(), and msgDigest().
|
private |
Message vector. This is the low-level messaging information. Contains info about incoming as well as outgoing Msgs.
Definition at line 412 of file Element.h.
Referenced by addMsg(), clearAllMsgs(), dropAllMsgsFromSrc(), dropMsg(), findCaller(), getInputMsgs(), getMsgSourceAndSender(), msgIn(), showMsg(), and ~Element().
|
private |
Binds an outgoing message to its function. Each index (BindIndex) gives a vector of MsgFuncBindings, which are just pairs of ObjId, FuncId. SrcFinfo keeps track of the BindIndex to look things up. Note that a single BindIndex may refer to multiple Msg/Func pairs. This means that a single MsgSrc may dispatch data through multiple msgs using a single 'send' call.
Definition at line 423 of file Element.h.
Referenced by addMsgAndFunc(), clearAllMsgs(), clearBinding(), digestMessages(), dropMsg(), findBinding(), getFieldsOfOutgoingMsg(), getMsgAndFunc(), hasMsgs(), printMsgDigest(), putOffNodeTargetsInDigest(), putTargetsInDigest(), showMsg(), and ~Element().
|
private |
Digested vector of message traversal sets. Each set has a Func and element to lead off, followed by a list of target indices and fields. The indexing is like this: msgDigest_[ numSrcMsgs * dataIndex + srcMsgIndex ][ func# ] So we look up a vector of MsgDigests, each with a unique func, based on both the dataIndex and the message number. This is designed so that if we expand the number of data entries we don't have to redo the ordering.
Definition at line 437 of file Element.h.
Referenced by clearAllMsgs(), digestMessages(), msgDigest(), printMsgDigest(), putOffNodeTargetsInDigest(), and putTargetsInDigest().
|
private |
|
private |
Returns tick on which element is scheduled. -1 for disabled.
Definition at line 440 of file Element.h.
Referenced by getTick(), innerSetTick(), setTick(), and zombieSwap().