Fixed: bug #36151: swap_activity broken in v20120322. Passes testsuite.

This commit is contained in:
Ole Tange 2012-04-21 00:34:24 +02:00
parent 457320998f
commit 463ec5bc0b
4 changed files with 13 additions and 10 deletions

View file

@ -537,7 +537,7 @@ sub get_options_from_array {
sub parse_options {
# Returns: N/A
# Defaults:
$Global::version = 20120420;
$Global::version = 20120421;
$Global::progname = 'parallel';
$Global::infinity = 2**31;
$Global::debug = 0;
@ -2155,9 +2155,11 @@ sub swap_activity {
-e $ENV{'HOME'}."/.parallel" or mkdir $ENV{'HOME'}."/.parallel";
-e $ENV{'HOME'}."/.parallel/tmp" or mkdir $ENV{'HOME'}."/.parallel/tmp";
my $swap_activity;
$swap_activity = ("vmstat 1 2 2>/dev/null | tail -n1 | awk '{print \$7*\$8}' || ".
# If the (remote) machine is Mac and the above fails, try this:
"vm_stat 1 | head -n 3 | tail -n1 | awk '{print \$9*\$10}'");
# If the (remote) machine is Mac we should use vm_stat
# swap_in and swap_out on GNU/Linux is $7 and $8
# swap_in and swap_out on Mac is $10 and $11
$swap_activity = q[ { vmstat 1 2> /dev/null || vm_stat 1; } | ].
q[ awk 'NR!=4{next} NF==16{print $7*$8} NF==11{print $10*$11} {exit}' ];
if($self->{'string'} ne ":") {
$swap_activity = $self->sshcommand() . " " . $self->serverlogin() . " " .
::shell_quote_scalar($swap_activity);

View file

@ -13,6 +13,7 @@ testsuite: ../src/parallel tests-to-run/* wanted-results/* startdb
niceload true || (echo niceload is required for testsuite; /bin/false)
which burnP6 || (echo burnP6 is required for testsuite; /bin/false)
which timeout || (echo timeout is required for testsuite; /bin/false)
parallel ssh parallel@parallel-server{} parallel --minversion 20100101 ::: 1 2 3 || (echo parallel on remote required for testsuite; /bin/false)
time sh Start.sh
date

View file

@ -1,9 +1,9 @@
### Test of --retries - it should run 13 jobs in total
13
12
### Test of --retries - it should run 25 jobs in total
25
24
### Test of --retries - it should run 49 jobs in total
49
48
### Bug with --retries
8
8

View file

@ -51,11 +51,11 @@
3
### Test --nonall
vm1
vm10
vm11
### Test --nonall -u
vm10
vm11
vm1
vm10
vm11
vm1
### Test read sshloginfile from STDIN
vm1