[slurm-users] Prologslurmctld env variable issue

Joe Teumer joe.teumer at gmail.com
Tue Sep 21 21:16:29 UTC 2021


Apologies, I was not able to reply to the previous thread.[slurm-users]
Prologslurmctld environment variables (google.com)
<https://groups.google.com/g/slurm-users/c/9BO1P_z7vXI>

I was not able to use "spank_job_control_setenv" successfully with sbatch.
https://slurm.schedmd.com/spank.html

I'm using a spank option named 'env':
sbatch --env=test

My example environment.c script called the following functions as a test:

slurm_spank_init -> called with sbatch -> however, "test" value is Null
slurm_spank_job_prolog -> not called with sbatch
slurm_spank_init_post_opt -> called with sbatch -> however, "test" value is
Null
slurm_spank_local_user_init -> not called with sbatch
slurm_spank_user_init -> not called with sbatch
slurm_spank_task_init_privileged -> not called with sbatch
slurm_spank_task_post_fork -> not called with sbatch

if (spank_job_control_setenv(sp, "env", global_variable, 1) !=
ESPANK_SUCCESS)
    {
        slurm_info("init | Unable to set env");
        slurm_info("Value: %s",global_variable);
    }
    else {
        slurm_info("init | Able to set env");
        slurm_info("Value: %s",global_variable);
    }

Output:
sbatch: init | Able to set BIOS
sbatch: Value:

How can I reference the "--env=test" value in my c script?
Is it possible to run 'spank_job_control_setenv' with sbatch?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20210921/0898076a/attachment.htm>


More information about the slurm-users mailing list