X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dqsub;h=183d351f7b4eab41731601791eb1ca3236036fe2;hb=fde4c448f3f1d068d30a0b7a1a4bad7703b8401f;hp=1d3dd1b801bc8d39efa013dea43ebdceea544278;hpb=056bec558a499c31f31f7f3e346d2bdac2f77f90;p=uiuc_igb_scripts.git diff --git a/dqsub b/dqsub old mode 100644 new mode 100755 index 1d3dd1b..183d351 --- a/dqsub +++ b/dqsub @@ -10,7 +10,7 @@ use warnings; use strict; use Getopt::Long; -use Pod::Usage; +# use Pod::Usage; =head1 NAME @@ -101,8 +101,8 @@ GetOptions(\%options, 'dir=s', 'debug|d+','help|h|?','man|m'); -pod2usage() if $options{help}; -pod2usage({verbose=>2}) if $options{man}; +# pod2usage() if $options{help}; +# pod2usage({verbose=>2}) if $options{man}; $DEBUG = $options{debug}; @@ -121,13 +121,14 @@ if ($options{interactive} and @ARGV) { push @USAGE_ERRORS,"Don't provide commands when you're asking for an interactive shell"; } -pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS; +# pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS; +print STDERR join("\n",@USAGE_ERRORS) and exit 1 if @USAGE_ERRORS; # OK. Generate the options to qsub which we'll be using my @qsub_options = generate_qsub_options(\%options); if ($options{interactive}) { - print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG: + print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG; exec('qsub',@qsub_options); } else { my @array = (); @@ -160,6 +161,10 @@ sub generate_qsub_options{ push @l,'mem=',$options->{mem}; } push @qo,'-l',join(',',@l) if @l; + if ($options->{interactive}) { + push @qo,'-I'; + } + return @qo; } sub read_array_options{ @@ -169,7 +174,7 @@ sub read_array_options{ $fh = IO::File->new(defined $options->{array_from}) or die "Unable to open $options->{array_from} for reading: $!"; } - my @arrah; + my @array; for (<$fh>) { chomp; push @array,$_;