You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a job is passed to SLURM via sbatch, the job is not executed in the same environment. Any environment variables needed by the job need to be explicitly included in the --export option to sbatch.
Additional details
In my case, the issue is the use of an environment variable for the location of miniconda.
I was able to hardcode the location of miniconda into the script preamble, but the MINICONDA_PATH variable is not available unless included in the sbatch command.
I think it would be straightforward to add to the config.yaml environment variables to pass through to the job. I'm not sure if this issue is present on SGE, so they could be slurm_passthrough_variables or similar.
config_toybidsapp.yaml
slurm_passthrough_variables:
- MINICONDA_PATH # read the value from the current env and pass into the sbatch command
Which would be consumed by generate_job_submit_template function in babs/babs.py
# Pseudocode
for env_var in system.env_vars: # env vars could live in the `System` class?
env_flags += f",{env_var}={os.getenv('{env_var}')
The text was updated successfully, but these errors were encountered:
Summary
When a job is passed to SLURM via
sbatch
, the job is not executed in the same environment. Any environment variables needed by the job need to be explicitly included in the--export
option to sbatch.Additional details
In my case, the issue is the use of an environment variable for the location of miniconda.
I was able to hardcode the location of miniconda into the script preamble, but the MINICONDA_PATH variable is not available unless included in the sbatch command.
call_test_job.py
Currently this is what is scaffolded by babs:
This is what I'd like it to be:
Next steps
I think it would be straightforward to add to the config.yaml environment variables to pass through to the job. I'm not sure if this issue is present on SGE, so they could be
slurm_passthrough_variables
or similar.config_toybidsapp.yaml
Which would be consumed by
generate_job_submit_template
function in babs/babs.pyThe text was updated successfully, but these errors were encountered: