Skip to content
Snippets Groups Projects
Commit 16e6fcd6 authored by Philip D. Eckert's avatar Philip D. Eckert Committed by jette
Browse files

last one

Moe,

After doing more extensive testing, I came to realize
that we had made a bad basic assumption. We believed
that the user's environment should only be what was
sent in the file via the --export-file option.

However, that broke the previous behavior, especially
in regard to Moab jobs. It also caused the SLURM
defined environment variables to be lost as well.

This patch will enable the correct behavior for Moab
on top of SLURM whne using the --export-file option,
but the behavior is less that pefect for using it
stand alone with sbatch. When using the option with
sbatch as a user, the file environment is read in,
and then when the env_array_merge is made, some
variables may get overwritten. This is good for
the SLURM and MPI vairables, but not so good for
others., The problem is trying to reconcile two
sources of environment is very problematic.

I also added a caveat in the man page.

I made changes in my branch of SchedMD SLURM
for 2.3, here is the patch.

Phil
parent a7bb7392
No related branches found
No related tags found
No related merge requests found
......@@ -384,9 +384,9 @@ assumed. Export environment variables defined in <\fIfilename\fR> or
read from <\fIfd\fR> to the job's execution environment. The
content is one or more environment variable definitions of the form
NAME=value, each separated by a null character. This allows the use
of special characters in environment definitions. The
\fB\-\-get\-user\-env\fR option will be ignored if \-\-export\-file is
defined.
of special characters in environment definitions.(Note: primarily for use
with Moab. outside of Moab, variables in the user's working environment
may supercede the variables specified in the file.)
.TP
\fB\-F\fR, \fB\-\-nodefile\fR=<\fInode file\fR>
......
......@@ -393,8 +393,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
desc->environment = env_array_from_file(opt.export_file);
if (desc->environment == NULL)
exit(1);
opt.get_user_env_time = -1;
} else if (opt.export_env == NULL) {
}
if (opt.export_env == NULL) {
env_array_merge(&desc->environment, (const char **)environ);
} else if (!strcasecmp(opt.export_env, "ALL")) {
env_array_merge(&desc->environment, (const char **)environ);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment