--account, -A Account name to use
--join, -J join error and output streams (default)
--name, -N Name of the job
+ --precommand Optional command to run before each command
--debug, -d debugging level (Default 0)
--help, -h display this help
--man, -m display manual
'pmem|process_mem|process-mem=s',
'pvmem|process_virtual_mem|process-virtiual-mem=s',
'max_file|max-file|file=s',
+ 'precommand|pre-command|pre_command=s',
'dir=s',
'name=s',
'debug|d+','help|h|?','man|m');
if ($options{interactive}) {
- print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG;
+ print STDERR 'running: '.$JOB_SUBMITTER.' '.join(' ',@qsub_options) if $DEBUG;
exec($JOB_SUBMITTER,@qsub_options);
} else {
my @array = ();
map {my $a = $_; $a =~ s/[^a-zA-Z0-9]*//g; $a;}
@{$args}[0..min($#{$args},2)]);
}
- # join error and output streams
- if ($options->{join}) {
- push @qo,'-j','oe';
- }
return @qo;
}
$script .= <<EOF;
# this script was written by dqsub
EOF
+ # if there is a precommand, write it out
+ if ($opt->{precommand}) {
+ $script .=<<EOF;
+# this is the precommand _BEGIN_
+$opt->{precommand}
+# precommand _END_
+EOF
+ }
my $directory = getcwd;
if (defined $opt->{dir}) {
$directory = abs_path($opt->{dir});