From eebaad1731b0c6bae33677a39ff59662191e02cf Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 13 Aug 2015 21:41:35 +0200 Subject: [PATCH] parallel: --memfree now uses /proc/meminfo for GNU/Linux. --- doc/release_new_version | 8 ++++++++ src/parallel | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index ffc625a9..a2de8d2a 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -224,6 +224,8 @@ Haiku of the month: New in this release: +* @arg can now be used in {= =}: parallel echo '{= $arg[2] < 5 and $_="j" =}' ::: 1 2 3 ::: 4 5 6 + * Version of GNU Parallel that uses PostgreSQL as backend https://github.com/stephen-fralich/parallel-sql/ * <> GNU Parallel was used (unfortunately without citation) in: MUGBAS: a species free gene-based programme suite for post-GWAS analysis http://www.ncbi.nlm.nih.gov/pubmed/25765345 @@ -238,6 +240,12 @@ New in this release: * Who actually reads the code? http://www.fsf.org/blogs/community/who-actually-reads-the-code +* Introduction to GNU Parallel http://erictleung.com/2015/08/06/intro-to-gnu-parallel/ + +* ¿Alguien se lee el código? http://www.taringa.net/post/linux/18854759/Alguien-se-lee-el-codigo.html + +* ¿Quién se lee el código fuente? https://victorhckinthefreeworld.wordpress.com/2015/08/12/quien-se-lee-el-codigo-fuente/ + * Distribution des traitements avec GNU Parallel http://blog.inovia-conseil.fr/?p=226#4 * Эксперимент по проверке, читают ли код открытых проектов http://www.opennet.ru/opennews/art.shtml?num=42718 diff --git a/src/parallel b/src/parallel index 7a904874..13567b1c 100755 --- a/src/parallel +++ b/src/parallel @@ -4172,6 +4172,9 @@ sub memfree_recompute { # TODO add sshlogin and backgrounding $self->{'memfree'} = qx{ $script }; + if(not $self->{'memfree'}) { + ::die_bug("Less than 1 byte free"); + } #::debug("mem","New free:",$self->{'memfree'}," "); } @@ -4183,12 +4186,12 @@ sub memfree_recompute { # shellscript for giving available memory in bytes if(not $script) { my %script_of = ( - # $ free - # total used free shared buffers cached - # Mem: 8075152 4922780 3152372 338856 233356 1658604 - # -/+ buffers/cache: 3030820 5044332 - # Swap: 8286204 116924 8169280 - "linux" => q{ print (1024*((grep /buffers.cache/, `free`)[0] =~ /buffers.cache:\s+\S+\s+(\S+)/)[0]) }, + # /proc/meminfo + # MemFree: 7012 kB + # Buffers: 19876 kB + # Cached: 431192 kB + # SwapCached: 0 kB + "linux" => q{ print 1024 * qx{ awk '/^((Swap)?Cached|MemFree|Buffers):/ { sum += \$2} END { print sum }' /proc/meminfo } }, # $ vmstat 1 1 # procs memory page faults cpu # r b w avm free re at pi po fr de sr in sy cs us sy id