def create_controller(): # TODO: should this \be moved to the init function? """ Creates a controller entity on this proces. Strictly speaking, this is not required, but is highly useful. The controller id will be (!,0) in a serial simulation. In a parallel simulation, it will be (!,n) where n is the MPI rank of this python process. """ core.create_entity(('!',core.get_rank()),Controller)
def create_controller(): # TODO: should this \be moved to the init function? """ Creates a controller entity on this proces. Strictly speaking, this is not required, but is highly useful. The controller id will be (!,0) in a serial simulation. In a parallel simulation, it will be (!,n) where n is the MPI rank of this python process. """ core.create_entity(('!', core.get_rank()), Controller)
def get_controller(): """ A helper function that returns the handle of the controller object for this process """ return core.get_entity(('!', core.get_rank()))
def get_controller(): """ A helper function that returns the handle of the controller object for this process """ return core.get_entity(('!',core.get_rank()))
def __init__(self, ID, lp, entity_input, py_obj=None): if py_obj is None: py_obj = self super(Controller, self).__init__(ID, lp, entity_input, py_obj) ds.debug2.write("Controller", self.get_id(), "is being created on rank: ", core.get_rank()) # all other controllers are its neighbors nm = core.get_num_machines() self.neighbors_ = zip(['!'] * nm, range(nm)) # remove own id from neighbor list self.neighbors_.remove(self.get_id()) #install process manager service self.install_service(pm.ProcessManager, pm.eAddr_ProcessManager) self.pmgr_ = self.get_service(pm.eAddr_ProcessManager)
def __init__(self,ID,lp,entity_input,py_obj=None): if py_obj is None: py_obj = self super(Controller,self).__init__(ID,lp,entity_input,py_obj) ds.debug2.write("Controller",self.get_id(),"is being created on rank: ", core.get_rank()) # all other controllers are its neighbors nm = core.get_num_machines() self.neighbors_ = zip(['!']*nm,range(nm)) # remove own id from neighbor list self.neighbors_.remove(self.get_id()) #install process manager service self.install_service(pm.ProcessManager, pm.eAddr_ProcessManager) self.pmgr_ = self.get_service(pm.eAddr_ProcessManager)