[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to refrain only use certain number of processors



On Mon, Jan 30, 2012 at 06:06:06PM +0800, lina wrote:
> Hi,
> 
> ( sorry if it a bit off-topic)
> 
> I have a script like
> 
> #!/bin/bash
> 
> for i in {0..108}
> do
> 
> some job will run for mins &
> 
> done
> 
> Here I used & for some kinda of parallel.
> but there is a problem,
> 
> I wished at most it only run 8 jobs simultantly, no more than 8, once
> finished, a new job can continue,
> 
> Some suggestions?

No doubt someone will be able to critique my makefile (I just cobbled it
together from a few minutes reading).

cat <<EOF >Makefile
all: part1 part2 part3 part4 .... part108

part1: DoSomething.sh

part2: DoSomethingElse.sh

part3 part4 part5: echo "This is part $@"

EOF

make -j8 all


-- 
Darac Marjal


Reply to: