Start program depending on processor workload

Hi community,

I'm looking for a script/code which starts a shell script with a MPI process depending on:
a) the processor workload, i.e. if the workload falls below a certain limit
b) alternatively if the previous process finished, e.g. if a process ID disappears

I need this for computations on a linux cluster, and I would run more than one model in one night. I know, the runs need only a couple of hours and it would be nice to have subsequent computations (at least two).
It is ensured that the processor workload does not fall below about 80% within the run.

I'm rather beginner in linux shell programming, so it would be helpful to have a relatively clear description :wink: but please write your ideas, even if it's only a search advice or whatever...

Regards
Chris

ps.: OS Linux Centos 5.2

Hi,

I am not sure about the MPI process etc,

(1) However, you can check the processor work load using either "top" or "mpstat" and see if it's fall below the benchmark.

(2) If so , start the script ( before starting , you can "grep" for the previous process like : ps -ef | grep "give the name of the script/process" to see if it's running.

man at :

Thank you!
If I understand the batch command in the right way,
I can pass the shell script name or everything behind the batch command will be executed if the load condition is satisfied?

The load average is the value which is given by the uptime command?