Commit a39662f9 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

ppn for nersc

parent d7c46042
......@@ -265,9 +265,9 @@ echo $PYTHONPATH
def launch_nersc (pipe, n, port=50000, authkey='secret', job_name="job_", log_level=logging.WARNING, cpu_time="00:30:00", job_header="""
def launch_nersc (pipe, n, ppn=1, port=50000, authkey='secret', job_name="job_", log_level=logging.WARNING, cpu_time="00:30:00", job_header="""
#PBS -q regular
#PBS -l nodes=%d:ppn=1
#PBS -l nodes=%d:ppn=%d
"""):
""" Launch a bunch of distant workers through a PBS batch system using aprun.
"""
......@@ -296,6 +296,10 @@ sleep 5
mpirun -np %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOSTNAME
"""
nnode=n/ppn
if (n%ppn>0):
nnode=nnode+1
import cPickle as pickle
pipedesc = pickle.dumps(pipe)
jobfile = get_log_file (pipe, '.job')
......@@ -303,7 +307,7 @@ mpirun -np %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOSTNAME
logfile = jobfile.replace('job', 'log')
with closing(file(jobfile,'w')) as f:
f.write(server_file%(n, cpu_time, log_level, port, pipedesc, n, port, authkey, logfile))
f.write(server_file%(nnode, ppn, cpu_time, log_level, port, pipedesc, n, port, authkey, logfile))
subprocess.Popen(['qsub','-o' ,logfile, '-e', errfile,jobfile]).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