I have a program, called "minvappmpi", which is parallelised and itself calls qsub as a subroutine.

When I use the program on the cluster, it throws the error

qsub: command not found

If I want to submit another job using "qsub", then everything is fine. It is only when I call "qsub" inside my program that somehow the command is not found.

I think the issue is something to do with paths: somehow the environment I am working in knows where the executable "qsub" is sitting, but the cluster doesn't?

I'd like to know: firstly, how to make sure what the path is for the batch environment, and if it is different to the one for the login environment, and, secondly, if there is a way to change the path for the batch environment without root permissions?

Thanks so much for your help!

  • 1
    For a guide to setting up "PATH", see unix.stackexchange.com/questions/26047/… . If that doesn't help, you'll need to expand on "When I submit a job using the program on the cluster" - how do you submit this job? at, cron, something custom to the machine in question? – JigglyNaga Sep 7 '16 at 12:03
  • Thanks for the reply! Sorry to have been vague...I meant submit to an SGE cluster (hence qsub). I think the cluster is managed via Torque, if that is useful to know... – KR_Henninger Sep 14 '16 at 12:39
  • Oh, is qsub the command that submits a job? I can't follow which program is calling (or trying to call) qsub, and what program qsub itself is submitting. Does "submit a job using the program" mean "use the program to submit a job", or "submit (a job that uses the program)"? – JigglyNaga Sep 14 '16 at 13:27
  • Yes! Sorry...I guess I was a bit vague earlier :-) I have re-edited the question to make it more clear! – KR_Henninger Sep 16 '16 at 7:57
  • If qsub is an executable on the system, how does minvappmpi call it "as a subroutine"? Does it use eg. the system() function, as in system("qsub")? – JigglyNaga Sep 16 '16 at 11:28

Okay! I have made progress!

I tried submitting my job with

qsub -V run.sh

As I learned that this exports all the variables in qsub's command environment to the batch environment. This worked great, and now the batch environment knows where "qsub" is :-).

But I have a new problem.

I need to submit jobs on the cluster with

qsub -P Projectname

And my program doesn't know that! It just calls "qsub".

Is there any way I can get around this without having to recompile? I don't want to have to recompile because I'm running the program remotely and I don't have all the right libraries on the remote machine (and can't install them without root permissions :-))

Thanks so much for your help!

  • It sounds like qsub -V is the correct fix for your original problem, so you should end your answer after that. The second part, about running with extra command-line options, is a new question. – JigglyNaga Sep 16 '16 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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