On Thursday 24,January,2013 05:34 PM, lina wrote:
> Hi,
> 
> I have some process if run in background, it always very slow, like:
> 
> $ ps f | awk '{print $1, $2,$3,$4, $5}'
> 
> 124201 pts/13 Ss+ 0:00 -bash
> 29572 pts/116 Ss+ 0:00 -bash
> 29275 pts/63 Ss+ 0:00 -bash
> 22080 pts/14 Ss+ 0:00 -bash
> 11581 pts/2 Ss 0:00 -bash
> 2920 pts/2 R+ 0:00 \_
> 2921 pts/2 S+ 0:00 \_
> 2922 pts/2 S+ 0:00 \_
> 108014 pts/13 D 3:16 cal_dist
> 108013 pts/13 D 3:17 cal_dist
> 108012 pts/13 D 2:57 cal_dist
> 108011 pts/13 D 3:00 cal_dist
> 108010 pts/13 D 3:17 cal_dist
> 108009 pts/13 D 3:18 cal_dist
> 108008 pts/13 D 3:15 cal_dist
> 108007 pts/13 D 3:00 cal_dist
> 108006 pts/13 D 3:15 cal_dist
> 108005 pts/13 D 3:16 cal_dist
> 108004 pts/13 D 3:16 cal_dist
> 108003 pts/13 D 3:16 cal_dist
> 108002 pts/13 D 3:16 cal_dist
> 108001 pts/13 D 3:16 cal_dist
> 108000 pts/13 D 3:16 cal_dist
> 107999 pts/13 D 3:16 cal_dist
> 
> I use something like
> 
> echo"1
> 2" > idx.txt
> 
> for i in `seq w 1 1 16`
> do
> 
> cal_dist -i $i.in -o $i.out < idx.txt &
> 
> done

The xargs alternative is something like:

$ seq -w 1 1 16 | xargs -n 1 -P 8 -I A cal_dist ../../dist_A.out

But there is a problem, I need to select the idx.txt, namely pick "1
2" in prompt during the running of cal_dist, but I am a bit stuck with
this.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/5101070c.7020...@gmail.com

Reply via email to