From 3dfa575d202c9277060bc43a7af9351702da9f12 Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Fri, 11 Mar 2011 09:05:04 -0500 Subject: fix my dumb bug that killed qsub functionality --- vest/parallelize.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vest/parallelize.pl') diff --git a/vest/parallelize.pl b/vest/parallelize.pl index 47b77c79..2798a303 100755 --- a/vest/parallelize.pl +++ b/vest/parallelize.pl @@ -82,7 +82,7 @@ sub preview_files { my @f=grep { ! ($skipempty && -z $_) } @$l; my $fn=join(' ',map {escape_shell($_)} @f); my $cmd="tail -n $n $fn"; - check_output("$cmd").($footer?"\nNONEMPTY FILES:\n$fn\n":""); + unchecked_output("$cmd").($footer?"\nNONEMPTY FILES:\n$fn\n":""); } sub prefix_dirname($) { #like `dirname but if ends in / then return the whole thing @@ -323,7 +323,7 @@ sub launch_job { } if ($joblist == "") { $joblist = $jobid; } else {$joblist = $joblist . "\|" . $jobid; } - my $cleanfn=check_output("qdel $jobid 2> /dev/null"); + my $cleanfn="qdel $jobid 2> /dev/null"; push(@cleanup_cmds, $cleanfn); } close QOUT; -- cgit v1.2.3 From 6b25a85dd45af5982e07577b33c64e3b577579c3 Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Fri, 11 Mar 2011 10:27:43 -0500 Subject: dont fail on possibly temporary qstat errors --- vest/parallelize.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vest/parallelize.pl') diff --git a/vest/parallelize.pl b/vest/parallelize.pl index 2798a303..c2526503 100755 --- a/vest/parallelize.pl +++ b/vest/parallelize.pl @@ -283,7 +283,8 @@ sub numof_live_jobs { if ($use_fork) { die "not implemented"; } else { - my @livejobs = grep(/$joblist/, split(/\n/, check_output("qstat"))); + # We can probably continue decoding if the qstat error is only temporary + my @livejobs = grep(/$joblist/, split(/\n/, unchecked_output("qstat"))); return ($#livejobs + 1); } } -- cgit v1.2.3 From eda8d83cd957463d32980da7c60085a820f7eae0 Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Fri, 11 Mar 2011 11:06:48 -0500 Subject: be more verbose when running each child decoder process when forking. also, avoid some non-bash errors --- vest/parallelize.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vest/parallelize.pl') diff --git a/vest/parallelize.pl b/vest/parallelize.pl index c2526503..b4783f91 100755 --- a/vest/parallelize.pl +++ b/vest/parallelize.pl @@ -347,7 +347,7 @@ sub launch_job_fork { my ($fh, $scr_name) = get_temp_script(); print $fh $script; close $fh; - my $todo = "/bin/sh $scr_name 1> $outfile 2> $errorfile"; + my $todo = "/bin/bash -xeo pipefail $scr_name 1> $outfile 2> $errorfile"; print STDERR "EXEC: $todo\n"; my $out = check_output("$todo"); print STDERR "RES: $out\n"; -- cgit v1.2.3