use strict;
use Getopt::Long;
-use Pod::Usage;
+# use Pod::Usage;
=head1 NAME
'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};
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);
$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;
}
sub read_array_options{
# this script was written by dqsub
EOF
if (defined $opt->{array}) {
+ 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
+ }
die "--array is currently not implemented";
} else {
$script .= <<EOF;