[Warning: the hack presented in this message is *really* sick]

>Any advice on where to look for info on this type of problem is
>appreciated,

If I understand you correctly, you want to make sure that your machine is
fully loaded all of the time, without going into an unbounded load
explosion, right ? Last time I had a similar problem (large simulation, >2
CPU-years on 4 quad PPROs) I devised the following ugly hack:

-- begin script
#!/bin/sh
# Get some initial parameters

NUM_CPUS=`grep -i processor /proc/cpuinfo | wc -l | sed 's/ *//'`

# Do the loops

while DoMoreSims; do
        # Only schedule a new sim when the load is less than the number of CPUs
        until [ `sed 's/\..*//' < /proc/loadavg` -lt $NUM_CPUS ]; do
                sleep 15
        done

        StartNewSim &

        # Sleep for a bit to let the load averages settle

        sleep 25
done
-- end script

As you see, new simulators are only started when the load is lower than the
number of CPUs. A cleaner option is probably to just start one simulator
per CPU and then wait() for them to finish before starting new ones. The
reason I didn't use this method is that a) part of my simulation was not
CPU-bound, so the load method got higher throughput and b) it was possible
to run multiple starter scripts on the same machine (for different sims)
which is verfy hard to cross-balance with the wait()-method.

HTH,

Jan-Derk Bakker.

--
Jan-Derk Bakker, [EMAIL PROTECTED]

The lazy man's proverb:
    'There's no business like slow business !'


-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to