Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Slurm handling of comma-separated env vars #104

Merged
merged 4 commits into from
Nov 4, 2021

Conversation

al-rigazzi
Copy link
Collaborator

@al-rigazzi al-rigazzi commented Oct 26, 2021

This is a minimal-modification PR. Whenever an env var is found to contain a comma, we set it locally to the srun process and add the name of then env var (not the value!) to the list of exported env vars. Its value is then correctly passed by srun to the launched application. This does not change anything in how other env variables are exported/formed/formatted and the result is still human-readable.

Basically, instead of trying to run the unsuccessful command:

srun --export SSKEYIN=name_0,name_1,OTHER_VAR=value python script.py

we run

SSKEYIN=name_0,name_1 srun --export SSKEYIN,OTHER_VAR=value python script.py

@al-rigazzi al-rigazzi marked this pull request as ready for review October 27, 2021 18:25
Copy link
Contributor

@Spartee Spartee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, glad to have this fix in.

@al-rigazzi al-rigazzi merged commit 14f6d50 into CrayLabs:develop Nov 4, 2021
@al-rigazzi al-rigazzi deleted the slurm_envvar branch November 4, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants