Commit 2294ec2a authored by Betoule Marc's avatar Betoule Marc Committed by Betoule Marc
Browse files

Adapt ccge launcher to launch in the multiprocessing queue

parent fd98e9fd
......@@ -502,7 +502,7 @@ EOF
'-N', name]+reduce(lambda x,y : x+y, [['-l', '%s=1'%res] for res in ressource], [])+[jobfile]
subprocess.Popen(com).communicate()[0]
def launch_ccage_worker (pipe, n, address=('127.0.0.1',5000), authkey='secret', log_level=logging.WARNING, project="planck", cpu_time='01:00:00', scratch="512M", mem="512M", ressource=['sps']):
def launch_ccage_worker (pipe, n, address=('127.0.0.1',5000), authkey='secret', log_level=logging.WARNING, project="planck", cpu_time='01:00:00', scratch="512M", mem="512M", ressource=['sps'], multicores=False):
""" Launch n worker using job array
"""
worker_file = """#! /bin/zsh -l
......@@ -519,6 +519,10 @@ echo "worker returned at $(date)"
logfile = jobfile.replace('job', 'log')
with closing(file(jobfile,'w')) as f:
f.write(worker_file%(authkey,logfile))
if multicores:
mc = ['-pe', 'multicores' , '%d'%multicores]
else:
mc = []
com=['qsub',
'-P', 'P_%s'%project,
'-l', 'fsize=%s'%scratch,
......@@ -527,7 +531,7 @@ echo "worker returned at $(date)"
'-t', '1-%d'%n,
'-o' ,logfile,
'-e', errfile,
'-N', name]+reduce(lambda x,y : x+y, [['-l', '%s=1'%res] for res in ressource], [])+[jobfile]
'-N', name]+mc+reduce(lambda x,y : x+y, [['-l', '%s=1'%res] for res in ressource], [])+[jobfile]
subprocess.Popen(com).communicate()[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment