]> git.donarmstrong.com Git - uiuc_igb_scripts.git/blobdiff - dqsub
the shell must be specified last
[uiuc_igb_scripts.git] / dqsub
diff --git a/dqsub b/dqsub
index e2b6e760fa626b31e99cd6a51fc003e5afa70ed9..c0696c17a4ea4164cd34243b676240343e0b767e 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -158,7 +158,7 @@ if ($options{interactive} and @ARGV) {
 }
 
 if (not defined $options{batch}) {
-    qx/which sbatch/;
+    qx{which sbatch >/dev/null 2>&1};
     if ($? == 0) {
         $options{batch} = 'slurm'
     } else {
@@ -193,8 +193,13 @@ if ($options{batch} eq 'pbs') {
 
 
 if ($options{interactive}) {
-    print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG;
-    exec($JOB_SUBMITTER,@qsub_options);
+    print STDERR 'running: '.$JOB_SUBMITTER.' '.join(' ',@qsub_options) if $DEBUG;
+    if ($options{batch} eq 'pbs') {
+        exec($JOB_SUBMITTER,@qsub_options);
+    } else {
+        exec('srun',@qsub_options,$ENV{SHELL}//'bash');
+    }
+
 } else {
     my @array = ();
     if ($options{array}) {
@@ -203,7 +208,12 @@ if ($options{interactive}) {
         if ($options{array_all_in_one_job}) {
             $options{array_per_job} = scalar @array;
         } else {
-            push @qsub_options,'-t','1-'. ceil(scalar @array / $options{array_per_job});
+            if ($options{batch} eq 'pbs') {
+                push @qsub_options,'-t';
+            } else {
+                push @qsub_options,'-a';
+            }
+            push @qsub_options,'1-'. ceil(scalar @array / $options{array_per_job});
             if ($options{array_slot_limit}) {
                 $qsub_options[$#qsub_options] .= '%'.$options{array_slot_limit};
             }
@@ -291,7 +301,7 @@ sub generate_slurm_options{
         push @qo,'--mem='.$options{mem};
     }
     if ($options->{interactive}) {
-        push @qo,'-I';
+        push @qo,'--pty';
     }
     if ($options->{name}) {
         push @qo,'-J',$options->{name};