I'm trying to use a python script to run a series of oommf simulations on a unix cluster but I'm getting stuck at the point where I send a command from python to bash. I'm using the line:-
subprocess.check_call('qsub shellfile.sh')
Which returns exit code 191. What is exit code 191, I can't seem to be able to find it online. It may be a PBS error rather than a unix error but I'm not sure. The error doesn't seem to be in the shell file itself since the only commands in there:-
#!/bin/bash
# This is an example submit script for the hello world program.
# OPTIONS FOR PBS PRO ==============================================================
#PBS -l walltime=1:00:00
# This specifies the job should run for no longer than 24 hours
#PBS -l select=1:ncpus=8:mem=2048mb
# This specifies the job needs 1 'chunk', with 1 CPU core, and 2048 MB of RAM (memory).
#PBS -j oe
# This joins up the error and output into one file rather that making two files
##PBS -o $working_folder/$PBS_JOBID-oommf_log
# This send your output to the file "hello_output" rather than the standard filename
# OPTIONS FOR PBS PRO ==============================================================
#PBS -P HPCA-000987-EFR
#PBS -M [email protected]
#PBS -m abe
# Here we just use Unix command to run our program echo "Running on
hostname
"sleep 20
echo "Finished job now""
Which should just print the hostname and 'Finished job now'
Thanks
subprocess
is actually right (what you posted will give you a PythonOSError
) it depends on the implementation of the script. The error codes change depending on the implementation. – BorrajaX Apr 7 '14 at 13:53check_call
. – chepner Apr 7 '14 at 14:36qsub
we can't know, either. Which vendor and version? Does it have a manual page? Online? – tripleee Apr 7 '14 at 17:07