[clug] Two (perhaps simple) shell questions.

Andrew Janke a.janke at gmail.com
Wed Aug 26 09:51:59 MDT 2009


> On Tuesday 18 August 2009 11:33:01 Andrew Janke wrote:
>> for i in `ls *.mnc`;
>> do
>>    do8ofthisatonce <program> $i $i.out
>> done
>
> <lots of suggestions using xargs>

Hate to drag up an old thread but while digging around I found this:

   http://code.google.com/p/ppss/

Quick demo (compress a bunch of files in a directory):

   spencer:MRI-join$ ls T1
   1.mnc  1.xfm  2.mnc  2.xfm  out.mnc

First let's do it the old way

   spencer:MRI-join$ time gzip -v T1/*
   T1/1.mnc:	 17.1% -- replaced with T1/1.mnc.gz
   T1/1.xfm:	 37.0% -- replaced with T1/1.xfm.gz
   T1/2.mnc:	 17.4% -- replaced with T1/2.mnc.gz
   T1/2.xfm:	 37.0% -- replaced with T1/2.xfm.gz
   T1/out.mnc:	 10.7% -- replaced with T1/out.mnc.gz

   real	0m9.115s
   user	0m8.773s
   sys	0m0.220s

Now lets use our new toy and attempt to make the laptop CPU heatsink useful.

   spencer:MRI-join$ time ppss.sh standalone -d T1 -c "gzip "
   Aug 27 01:48:12: INFO  Minjobs is 3
   Aug 27 01:48:12: INFO
=========================================================
   Aug 27 01:48:12: INFO                         |P|P|S|S|
   Aug 27 01:48:12: INFO  Distributed Parallel Processing Shell Script
version 2.21
   Aug 27 01:48:12: INFO
=========================================================
   Aug 27 01:48:12: INFO  Hostname:	spencer
   Aug 27 01:48:12: INFO
---------------------------------------------------------
   Aug 27 01:48:12: INFO  Found 2 logic processors.
   Aug 27 01:48:12: INFO  CPU: Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz
   Aug 27 01:48:12: INFO  Starting 2 workers.
   Aug 27 01:48:12: INFO
---------------------------------------------------------
   Aug 27 01:48:14: INFO  Currently 100 percent complete. Processed 5
of 5 items.

   real	0m4.732s
   user	0m0.492s
   sys	0m0.484s

Ah...

Apparently whoever wrote this (a "lowrentius") has gone all out and
made this thing work across hosts! I have not got to testing this part
yet nor do I see a need to given that I already have a working
gridengine install.


--
Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883


More information about the linux mailing list