I have a shell script that contains the following loop.
i=0
upperlimit=$verylargevariable
do
complexstuff RunManager file $i
i= 'expr $i +1'
done
This script runs on a quad-core processor and accordingly topuses about 15% of each core in a single iteration of the loop. I would like to distribute it across four kernels, so that each iteration of the loop performs complexstufffour times, one for each core, so the resources will be used more efficiently. We are talking about calculations that currently take several hours, so efficiency here is not just good practice. (The output of each iteration is obviously independent of the previous one.)
PS: A host is a server running Cent-OS, if that helps.
source
share