I have the following script that attempts to submit a job to the PBS queue.
import sys
import os
import subprocess
inpfile="sim.input"
qscript="run.sh"
#2.1 create a directory to launch the script from
dir="test"
os.system("mkdir {}".format(dir))
os.system("cp {} {} {}".format(qscript,inpfile,dir))
#2.2 launch the simulation
subprocess.Popen(["qsub",qscript],cwd=dir)
The script works, but after I hit Enter
, I get in the terminal an empty line, so I have to hit Enter
again to recover my prompt. This doesn't happen if I do subprocess.call()
. So, the question is how to get rid of that newline
? The following is what I see in the terminal:
dude@machine$ python submit01.py
dude@machine$ 3463.machine.com
dude@machine$
Edit: the script run.sh
#!/bin/bash
#PBS -S /bin/bash
#PBS -N job
#PBS -l nodes=1:ppn=1
#PBS -j oe
#PBS -V
cd $PBS_O_WORKDIR
pwd
sim.input
can be any file.