sbatch reads from STDIN by default
authorDon Armstrong <don@donarmstrong.com>
Wed, 8 Feb 2017 18:55:47 +0000 (10:55 -0800)
committerDon Armstrong <don@donarmstrong.com>
Wed, 8 Feb 2017 18:55:47 +0000 (10:55 -0800)
dqsub

diff --git a/dqsub b/dqsub
index 5b4b845..fe95bba 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -192,7 +192,7 @@ if ($options{batch} eq 'pbs') {
 
 if ($options{interactive}) {
     print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG;
-    exec('qsub',@qsub_options);
+    exec($JOB_SUBMITTER,@qsub_options);
 } else {
     my @array = ();
     if ($options{array}) {
@@ -207,6 +207,9 @@ if ($options{interactive}) {
             }
         }
     }
+    if ($options{batch} eq 'pbs') {
+        push @qsub_options,'-';
+    }
     call_qsub(\@qsub_options,write_qsub_script(\%options,\@ARGV,\@array));
 }
 
@@ -320,7 +323,7 @@ sub read_array_options{
 sub call_qsub {
     my ($qsub_options,$script) = @_;
     my $qsub_fh;
-    open $qsub_fh,'|-',$JOB_SUBMITTER,@{$qsub_options},'-' or
+    open $qsub_fh,'|-',$JOB_SUBMITTER,@{$qsub_options} or
         die "Unable to start $JOB_SUBMITTER: $!";
     print {$qsub_fh} $script or
         die "Unable to print to $JOB_SUBMITTER: $!";