From 3a7097684cbe5285a5af4176866397b5ad5e098c Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Tue, 2 Aug 2011 23:18:28 +0200 Subject: [PATCH] parallel: ignore errors from sysctl. sr #107762: get multiple sysctl: not found message when running parallel --- doc/release_new_version | 37 +++++++++++++++++++++++++++---------- src/parallel | 8 ++++---- src/parallel.pod | 30 ++++++++++++++++++++++++------ 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index 9aa31121..b3116fa1 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -166,24 +166,41 @@ https://lists.gnu.org/mailman/admindb/parallel from:tange@gnu.org to:parallel@gnu.org, bug-parallel@gnu.org, info-gnu@gnu.org, bug-directory@gnu.org cc:Peter Simons , Sandro Cazzaniga , - Tim Cuthbertson , Ludovic Courtès , - Markus Ammer , Pavel Nuzhdin , - Phil Sung , Michael Shigorin , - Andrew McFague , Steven M. Christensen , - Chris Howey , Fethican Coşkuner , - Rogério Brito , - Koen Vervloesem , R. Tyler Croy , - ryoichiro.suzuki@gmail.com,kerick@shiftedbit.net, - Christian Faulhammer , Ryoichiro Suzuki , - Jesse Alama + Tim Cuthbertson , Ludovic Courtès + , Markus Ammer , Pavel Nuzhdin + , Phil Sung , Michael + Shigorin , Andrew McFague , + Steven M. Christensen , Chris Howey + , Fethican Coşkuner , + Rogério Brito , Koen Vervloesem + , R. Tyler Croy , + kerick@shiftedbit.net, Christian Faulhammer , + Ryoichiro Suzuki , Jesse Alama + Subject: GNU Parallel 20110822 ('Utøya') released GNU Parallel 20110822 ('Utøya') has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ +Debian and Ubuntu people have complained GNU Parallel is not in their +official distributions. + +Ubuntu people: Log into LaunchPad and on +https://bugs.launchpad.net/ubuntu/+bug/740630 click 'This bug affect +me too'. + +Debian people: This is the (2 years old) bug to push: +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518696 + + New in this release: +* Neat example of a parallel webcrawler in the man page. + +* Blog post in Japanese. + http://dminor11th.blogspot.com/2011/08/gnu-parallel.html + * Blog post about optimizing JPEGs. Thanks to Thomas Jost. http://schnouki.net/2011/07/22/optimizing-jpeg-pictures/ diff --git a/src/parallel b/src/parallel index b97213f5..ea99c35e 100755 --- a/src/parallel +++ b/src/parallel @@ -480,7 +480,7 @@ sub get_options_from_array { sub parse_options { # Returns: N/A # Defaults: - $Global::version = 20110722; + $Global::version = 20110802; $Global::progname = 'parallel'; $Global::infinity = 2**31; $Global::debug = 0; @@ -2463,7 +2463,7 @@ sub no_of_cpus_darwin { # Number of physical CPUs on Mac Darwin # undef if not Mac Darwin my $no_of_cpus = - (`sysctl -n hw.physicalcpu` + (`sysctl -n hw.physicalcpu 2>/dev/null` or `sysctl -a hw 2>/dev/null | grep -w physicalcpu | awk '{ print \$2 }'`); return $no_of_cpus; @@ -2474,7 +2474,7 @@ sub no_of_cores_darwin { # Number of CPU cores on Mac Darwin # undef if not Mac Darwin my $no_of_cores = - (`sysctl -n hw.logicalcpu` + (`sysctl -n hw.logicalcpu 2>/dev/null` or `sysctl -a hw 2>/dev/null | grep -w logicalcpu | awk '{ print \$2 }'`); return $no_of_cores; @@ -2485,7 +2485,7 @@ sub no_of_cpus_freebsd { # Number of physical CPUs on FreeBSD # undef if not FreeBSD my $no_of_cpus = - (`sysctl -a dev.cpu | grep \%parent | awk '{ print \$2 }' | uniq | wc -l | awk '{ print \$1 }'` + (`sysctl -a dev.cpu 2>/dev/null | grep \%parent | awk '{ print \$2 }' | uniq | wc -l | awk '{ print \$1 }'` or `sysctl hw.ncpu 2>/dev/null | awk '{ print \$2 }'`); chomp $no_of_cpus; diff --git a/src/parallel.pod b/src/parallel.pod index 46b1bb77..b2347440 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -51,9 +51,9 @@ B is capable of. You can also watch the intro video for a quick introduction: http://tinyogg.com/watch/TORaR/ http://tinyogg.com/watch/hfxKj/ and http://tinyogg.com/watch/YQuXd/ or -http://www.youtube.com/watch?v=OpaiGYxkSuQ and -http://www.youtube.com/watch?v=1ntxT-47VPA - +http://www.youtube.com/watch?v=OpaiGYxkSuQ +http://www.youtube.com/watch?v=1ntxT-47VPA and +http://www.youtube.com/watch?v=fOX1EyHkQwc =head1 OPTIONS @@ -1368,19 +1368,19 @@ B =head1 EXAMPLE: Inserting multiple arguments -When moving a lot of files like this: B you will +When moving a lot of files like this: B you will sometimes get the error: B because there are too many files. You can instead do: -B +B This will run B for each file. It can be done faster if B gets as many arguments that will fit on the line: -B +B =head1 EXAMPLE: Context replace @@ -1860,6 +1860,24 @@ B If you have a lot of hosts use '-j0' to access more hosts in parallel. +=head1 EXAMPLE: Parallelizing rsync + +B is a great tool, but sometimes it will not fill up the +available bandwidth. This is often a problem when copying several big +files over high speed connections. + +The following will start one B per big file in I to +I on the server I: + +B + +The dirs created may end up with wrong permissions and smaller files +are not being transferred. To fix those run B a final time: + +B + + =head1 EXAMPLE: Use multiple inputs in one command Copy files like foo.es.ext to foo.ext: