Changeset 119

Show
Ignore:
Timestamp:
02/10/08 01:30:37 (10 months ago)
Author:
edsuom
Message:

Working on having computing jobs done by node worker clients separate from the GUI client

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/AsynCluster/trunk/asyncluster/master/control.py

    r113 r119  
    202202        that ID, and return a deferred that fires with the ID when the jobber 
    203203        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. 
    204207        """ 
    205208        def gotID(ID): 
  • projects/AsynCluster/trunk/asyncluster/ndm/client.py

    r87 r119  
    2828""" 
    2929 
    30 from twisted.internet import defer, reactor 
     30import os 
     31from twisted.internet import defer, reactor, threads 
    3132from twisted.cred import credentials 
    3233from twisted.spread import pb 
     
    7576        """ 
    7677        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 
    78104 
    79105class ClientFactory(pb.PBClientFactory): 
    80106    """ 
     107    I am a client factory that raises a L{ConnectionError} if I fail to connect 
     108    to the AsynCluster server. 
    81109    """ 
    82110    def clientConnectionFailed(self, connector, reason): 
  • projects/AsynCluster/trunk/doc/example.py

    r118 r119  
    349349    # Parameters for the example 
    350350    N_obs = 50000 
    351     N_chains = 500 
    352     N_iter = 500 
     351    N_chains = 1000 
     352    N_iter = 1000 
    353353    loc, scale = 0.1, 0.4 
    354354 
  • projects/AsynCluster/trunk/setup.py

    r89 r119  
    3232 
    3333### Define requirements 
    34 required = ['sAsync>=0.4', 'Twisted-Goodies>=0.4', 'AsynQueue>=0.2'] 
     34required = [ 
     35    'sAsync>=0.4', 
     36    'Twisted-Goodies>=0.4', 
     37    'AsynQueue>=0.2', 
     38    'configobj'] 
    3539 
    3640 
    3741### Define setup options 
    38 kw = {'version':'0.2', 
     42kw = {'version':'0.3', 
    3943      'license':'GPL', 
    4044      'platforms':'OS Independent',