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

speed up module loading and purging #556

Open
dtenenba opened this issue Mar 29, 2024 · 1 comment
Open

speed up module loading and purging #556

dtenenba opened this issue Mar 29, 2024 · 1 comment
Assignees

Comments

@dtenenba
Copy link
Contributor

Not sure if this is the right place for this, but here goes.

I remember @fizwit telling me that there is no reason that module loading should not be instantaneous - all it's doing is setting environment variables, right?

But as we know it can be pretty slow. ml purge can be slow as well.

Aside from just being annoying, there a few use cases where this breaks things, for example, setting VS code to develop in R - if you try and load the modules, things break because it takes too long.
The hacky workaround is to point VS code's R extension to a wrapper script that sets certain environment variables to the same value that ml fhR sets them to and then runs R.

It would be nice to avoid hacks like this. I would be happy to help investigate why this is happening. Maybe we could start by asking the easybuild / lmod community?

@fizwit
Copy link
Member

fizwit commented Apr 4, 2024

Load time with --ingore-cache is the same as with CACHE enabled. It seems like something is wrong with the cache.
But the lua file for fhR has a two variables that are hundreds of lines long. By removing whatis([==[Extensions: removed 10K from the lua file and shortened load time from 9 seconds to 3 seconds. It seems like including the extension list in the Lua is consuming a lot of resources.

Kenneth has opened an issue with Robert about this in the past. It would seem like the solution is to configure EasyBuild too not create these variables in the Module files.

Before

time (export LMOD_IGNORE_CACHE=no; ml fhR/4.3.3-foss-2023b )

real    0m10.043s

After

time (ml fhR/4.3.3-foss-2023b )

real    0m2.598s

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

No branches or pull requests

2 participants