Skip to content

Commit

Permalink
Merge pull request #445 from ExaWorks/fix_slurm_env_vars
Browse files Browse the repository at this point in the history
Fixed handling of env vars in Slurm. The existing template made some
  • Loading branch information
hategan authored Feb 7, 2024
2 parents 391eb6b + 25fa212 commit 03cc5d4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/psij/executors/batch/slurm/slurm.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
#SBATCH --chdir="{{.}}"
{{/job.spec.directory}}

{{#job.spec.inherit_environment}}
#SBATCH --export=ALL
{{/job.spec.inherit_environment}}
{{^job.spec.inherit_environment}}
#SBATCH --export=NONE
{{/job.spec.inherit_environment}}

{{#job.spec.resources}}
{{#exclusive_node_use}}
#SBATCH --exclusive
Expand Down Expand Up @@ -80,9 +73,17 @@ export PSIJ_NODEFILE


{{#env}}
#SBATCH --export={{name}}={{value}}
export {{name}}={{value}}
{{/env}}

{{#job.spec.inherit_environment}}
#SBATCH --export=ALL{{#env}},{{name}}{{/env}}
{{/job.spec.inherit_environment}}
{{^job.spec.inherit_environment}}
#SBATCH --export={{#env}}{{name}},{{/env}}
{{/job.spec.inherit_environment}}


{{!redirect output here instead of through #SBATCH directive since SLURM_JOB_ID is not available
when the directives are evaluated; the reason for using the job id in the first place being the
same as for the exit code file.}}
Expand Down

0 comments on commit 03cc5d4

Please sign in to comment.