Exemplo n.º 1
0
void remoteFieldGetVec( const Eref& e, unsigned int bindIndex,
				vector< double >& getRecvBuf )
{
	static ObjId oi( 3 );
	static PostMaster* p = reinterpret_cast< PostMaster* >( oi.data() );
	p->remoteFieldGetVec( e, bindIndex, getRecvBuf );
}
Exemplo n.º 2
0
void remoteGetVec( const Eref& e, unsigned int bindIndex,
				vector< vector< double > >& getRecvBuf,
				vector< unsigned int >& numOnNode )
{
	static ObjId oi( 3 );
	static PostMaster* p = reinterpret_cast< PostMaster* >( oi.data() );
	p->remoteGetVec( e, bindIndex, getRecvBuf, numOnNode );
}
Exemplo n.º 3
0
void EndoMesh::setSurround( const Eref& e, ObjId v )
{
	if ( !v.element()->cinfo()->isA( "ChemCompt" ) ) {
		cout << "Warning: 'surround' may only be set to an object of class 'ChemCompt'\n";
		cout << v.path() << " is of class " << v.element()->cinfo()->name() << endl;
		return;
	}
	surround_ = v;
	parent_ = reinterpret_cast< const MeshCompt* >( v.data() );
}
Exemplo n.º 4
0
// static function, executed by the Synapse Element when a message is
// dropped from the Element. Contracts the parent synapse array to fit.
// Typically the SynHandler won't resize, easier to just leave an
// unused entry. Could even reuse if a synapse is added later, but all
// this policy is independent of the Synapse class.
void Synapse::dropMsgCallback(
				const Eref& e, const string& finfoName, 
			    ObjId msg, unsigned int msgLookup )
{
	if ( finfoName == "addSpike" ) {
		ObjId pa = Neutral::parent( e );
		SynHandlerBase* sh = 
				reinterpret_cast< SynHandlerBase* >( pa.data() );
		sh->dropSynapse( msgLookup );
	}
}
Exemplo n.º 5
0
// static function, executed by the Synapse Element when a message is
// added to the Element. Expands the parent synapse array to fit.
void Synapse::addMsgCallback(
				const Eref& e, const string& finfoName, 
			    ObjId msg, unsigned int msgLookup )
{
	if ( finfoName == "addSpike" ) {
		ObjId pa = Neutral::parent( e );
		SynHandlerBase* sh = 
				reinterpret_cast< SynHandlerBase* >( pa.data() );
		unsigned int synapseNumber = sh->addSynapse();
		SetGet2< unsigned int, unsigned int >::set( 
						msg, "fieldIndex", msgLookup, synapseNumber );
	}
}
Exemplo n.º 6
0
void dispatchBuffers( const Eref& e, HopIndex hopIndex )
{
	static ObjId oi( 3 );
	static PostMaster* p = reinterpret_cast< PostMaster* >( oi.data() );
	if ( Shell::numNodes() == 1 )
		return;
	if ( hopIndex.hopType() == MooseSetHop ||
	  	hopIndex.hopType() == MooseGetHop ) {
		p->dispatchSetBuf( e );
	}
	if ( hopIndex.hopType() == MooseSetVecHop ) {
		p->dispatchSetBuf( e );
	}
	// More complicated stuff for get operations.
}
Exemplo n.º 7
0
double* addToBuf( const Eref& er, HopIndex hopIndex, unsigned int size )
{
	static ObjId oi( 3 );
	static PostMaster* p = reinterpret_cast< PostMaster* >( oi.data() );
	if ( hopIndex.hopType() == MooseSendHop ) {
		return p->addToSendBuf( er, hopIndex.bindIndex(), size );
	} else if ( hopIndex.hopType() == MooseSetHop ||
			 hopIndex.hopType() == MooseSetVecHop ) {
		p->clearPendingSetGet(); // Cannot touch set buffer if pending.
		return p->addToSetBuf( er, hopIndex.bindIndex(),
						size, hopIndex.hopType() );
	} else if ( hopIndex.hopType() == MooseTestHop ) {
		return addToTestBuf( er, hopIndex.bindIndex(), size );
	}
	assert( 0 ); // Should not get here.
	return 0;
}
Exemplo n.º 8
0
double* remoteGet( const Eref& e, unsigned int bindIndex )
{
	static ObjId oi( 3 );
	static PostMaster* p = reinterpret_cast< PostMaster* >( oi.data() );
	return p->remoteGet( e, bindIndex );
}