diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-01 01:16:09 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-01 01:16:09 +0000 |
commit | 279835f338400d79b84334ced0b7fbcfd0a9bc23 (patch) | |
tree | 4f4c2af435284d40e1ab62cb5b86821d5993b094 /vest | |
parent | d138cac2954d1c9fa2547608f9f340ee5f6fb3ec (diff) |
par -tailn +0
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@85 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'vest')
-rwxr-xr-x | vest/parallelize.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vest/parallelize.pl b/vest/parallelize.pl index a6fd264b..a006d924 100755 --- a/vest/parallelize.pl +++ b/vest/parallelize.pl @@ -24,6 +24,7 @@ use strict; use POSIX ":sys_wait_h"; use Cwd qw(getcwd); +my $tailn=5; # +0 = concatenate all the client logs. 5 = last 5 lines my $recycle_clients; # spawn new clients when previous ones terminate my $stay_alive; # dont let server die when having zero clients my $joblist = ""; @@ -71,15 +72,13 @@ sub escape_shell { } return $arg; } -my $tailn=5; sub preview_files { - my ($l,$skipempty,$n)=@_; + my ($l,$skipempty,$footer,$n)=@_; $n=$tailn unless defined $n; my @f=grep { ! ($skipempty && -z $_) } @$l; my $fn=join(' ',map {escape_shell($_)} @f); my $cmd="tail -n $n $fn"; - my $text=`$cmd`; - $text + `$cmd`.($footer?"\nNONEMPTY FILES:\n$fn\n":""); } sub prefix_dirname($) { #like `dirname but if ends in / then return the whole thing @@ -127,9 +126,10 @@ unless (GetOptions( "jobs=i" => \$numnodes, "pmem=s" => \$pmem, "baseport=i" => \$basep, - "iport=i" => \$randp, #ugly option name so first letter doesn't conflict +# "iport=i" => \$randp, #for short name -i "no-which!" => \$no_which, "no-cd!" => \$no_cd, + "tailn=s" => \$tailn, ) && scalar @ARGV){ print_help(); die "bad options."; @@ -339,6 +339,7 @@ sub cleanup { print STDERR "outputs:\n",preview_files(\@outs,1),"\n"; print STDERR "errors:\n",preview_files(\@errors,1),"\n"; print STDERR "cmd:\n",$cmd,"\n"; + print STDERR " cat $errordir/*.ER\nfor logs.\n"; if ($verbose){ print STDERR "Cleanup finished.\n"; } } |