]> git.donarmstrong.com Git - uiuc_igb_scripts.git/blobdiff - dqsub
remove die because we now support array options
[uiuc_igb_scripts.git] / dqsub
diff --git a/dqsub b/dqsub
index af930905c2ba33bf1636b5ae04cec47c38b0e522..32a1a3a55ca998669527458c177cad14a7c8ab5a 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -158,9 +158,12 @@ sub generate_qsub_options{
         $l[$#l] .= ':ppn='.$options->{ppn};
     }
     if ($options->{mem}) {
-        push @l,'mem=',$options->{mem};
+        push @l,'mem='.$options->{mem};
     }
     push @qo,'-l',join(',',@l) if @l;
+    if ($options->{interactive}) {
+        push @qo,'-I';
+    }
     return @qo;
 }
 
@@ -199,7 +202,23 @@ sub write_qsub_script {
 # this script was written by dqsub
 EOF
     if (defined $opt->{array}) {
-        die "--array is currently not implemented";
+        my $array_opt = join("\n",@{$array});
+        $script .= <<EOF;
+OPT=\$(sed -n -e "\$PBS_ARRAYID p"<<'_HERE_DOC_END'
+$array_opt
+_HERE_DOC_END_
+)
+EOF
+        if ($opt->{array} eq 'chdir') {
+            $script .= <<EOF;
+cd "\$OPT";
+exec $command;
+EOF
+        } else {
+            $script .= <<EOF;
+exec $command "\$OPT";
+EOF
+        }
     } else {
         $script .= <<EOF;
 # there's no array, so just executing the command with arguments