Hello!
Sergio Iserte Agut has written on Tuesday, 3 July, at 6:49:
>I've followed your advise and I've achived to find a function, called
>"setup_particulars(), in "env.c" which allows me to create and to set an
>environmental variable using the function "setenvf().
>I'm not really sure about how to do it, but I've seen that it call the
>function "select_g_select_jobinfo_get()" in order to get the value for the
>environmental variable. And that I've done.
>I've implemented the "select_p_select_jobinfo_get()" in my select plugin
>and the variables which it needs. But, I don't get the correct value in my
>env. var.
>Moreover I've put debug lines to see the behaviour and the call flow. But
>this debug lines aren't shown in my log files! That's why I'm getting lost.
>If you need more information, let me know!
>Thank you for your time.
You cannot set environment in the controller and think it can be ever
available for job since enviromnent for job is set by srun/sbatch only.
You can do it the way we do it - we're setting the SPANK variable in
job data by some controller plugin and then retrieve it in slurmd plugin
using RPC REQUEST_SPANK_ENVIRONMENT. I think you can easily find details
for both operations in header files - it's some env_array_* function and
slurm_send_recv_controller_msg().
With the best wishes.
Andriy.