0
$\begingroup$

I am currently using Task Spooler, which is a job scheduler I have installed on my iMac. I have encountered a problem in which I cannot execute a job properly.

Using a bash script, this is how I run can use Task Spooler effectively:

K="opt"  # Jobname
ts -S 1 # Number of jobs to run (1 or 2)

for a in *inp
do
    ts -m -L $K bash -c "nohup ~/ORCA/orca $a > $a.out"
done

However, I need to run an executable that then runs another file that contains an executable. Without Task Spooler, I am able to run it like this (using a bash script):

a=2 # First job
b=2 # Last job

while [ $a -le $b ]
do
    ./string.exe 000$a > ./scratch/paragsm000$a &
    ((a=a+1))
done

string.exe uses another file (that is executable) with the below command:

~/ORCA/orca $ofile > $ofileout

However, this results in me only being able to run one job at a time (need two cores for efficiency, but only have two cores) and I have to start each job individually (I have ~30 to run). I have been unable to find the proper settings using Task Spooler. Does anyone know how a solution to my problem, or of an alternative software I could use?

$\endgroup$

1 Answer 1

1
$\begingroup$

I think your question is a bit under-specified. However, a few simple tricks should cure your problem.

First, you should be writing shell scripts that contain the required commands. Use taskspooler to call those scripts (or the commands within them) as appropriate. If you nest your calls to ts appropriately, taskspooler should have no problem handling them.

#! /bin/bash

for var in 1 2 3 4 5 .. 30
do
    ts ./executable.$var
done

If you need dependencies, you can use the -D and -L flags (see documentation).

$\endgroup$
9
  • $\begingroup$ I have added proper examples to my question. Could you please take a look and let me know what you think? Or how I could improve the question further? $\endgroup$ Oct 7, 2020 at 23:25
  • $\begingroup$ I can’t parse your update. Can you create a MWE $\endgroup$
    – user20857
    Oct 8, 2020 at 2:52
  • $\begingroup$ You probably won’t be able too unless you have the required software installed. $\endgroup$ Oct 8, 2020 at 6:04
  • $\begingroup$ I’ll try to create something that doesn’t require the software, but still has the issue. $\endgroup$ Oct 8, 2020 at 6:13
  • $\begingroup$ I use taskspooler regularly. I meant that I can’t mentally parse your problem because it’s rather large and has a lot of unnecessary lines $\endgroup$
    – user20857
    Oct 8, 2020 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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