Skip to content

Commit

Permalink
Export environment variables through sbatch
Browse files Browse the repository at this point in the history
In some environments (e.g., Magnus now, but wasn't the case before)
environment variables are not always exported from the user's
environment into the job execution. This breaks one of the key
assumptions of the interaction between shark-submit and shark-run, in
that the latter works only because the former exports certain
environment variables. It also caused problems with the module system,
as (again in Magnus, but maybe in other systems as well) users need to
perform a `module switch` command before submitting in order to
correctly load the appropriate runtime modules.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Apr 23, 2020
1 parent 26f2d78 commit 9036792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hpc/shark-submit
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ print_usage() {
submit_slurm() {

# Each SHArk instance will be ran as a task
cmd="sbatch --ntasks $n_tasks"
cmd="sbatch --export ALL --ntasks $n_tasks"
cmd="$cmd -o shark-run.log"

# Get the ID of the new job
Expand Down

0 comments on commit 9036792

Please sign in to comment.