X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dqsub;h=910cafd20b9eb08b9329e5ab48983b31230fef66;hb=66dff3e460c53c14f87ead2149fc81aeb02d2ed6;hp=7fe5f9afd7949fd0d991321c97aec7b36b4b826c;hpb=2051f76c3a53881a1d524e7923bb2592798534d4;p=uiuc_igb_scripts.git diff --git a/dqsub b/dqsub index 7fe5f9a..910cafd 100755 --- a/dqsub +++ b/dqsub @@ -31,6 +31,8 @@ dqsub [options] --ppn processors per node to use --mem memory to request --dir Directory to run the script in (default current directory) + --account, -A Account name to use + --name, -N Name of the job --debug, -d debugging level (Default 0) --help, -h display this help --man, -m display manual @@ -59,6 +61,10 @@ command run in the current directory. File to read array arguments from. If not provided, and B<--array> is given, arguments will be read from STDIN. +=item B<--account, -A> + +Account name to use + =item B<--debug, -d> Debug verbosity. (Default 0) @@ -82,6 +88,7 @@ dqsub use IO::File; use Cwd qw(getcwd abs_path); use POSIX qw(ceil); +use List::Util qw(min); use vars qw($DEBUG); my %options = (nodes => 1, @@ -104,8 +111,14 @@ GetOptions(\%options, 'array_slot_limit|array-slot-limit=i', 'array_all_in_one_job|array-all-in-one-job!', 'ppn|processors-per-node=i', + 'account|A=s', 'mem|memory=s', + 'time|walltime=s','cputime|cput=s','host=s', + 'pmem|process_mem|process-mem=s', + 'pvmem|process_virtual_mem|process-virtiual-mem=s', + 'max_file|max-file|file=s', 'dir=s', + 'name=s', 'debug|d+','help|h|?','man|m'); # pod2usage() if $options{help}; @@ -132,7 +145,7 @@ if ($options{interactive} and @ARGV) { 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); +my @qsub_options = generate_qsub_options(\%options,\@ARGV); if ($options{interactive}) { print STDERR 'running: qsub '.join(' ',@qsub_options) if $DEBUG; @@ -155,7 +168,7 @@ if ($options{interactive}) { } sub generate_qsub_options{ - my ($options) = @_; + my ($options,$args) = @_; my @qo; if (defined $options->{queue} and length $options->{queue}) { push @qo,'-q',$options->{queue}; @@ -171,13 +184,32 @@ sub generate_qsub_options{ if (defined $options->{ppn}) { $l[$#l] .= ':ppn='.$options->{ppn}; } - if ($options->{mem}) { - push @l,'mem='.$options->{mem}; + if (defined $options->{account}) { + push @qo,'-A',$options->{account}; + } + my %l_options = + (mem => 'vmem', + time => 'walltime', + cputime => 'cput', + host => 'host', + pmem => 'pmem', + pvmem => 'pvmem', + max_file => 'file', + ); + for my $k (keys %l_options) { + if ($options->{$k}) { + push @l,$l_options{$k}.'='.$options{$k}; + } } push @qo,'-l',join(',',@l) if @l; if ($options->{interactive}) { push @qo,'-I'; } + if ($options->{name}) { + push @qo,'-N',$options->{name}; + } else { + push @qo,'-N',join('_',@{$args}[0..min($#{$args},2)]); + } return @qo; }