Commit 1c110f06 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

nersc launcher update

parent 3e6b6d77
...@@ -273,10 +273,10 @@ echo $PYTHONPATH ...@@ -273,10 +273,10 @@ echo $PYTHONPATH
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=""" def launch_nersc (pipe, n, ppn=1, port=50000, authkey='secret', job_name="job_", log_level=logging.WARNING, job_header="""
#PBS -q regular #PBS -q regular
#PBS -l nodes=%d:ppn=%d #PBS -l nodes=%d:ppn=%d
"""): """, carver=False):
""" Launch a bunch of distant workers through a PBS batch system using aprun. """ Launch a bunch of distant workers through a PBS batch system using aprun.
""" """
...@@ -294,15 +294,24 @@ def launch_nersc (pipe, n, ppn=1, port=50000, authkey='secret', job_name="job_", ...@@ -294,15 +294,24 @@ def launch_nersc (pipe, n, ppn=1, port=50000, authkey='secret', job_name="job_",
#""" #"""
server_file=job_header+""" server_file=job_header+"""
#PBS -l walltime=%s
export CRAY_ROOTFS=DSL export CRAY_ROOTFS=DSL
echo "export PIPELETD_HOST=$HOST" > ~/host_info.sh echo "export PIPELETD_HOST=$HOST" > ~/host_info.sh
pipeletd -n -l %d -p %d -a $HOST << 'EOF' & pipeletd -n -l %d -p %d -a $HOST << 'EOF' &
%s %s
EOF EOF
sleep 5 sleep 5
aprun -n %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOST aprun -n %d -N %d -S %d python-mpi $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOST
""" """
server_file_carver=job_header+"""
export CRAY_ROOTFS=DSL
echo "export PIPELETD_HOST=$HOSTNAME" > ~/host_info.sh
pipeletd -n -l %d -p %d -a $HOSTNAME << 'EOF' &
%s
EOF
sleep 5
mpirun -np %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOSTNAME
"""
nnode=n/ppn nnode=n/ppn
if (n%ppn>0): if (n%ppn>0):
...@@ -314,8 +323,14 @@ aprun -n %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOST ...@@ -314,8 +323,14 @@ aprun -n %d python $PIPELETPATH/launchers.py -p %d -s %s -l %s -H $HOST
errfile = jobfile.replace('job', 'err') errfile = jobfile.replace('job', 'err')
logfile = jobfile.replace('job', 'log') logfile = jobfile.replace('job', 'log')
with closing(file(jobfile,'w')) as f: if carver:
f.write(server_file%(nnode, ppn, cpu_time, log_level, port, pipedesc, n, port, authkey, logfile)) server_file = server_file_carver
with closing(file(jobfile,'w')) as f:
f.write(server_file%(nnode, ppn, log_level, port, pipedesc, n, port, authkey, logfile))
else:
with closing(file(jobfile,'w')) as f:
f.write(server_file%(n, log_level, port, pipedesc, nnode, 24/ppn, 24/ppn/2, port, authkey, logfile))
subprocess.Popen(['qsub','-o' ,logfile, '-e', errfile,jobfile]).communicate()[0] 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