From 1f43b57e64ca3fd2df27f035de12b1d2f6009210 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Fri, 23 May 2014 19:57:04 +0200 Subject: [PATCH] parallel: No need to 'cat /proc/cpuinfo' when you can just open. --- doc/release_new_version | 38 +++++++++++--------------------------- src/parallel | 4 ++-- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index 77a34fb6..12375362 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -14,6 +14,7 @@ Modified => alpha configure.ac: AC_INIT([parallel], [20100422], [bug-parallel@gnu.org]) src/parallel: $Global::version = 20100422; README: parallel-20130222 + YYYYMMDD=`yyyymmdd` perl -i -pe "s/20\d\d\d\d\d\d/$YYYYMMDD/" configure.ac perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/parallel @@ -214,43 +215,26 @@ cc:Tim Cuthbertson , Ryoichiro Suzuki , Jesse Alama -Subject: GNU Parallel 20140522 ('Boko Haram') released +Subject: GNU Parallel 20140622 ('Nej') released -GNU Parallel 20140522 ('Boko Haram') has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ +GNU Parallel 20140622 ('Nej') has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ +Haiku of the month: + + goodbye to xargs + quoting is still a black art + welcome parallel + -- Malcolm Cook New in this release: -* Use --semaphoretimeout to ignore the semaphore lock after a while. - -* {%} introduced as job slot replacement string. It has known bugs. - -* --slotreplace changes slot replacement string. - -* GNU Parallel officially in Solaris 11.2beta https://blogs.oracle.com/alanc/entry/solaris_11_2_changes_to - -* GNU Parallel was cited in: A Comparison of Antenna Placement Algorithms http://abhinavjauhri.com/publications/eap.pdf - -* Using GNU Parallel on a PBS cluster (nice use of --shebang-wrap) https://docs.it4i.cz/anselm-cluster-documentation/resource-allocation-and-job-execution/capacity-computing - -* BioLite uses GNU Parallel: https://bitbucket.org/caseywdunn/biolite - -* Isitdown uses GNU Parallel: http://www.isi.edu/~calvin/isitdown.md - -* Convert FLAC to MP3 with GNU parallel http://www.blogobramje.nl/posts/Convert_FLAC_to_MP3_with_GNU_parallel/ - -* JD Edwards Business Function Documentation http://www.azertech.net/content/jd-edwards-business-function-documentation - -* Tools of the trade http://blog.eikeland.se/2014/05/01/tools-of-the-trade/ - -* How I start a bioinformatics project http://nickloman.github.io/2014/05/14/how-i-start-a-bioinformatics-project/ - -* No:The-Me GNU Parallel http://adityalaghate.in/gnu-parallel.html +* Speeding up grep log queries with GNU Parallel http://www.tripwire.com/state-of-security/incident-detection/speeding-grep-queries-gnu-parallel/ * Bug fixes and man page updates. GNU Parallel - For people who live life in the parallel lane. + = About GNU Parallel = GNU Parallel is a shell tool for executing jobs in parallel using one or more computers. A job is can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU Parallel can then split the input and pipe it into commands in parallel. diff --git a/src/parallel b/src/parallel index cb22d8b5..e7612f11 100755 --- a/src/parallel +++ b/src/parallel @@ -3599,7 +3599,7 @@ sub no_of_cpus_gnu_linux { $no_of_cpus = 0; $no_of_cores = 0; my %seen; - open(my $in_fh, "-|", "cat /proc/cpuinfo") || return undef; + open(my $in_fh, "<", "/proc/cpuinfo") || return undef; while(<$in_fh>) { if(/^physical id.*[:](.*)/ and not $seen{$1}++) { $no_of_cpus++; @@ -3618,7 +3618,7 @@ sub no_of_cores_gnu_linux { my $no_of_cores; if(-e "/proc/cpuinfo") { $no_of_cores = 0; - open(my $in_fh, "-|", "cat /proc/cpuinfo") || return undef; + open(my $in_fh, "<", "/proc/cpuinfo") || return undef; while(<$in_fh>) { /^processor.*[:]/i and $no_of_cores++; }