+ if ($options->{interactive}) {
+ push @qo,'-I';
+ }
+ if ($options->{name}) {
+ push @qo,'-N',$options->{name};
+ } else {
+ push @qo,'-N',join('_',
+ 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;
+}
+
+sub generate_slurm_options{
+ my ($options,$args) = @_;
+ my @qo;
+ if (defined $options->{queue} and length $options->{queue}) {
+ push @qo,'-p',$options->{queue};
+ }
+ ## handle the -l options
+ if (defined $options->{account}) {
+ push @qo,'-A',$options->{account};
+ }
+ my %options_map =
+ (mem => 'mem',
+ ppn => 'cpus-per-task',
+ time => 'time',
+ cputime => 'cput',
+ host => 'host',
+ pmem => 'pmem',
+ pvmem => 'pvmem',
+ max_file => 'file',
+ );
+ for my $k (keys %options_map) {
+ if ($options->{$k}) {
+ push @qo,'--'.$options_map{$k}.'=',$options{$k};
+ }
+ }
+ if ($options{mem}) {
+ push @qo,'--mem=',$options{mem};
+ }
+ if ($options->{interactive}) {
+ push @qo,'-I';
+ }
+ if ($options->{name}) {
+ push @qo,'-J',$options->{name};
+ } else {
+ push @qo,'-J',join('_',
+ 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;