diff --git a/NEWS b/NEWS index aeb53fdf19589baa672c6355ac1bb07edccf01db..2cb1d354870b563d0f4ec6d2e8d9a6e9f7914bb1 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ documents those changes that are of interest to users and admins. -l select=# (node count) -l ncpus=# (task count) -v key=value (environment variable) + -W depend=opts (job dependencies) -W umask=# (set job's umask) -- Add job_submit/pbs plugin to translate PBS job dependency options to the extend possible (no support for PBS "before" options). diff --git a/contribs/torque/qsub.pl b/contribs/torque/qsub.pl index 4186ce7f7bcdb1ac943c89499c5e2478009c9632..89dd648877077d2dcf8b520ff3e61ce1b587f6f4 100755 --- a/contribs/torque/qsub.pl +++ b/contribs/torque/qsub.pl @@ -136,6 +136,7 @@ if ($ARGV[0]) { } else { pod2usage(2); } +my $depend; my %res_opts; my %node_opts; @@ -145,6 +146,12 @@ if($additional_attributes) { $ENV{SLURM_UMASK} = $value; $additional_attributes =~ s/(umask=)([0-9]+)//; } + + ($depend, $value) = $additional_attributes =~ /(depend=)(\S+)/i; + if ($depend) { + $depend = $value; + $additional_attributes =~ s/(depend=)(\S+)//; + } } if($resource_list) { @@ -212,8 +219,9 @@ if($res_opts{walltime}) { $command .= " -t$res_opts{pcput}"; } -$command .= " --tmp=$res_opts{file}" if $res_opts{file}; -$command .= " --mem=$res_opts{mem}" if $res_opts{mem}; +$command .= " --dependency=$depend" if $depend; +$command .= " --tmp=$res_opts{file}" if $res_opts{file}; +$command .= " --mem=$res_opts{mem}" if $res_opts{mem}; $command .= " --nice=$res_opts{nice}" if $res_opts{nice}; $command .= " --gres=gpu:$res_opts{naccelerators}" if $res_opts{naccelerators}; @@ -236,7 +244,6 @@ $command .= " --mail-user=$mail_user_list" if $mail_user_list; $command .= " -J $job_name" if $job_name; $command .= " --nice=$priority" if $priority; $command .= " -p $destination" if $destination; -$command .= " -C $additional_attributes" if $additional_attributes; $command .= " $script"; diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index 9d9e93cea5cd4a6991a1dcbb32419200b1f511a5..2a0cdc4bc9785f65fca2b600114b32dcacb62726 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -1718,10 +1718,9 @@ static void _set_pbs_options(int argc, char **argv) {NULL, 0, 0, 0} }; - optind = 0; - while((opt_char = getopt_long(argc, argv, pbs_opt_string, - pbs_long_options, &option_index)) + while ((opt_char = getopt_long(argc, argv, pbs_opt_string, + pbs_long_options, &option_index)) != -1) { switch (opt_char) { case 'a': @@ -1822,9 +1821,11 @@ static void _set_pbs_options(int argc, char **argv) error("Invalid umask ignored"); opt.umask = -1; } + } else if (!strncasecmp(optarg, "depend=", 7)) { + xfree(opt.dependency); + opt.dependency = xstrdup(optarg+7); } else { - xfree(opt.constraints); - opt.constraints = xstrdup(optarg); + verbose("Ignored PBS attributes: %s", optarg); } break; case 'z':