Re: how to refrain only use certain number of processors

2012-01-31 Thread lee
lina writes: > 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 cont

Re: how to refrain only use certain number of processors

2012-01-31 Thread lina
On 1 Feb, 2012, at 1:19, Nicolas Bercher wrote: > On 31/01/2012 17:22, lina wrote: >> I need time to understand the suggestions have been given. > > Yes, of course. But this may interest other pepole on the list since your > topic since to be of great interest for others, including me! http:/

Re: how to refrain only use certain number of processors

2012-01-31 Thread lina
I need time to understand the suggestions have been given. A quick thanks. Best regards, On Wed, Feb 1, 2012 at 12:10 AM, Nicolas Bercher wrote: > What about the use of ulimit or any other tool that your sysadmin could > control? > > On the other hand, these solutions seem ok: > >  http://stack

Re: how to refrain only use certain number of processors

2012-01-31 Thread Nicolas Bercher
What about the use of ulimit or any other tool that your sysadmin could control? On the other hand, these solutions seem ok: http://stackoverflow.com/questions/1537956/bash-limit-the-number-of-concurrent-jobs Nicolas -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a

Re: how to refrain only use certain number of processors

2012-01-31 Thread Nicolas Bercher
On 31/01/2012 03:19, Cam Hutchison wrote: seq 0 108 | xargs -I@ -P8 cat A_@.txt B_@.txt C_@.txt -o ABC_@.txt Of course, this is (since cat -o doesn't exist): seq 0 108 | xargs -I@ -P8 cat A_@.txt B_@.txt C_@.txt > ABC_@.txt but "> ABC_@.txt" is out of the scope of xargs. Nicolas -- To UN

Re: how to refrain only use certain number of processors

2012-01-30 Thread Cam Hutchison
lina writes: >Yes. the ultimate goal is: >for i in {0..108} >do >cat A_$i.txt B_$i.txt C_$i.txt -o ABC_$i.txt (output as ABC_$i.txt) >done >but here I wish to use only 8 processors at most, total is 16. >the administrator of the cluster asked me not to use whole, cause >someone else needs SMP

Re: how to refrain only use certain number of processors

2012-01-30 Thread Paul E Condon
On 20120130_223623, Jochen Spieker wrote: > lina: > > > > Yes. the ultimate goal is: > > > > for i in {0..108} > > do > > cat A_$i.txt B_$i.txt C_$i.txt -o ABC_$i.txt (output as ABC_$i.txt) > > done > > Ok, so you don't actually have only A_$i filenames, but B_$i and C_$i as > well. That alone

Re: how to refrain only use certain number of processors

2012-01-30 Thread Jochen Spieker
lina: > > Yes. the ultimate goal is: > > for i in {0..108} > do > cat A_$i.txt B_$i.txt C_$i.txt -o ABC_$i.txt (output as ABC_$i.txt) > done Ok, so you don't actually have only A_$i filenames, but B_$i and C_$i as well. That alone makes my previous approach useless (as I predicted!). The other

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Tue, Jan 31, 2012 at 12:05 AM, Jochen Spieker wrote: > lina: >> >> well, a question, >> >> $ seq 0 3 | xargs --verbose echo A >> echo A 0 1 2 3 >> A 0 1 2 3 >> >> How can I make the output as: >> >> A0 A1 A2 A3 > > Your problem in this case is that xargs adds whitespace before adding > argument

Re: how to refrain only use certain number of processors

2012-01-30 Thread Jochen Spieker
lina: > > well, a question, > > $ seq 0 3 | xargs --verbose echo A > echo A 0 1 2 3 > A 0 1 2 3 > > How can I make the output as: > > A0 A1 A2 A3 Your problem in this case is that xargs adds whitespace before adding arguments. What you can do is to modify seq's output before xargs sees it: $

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Mon, Jan 30, 2012 at 10:29 PM, Jochen Spieker wrote: > lina: >> On Mon, Jan 30, 2012 at 6:35 PM, Jochen Spieker >> wrote: >>> lina: I wished at most it only run 8 jobs simultantly, no more than 8, once finished, a new job can continue, >>> >>> Xargs can be used for this. An exm

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Mon, Jan 30, 2012 at 10:11 PM, Darac Marjal wrote: > 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

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Mon, Jan 30, 2012 at 10:08 PM, Chen Wei wrote: > On Mon, Jan 30, 2012 at 06:06:06PM +0800, lina wrote: >> 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

Re: how to refrain only use certain number of processors

2012-01-30 Thread Jochen Spieker
lina: > On Mon, Jan 30, 2012 at 6:35 PM, Jochen Spieker wrote: >> lina: >>> >>> I wished at most it only run 8 jobs simultantly, no more than 8, once >>> finished, a new job can continue, >> >> Xargs can be used for this. An exmaple: >> >> $ seq 1 100 | xargs -n1 -P8 echo >> >> Seq prints the

Re: how to refrain only use certain number of processors

2012-01-30 Thread Darac Marjal
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 a

Re: how to refrain only use certain number of processors

2012-01-30 Thread Chen Wei
On Mon, Jan 30, 2012 at 06:06:06PM +0800, lina wrote: > 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,

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Mon, Jan 30, 2012 at 6:35 PM, Jochen Spieker wrote: > lina: >> >> I wished at most it only run 8 jobs simultantly, no more than 8, once >> finished, a new job can continue, > > Xargs can be used for this. An exmaple: > > $ seq 1 100 | xargs -n1 -P8 echo > > Seq prints the numbers from 1 to 100

Re: how to refrain only use certain number of processors

2012-01-30 Thread Jochen Spieker
lina: > > I wished at most it only run 8 jobs simultantly, no more than 8, once > finished, a new job can continue, Xargs can be used for this. An exmaple: $ seq 1 100 | xargs -n1 -P8 echo Seq prints the numbers from 1 to 100 (one per line) and xargs starts an echo for each argument with 8 invo

Re: how to refrain only use certain number of processors

2012-01-30 Thread lina
On Mon, Jan 30, 2012 at 6:06 PM, 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 r

how to refrain only use certain number of processors

2012-01-30 Thread lina
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