diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-12-15 17:47:51 +0300 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-12-15 17:47:51 +0300 |
commit | ab2185c4a5087d052861b1aa2a9464a802649db7 (patch) | |
tree | 2ec944a059d945c4dfc1cc0ee8ac8b57e859d5de /scripts/generic | |
parent | 3dec57a51822439b0a4508c62076e65c7803ead7 (diff) |
more robust behavior of qsub-wrapper.pl
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3781 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'scripts/generic')
-rwxr-xr-x | scripts/generic/qsub-wrapper.pl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/generic/qsub-wrapper.pl b/scripts/generic/qsub-wrapper.pl index 72e7f0c6e..2c90b73d7 100755 --- a/scripts/generic/qsub-wrapper.pl +++ b/scripts/generic/qsub-wrapper.pl @@ -26,8 +26,8 @@ my $dbg=""; my $version=""; my $qsubname="WR$$"; my $cmd=""; -my $cmdout=""; -my $cmderr=""; +my $cmdout=undef; +my $cmderr=undef; my $parameters=""; my $old_sge = 0; # assume grid engine < 6.0 @@ -77,8 +77,10 @@ sub usage(){ #printparameters sub print_parameters(){ print STDERR "command: $cmd\n"; - print STDERR "file for stdout: $cmdout\n"; - print STDERR "file for stderr: $cmderr\n"; + if (defined($cmdout)){ print STDERR "file for stdout: $cmdout\n"; } + else { print STDERR "file for stdout is not defined, stdout is discarded\n"; } + if (defined($cmderr)){ print STDERR "file for stdout: $cmderr\n"; } + else { print STDERR "file for stderr is not defined, stderr is discarded\n"; } print STDERR "Qsub name: $qsubname\n"; print STDERR "Queue parameters: $queueparameters\n"; print STDERR "parameters directly passed to cmd: $parameters\n"; @@ -136,7 +138,7 @@ preparing_script(); my $maysync = $old_sge ? "" : "-sync y"; -# submit the main job with the parameter "-b yes" +# create the qsubcmd to submit to the queue with the parameter "-b yes" my $qsubcmd="qsub $queueparameters $maysync -V -o $qsubout -e $qsuberr -N $qsubname -b yes $jobscript > $jobscript.log 2>&1"; #run the qsubcmd @@ -215,7 +217,7 @@ sub kill_all_and_quit(){ sub remove_temporary_files(){ #removing temporary files - unlink("${jobscript}.csh"); + unlink("${jobscript}"); unlink("${jobscript}.log"); unlink("$qsubout"); unlink("$qsuberr"); |