Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Or (cd "$d" && exec qsub runme.pbs) to avoid having to restore the cwd and not run qsub if cd failed. Commented Dec 24, 2021 at 6:46
  • I haven't used this sort of setup in years, does qsub return immediately or will it wait until the job has finished running? Commented Dec 24, 2021 at 7:38
  • @terdon it's been ages since i worked with PBS or Torque too (I always preferred SLURM, anyway). But qsub submits the job to the queue, then it exits - that's it's purpose. It doesn't wait for the job to finish - it doesn't even know when it will start, let alone finish. The scheduler runs the job according to its rules (timing, permissions, priorities, etc), and when it has the resources (cpu cores/threads, gpus, memory, etc) available for the job. Anyway, that's why I think running qsub with & isn't needed and would probably be a bad idea. Commented Dec 24, 2021 at 9:46
  • I will try this solution and see. Thanks Commented Dec 25, 2021 at 7:07
  • Thankyou @cas slution provided works fine. Commented Dec 25, 2021 at 8:00