Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
2  
So the command you're trying to execute is ''? –  piokuc Apr 7 '14 at 13:53
1  
Assuming your call to subprocess is actually right (what you posted will give you a Python OSError) it depends on the implementation of the script. The error codes change depending on the implementation. –  BorrajaX Apr 7 '14 at 13:53
    
The meaning of the return code is defined by the command executed, not check_call. –  chepner Apr 7 '14 at 14:36
    
Sorry, I don't understand. I've tried typing in the command directly into the shell but that simply returns 'qsub: Job rejected by all possible destinations' I understand that this is a problem with what I'm trying to do in unix but I thought that I was using check_call to get the exit code to tell me what's wrong, which is what I can't work out. –  user3447430 Apr 7 '14 at 17:02
    
Then error 191 is probably the numeric error code for the error message you get from the interactive invocation. Without more information about qsub we can't know, either. Which vendor and version? Does it have a manual page? Online? –  tripleee Apr 7 '14 at 17:07

1 Answer 1

Exit code 191 indicates that the project code associated with the job is invalid. This is the code in line 13:-

#PBS -P HPCA-000974-EFG

Which tells the cluster which project the code is associated with.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.