--nodes nodes to use
--array array mode (one of 'chdir' or 'xargs' or '')
--array-from file to read arrays from (default STDIN)
--nodes nodes to use
--array array mode (one of 'chdir' or 'xargs' or '')
--array-from file to read arrays from (default STDIN)
@array = read_array_options(\%options) if $options{array};
# the -t option gives the range of elements for an array job
push @qsub_options,'-t','1-'. scalar @array;
@array = read_array_options(\%options) if $options{array};
# the -t option gives the range of elements for an array job
push @qsub_options,'-t','1-'. scalar @array;
}
call_qsub(\@qsub_options,write_qsub_script(\%options,\@ARGV,\@array));
}
}
call_qsub(\@qsub_options,write_qsub_script(\%options,\@ARGV,\@array));
}
}
push @qo,'-l',join(',',@l) if @l;
}
push @qo,'-l',join(',',@l) if @l;
- 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
+ }