Skip to content

Generate system cache without taking $MODULEPATH changes into account #708

Closed

Description

@bedroge

On our cluster we offer some top-level modules that give access to certain software stacks, e.g. to our own stack and the EESSI software stack. These top-level modules basically just prepend some path to $MODULEPATH and to $LMOD_RC, where the latter is used to point to an existing cache file of that stack.

Initially we didn't provide a cache for the (handful) top-level modules, but we noticed that Lmod would seem to generate one anyway (per user?), which made it walk through the entire stack; I suspect because it was finding the $MODULEPATH change in those module files. This caused issues where logging in could take a long time.

We then tried to work around it by providing a cache for the top-level modules, but we noticed that again the update_lmod_system_cache_files would do the same thing, i.e. find the $MODULEPATH change in the modulefile and hence scan the entire stacks for modules. As EESSI (and also our own stack) have procedures in place to automatically generate those caches every time new software is added, we would like to prevent this from happening. We now worked around it by temporarily removing the prepend_path("MODULEPATH", ...) line from the modulefile when generating that top-level cache, but is there a better way to do this? Or would it be possible to add some option to the script that disables this functionality?

Activity

  1. ocaisa commented on Jun 14, 2024

    @ocaisa

    I did look into that and the issue I saw is that we would need to talk to the hosting site to have the EESSI caches included in their local setup.

    However, I also thought I saw recently that LMOD_RC can now be path-like. Does this mean that we can then dynamically build up the cache information without having to define everything in advance at the site?

    This would allow us to have a complicated set of possibilities within EESSI (since we may want to deliver multiple different naming schemes possibilities) without having to have discussions with the hosting site.

  2. rtmclay commented on Jun 14, 2024

    @rtmclay
    Member
  3. bedroge commented on Jun 14, 2024

    @bedroge
    Author

    Have you read: https://lmod.readthedocs.io/en/latest/350_community.html.

    This might be a solution for what you are looking for.

    Thanks, that looks useful for this use case, I'll give that a try.

  4. bedroge commented on Jun 17, 2024

    @bedroge
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions