Changeset 119
- Timestamp:
- 02/10/08 01:30:37 (10 months ago)
- Files:
-
- projects/AsynCluster/trunk/asyncluster/master/control.py (modified) (1 diff)
- projects/AsynCluster/trunk/asyncluster/ndm/client.py (modified) (2 diffs)
- projects/AsynCluster/trunk/asyncluster/ndm/test/test_client.py (added)
- projects/AsynCluster/trunk/doc/example.py (modified) (1 diff)
- projects/AsynCluster/trunk/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/AsynCluster/trunk/asyncluster/master/control.py
r113 r119 202 202 that ID, and return a deferred that fires with the ID when the jobber 203 203 has attached the node as well. 204 205 TODO: Don't attach the node to the jobber if the perspective is for a 206 GUI client. 204 207 """ 205 208 def gotID(ID): projects/AsynCluster/trunk/asyncluster/ndm/client.py
r87 r119 28 28 """ 29 29 30 from twisted.internet import defer, reactor 30 import os 31 from twisted.internet import defer, reactor, threads 31 32 from twisted.cred import credentials 32 33 from twisted.spread import pb … … 75 76 """ 76 77 pass 77 78 79 def remote_bash(self, script): 80 """ 81 Runs the supplied I{script} in a bash shell, returning a deferred that 82 fires with C{True} if the shell finishes without error, i.e., with a 83 zero exit code, or C{False} otherwise. 84 """ 85 def done(result): 86 return (result[1] == 0) 87 88 pid = os.spawnl(os.P_NOWAIT, "/bin/sh", "/bin/sh", "-c", script) 89 return threads.deferToThread(os.waitpid, pid, 0).addCallback(done) 90 91 def remote_mips(self): 92 """ 93 Returns a list of bogomips float values for each core in the client's 94 CPU. 95 """ 96 values = [] 97 fh = open("/proc/cpuinfo", 'r') 98 for line in fh: 99 if line.startswith("bogomips"): 100 values.append(float(line.split()[-1])) 101 fh.close() 102 return values 103 78 104 79 105 class ClientFactory(pb.PBClientFactory): 80 106 """ 107 I am a client factory that raises a L{ConnectionError} if I fail to connect 108 to the AsynCluster server. 81 109 """ 82 110 def clientConnectionFailed(self, connector, reason): projects/AsynCluster/trunk/doc/example.py
r118 r119 349 349 # Parameters for the example 350 350 N_obs = 50000 351 N_chains = 500352 N_iter = 500351 N_chains = 1000 352 N_iter = 1000 353 353 loc, scale = 0.1, 0.4 354 354 projects/AsynCluster/trunk/setup.py
r89 r119 32 32 33 33 ### Define requirements 34 required = ['sAsync>=0.4', 'Twisted-Goodies>=0.4', 'AsynQueue>=0.2'] 34 required = [ 35 'sAsync>=0.4', 36 'Twisted-Goodies>=0.4', 37 'AsynQueue>=0.2', 38 'configobj'] 35 39 36 40 37 41 ### Define setup options 38 kw = {'version':'0. 2',42 kw = {'version':'0.3', 39 43 'license':'GPL', 40 44 'platforms':'OS Independent',
