slurm interactive jobs need --pty, a shell, and srun
authorDon Armstrong <don@donarmstrong.com>
Tue, 27 Jun 2017 17:22:26 +0000 (10:22 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 27 Jun 2017 17:22:26 +0000 (10:22 -0700)
dqsub

diff --git a/dqsub b/dqsub
index 0a04f2d..1058b91 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -194,7 +194,12 @@ if ($options{batch} eq 'pbs') {
 
 if ($options{interactive}) {
     print STDERR 'running: '.$JOB_SUBMITTER.' '.join(' ',@qsub_options) if $DEBUG;
-    exec($JOB_SUBMITTER,@qsub_options);
+    if ($options{batch} eq 'pbs') {
+        exec($JOB_SUBMITTER,@qsub_options);
+    } else {
+        exec('srun',@qsub_options);
+    }
+
 } else {
     my @array = ();
     if ($options{array}) {
@@ -296,7 +301,7 @@ sub generate_slurm_options{
         push @qo,'--mem='.$options{mem};
     }
     if ($options->{interactive}) {
-        push @qo,'-I';
+        push @qo,'--pty',$ENV{SHELL}//'bash';
     }
     if ($options->{name}) {
         push @qo,'-J',$options->{name};