def disconnect(self,n,v = True): if n in self.below: self.channels[n].send('quit','quit') self.below.remove(n) if v:tl.log(1,'disconnected from slave',n) else: tl.detach(self.channels[n].freq,v = v) self.adjacent.remove(n) if v:tl.log(1,'disconnected from peer',n) self.rchan(n)
def disband(self,ns): bel = [] for n in ns: if n in self.channels: self.channels[n].send('quit') bel.append(n) elif n in self.below:self.below.remove(n) for n in bel: self.channels[n].send('quit') tl.detach(self.channels[n].freq) self.rchan(n)
def serve(s,r = 0): tl.sid,n,p = int(sys.argv[4]),sys.argv[2],sys.argv[3] b = tl.attach(s,r,MPI.COMM_SELF.Dup(),p) slave(n).run(comm = b,port = p) tl.detach(b)
def control(s, p, i, r=0): b = tl.attach(s, r, None, p) admin(s, p, i).run(comm=b) tl.detach(b)