Ticket 10021

Summary: Filter or overwrite user exported variables based on the partition
Product: Slurm Reporter: Marco Induni <marco.induni>
Component: OtherAssignee: Tim McMullan <mcmullan>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 20.02.2   
Hardware: Linux   
OS: Linux   
Site: CSCS - Swiss National Supercomputing Centre Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Marco Induni 2020-10-20 07:21:51 MDT
Dear support,
in order to let work an internal application, at user login we set  
an environment variable LD_PRELOAD to a certain path/value.

Unfortunately for a specific partition that has different set of nodes, this LD_PRELOAD is causing issues. So I used (as I saw on a recent ticket 9809) the TaskProlog config and with the echo syntax (as show below) I unset the LD_PRELOAD.

This method is working, but since we have users that run jobs with zillion tasks, I'm worried if such an if condition at scale, may cause trouble or performance issues. 
Would be possibile to "reset/overwrite" a user variable, using let's say Prolog ?In such a way that run just once (I did many test, but this seems not to be the case)

# snip from task_prolog.sh

if [[ ${SLURM_JOB_PARTITION} == xfer ]]; then
 echo 'unset LD_PRELOAD'
fi

Thank you
Marco Induni
Comment 1 Tim McMullan 2020-10-21 12:13:06 MDT
Hi Marco,

I think using TaskProlog for this is an appropriate spot for this, though I can understand the concern.  The only other consistent way that might be better currently would be to do this in a SPANK plugin.  It would still need to execute basically once per task, but it would be with a little less overhead.

That said, the management overhead of running a SPANK plugin is probably more than it is worth, unless using TaskProlog actually causes a problem.  I would suggest sticking to the TaskProlog script for now, it is in common use and we aren't aware of it causing any major issues.

Let me know if this helps!
Thanks!
--Tim
Comment 2 Marco Induni 2020-10-21 23:35:02 MDT
Hi Tim,
thank you for your answer and suggestions.
I think we will give a try with TaskProlog and in case of trouble we may try with a SPLUNK plugin.

You may close the ticket whenever you want, and thanks again for your support.
Marco
Comment 3 Tim McMullan 2020-10-22 07:12:07 MDT
Hi Marco!

Sounds good, always happy to help! I'll close this out now.

Thanks!
--Tim