Comment 12 for bug 509015

Revision history for this message
Toby Burnett (tburnett) wrote :

Here is the script, with an attempt to use ipcluster ssh commented out. The 64-engine case is run on one of the same nodes.
def setup_mec(engines=None, machines='tev1 tev2 tev3 tev4'.split()):
    """ On windows:start cluster and 4 engines on the local machine, in the current directory
        On linux: (our tev cluster) start controller on local machine, 16 engines/machine in all
    """
    if os.name=='nt':
        engines = engines or 4
        os.system(r'start /MIN /D %s cmd /K python C:\python25\scripts\ipcluster local -xy -n %d'% (os.getcwd(),engines))
    else:
        # on a tev machine
        engines = engines or 16 #default on a tev machine!

        #clusterfile_data='send_furl = False'\
        # + '\nengines={'\
        # + '\n'.join(['\t"%s" : %d,'%(m,engines) for m in machines])\
        # + '\n}'
        #print 'cluster info:\n%s' % clusterfile_data
        #ofile=open('clusterfile', 'w')
        #ofile.writelines(clusterfile_data)
        #ofile.close()
        #os.system('ipcluster ssh -xy --clusterfile clusterfile &')

        # old, klugy way
        os.system('ipcontroller local -xy&')
        for m in machines:
            for i in range(engines):
                time.sleep(0.1) # make sure the controller is started ?
                os.system('ssh %s ipengine&'% m) # this assumes that the environment is setup with non-interactive login