Difference between revisions of "Setting permanent default for software stack upon login"

From ScientificComputing
Jump to: navigation, search
(Troubleshooting)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
Some time ago we introduced a [[New_SPACK_software_stack_on_Euler|new software stack]] on Euler that uses a similar but slightly different module system (LMOD modules instead of environment modules). LMOD has useful additional features on top of what environment modules provide.
+
Some time ago we introduced a [[New_SPACK_software_stack_on_Euler|new software stack]] on Euler that uses LMOD modules instead of environment modules. LMOD has useful additional features compared environment modules. So far upon login to the Euler cluster, the old software stack is initialized as the default and we provide the scripts '''env2lmod''' and '''lmod2env''' to switch between the old and the new software stack. Having the old software stack initialized by default upon login causes some issues for users of the new software stack. Therefore we now provide the possibility for users to set a permanent default for the software stack that is initialized upon login.
 
 
So far upon login to the Euler cluster, the old software stack is initialized as the default and we provided the scripts '''env2lmod''' and '''lmod2env''' to switch between the old and the new software stack.
 
 
 
Having the old software stack initialized upon login causes some issues for users of the new software stack
 
  
 
==Issues with the old setup==
 
==Issues with the old setup==
Line 13: Line 9:
  
 
===Jupyter notebooks===
 
===Jupyter notebooks===
The [https://gitlab.ethz.ch/sfux/Jupyter-on-Euler-or-Leonhard-Open script to run jupyter notebooks on Euler or Leonahrd Open] is using the old software stack. It could only be adapted to use the new LMOD modules, when users change the modules that are loaded by the script and
+
The [https://gitlab.ethz.ch/sfux/Jupyter-on-Euler-or-Leonhard-Open script to run jupyter notebooks on Euler or Leonahrd Open] is using the old software stack. It could only be adapted to use the new LMOD modules, when users change the modules that are loaded by the script and in addition added the command <tt>source /cluster/apps/local/env2lmod.sh</tt> to their <tt>.bashrc</tt> or <tt>.bash_profile</tt>.
  
 
==Setting a permanent default for the software stack to be initialized upon login to Euler==
 
==Setting a permanent default for the software stack to be initialized upon login to Euler==
We introduce now a new script <tt>set_software_stack.sh</tt> that allows the users to permanently set the default for the software stack to be initialized upon login to Euler.
+
We introduce now a new script <tt>set_software_stack.sh</tt> that allows the users to permanently set the default for the software stack to be initialized upon login to Euler. Please note that after setting a default with the new script, you would need to logout and login again to make the change becoming active.
  
  [sfux@eu-login-09 ~]$ ./set_software_stack.sh --help
+
  /cluster/apps/local/set_software_stack.sh: Command to set the old (environment modules) or new (LMOD modules) software stack as default upon login on the Euler cluster
./set_software_stack.sh: Command to set the old (environment modules) or new (LMOD modules) software stack as default upon login on the Euler cluster
 
 
   
 
   
 
  Usage: set_software_stack.sh [-h] [-s] [-i] [old | new]
 
  Usage: set_software_stack.sh [-h] [-s] [-i] [old | new]
Line 28: Line 23:
 
         -s | --silent                    Do not print anything to stdout except errors when changing the default for the software stack
 
         -s | --silent                    Do not print anything to stdout except errors when changing the default for the software stack
 
         -i | --info                      Show which software stack is set as default and exit
 
         -i | --info                      Show which software stack is set as default and exit
 +
        old | new                        Choices for the default software stack
 
   
 
   
 
  Examples:
 
  Examples:
 
   
 
   
         Set the the new software stack as default:
+
         Set the new software stack as default:
 
   
 
   
 
                 set_software_stack.sh new
 
                 set_software_stack.sh new
 +
 +
        Set the old software stack as default:
 +
 +
                set_software_stack.sh old
 
   
 
   
 
         Show which software stack is set as default
 
         Show which software stack is set as default
Line 72: Line 72:
 
         env2lmod; switch from old to new software stack in the shell (change not permanent)
 
         env2lmod; switch from old to new software stack in the shell (change not permanent)
 
         lmod2env; switch from the new to the old software stack in the shell (change not permanent)
 
         lmod2env; switch from the new to the old software stack in the shell (change not permanent)
 +
 +
==Troubleshooting==
 +
===I am sourcing the env2lmod.sh script in my .bashrc/.bash_profile, will this break once the new scripts are in place?===
 +
The env2lmod.sh and lmod2env.sh script are idempotent. If you run the env2lmod.sh script or use the alias env2lmod while the new software stack is already set as default, then nothing will break and the script will just print a line telling you that no action is taken:
 +
 +
[sfux@eu-login-36 ~]$ module list
 +
 +
Currently Loaded Modules:
 +
  1) StdEnv  2) gcc/4.8.5
 +
 
   
 
   
  [sfux@eu-login-09 ~]$
+
 +
  [sfux@eu-login-36 ~]$ env2lmod
 +
Current modulesystem is already LMOD modules, nothing to change for env2lmod
 +
[sfux@eu-login-36 ~]$
 +
 
 +
[sfux@eu-login-07 ~]$ module list
 +
Currently Loaded Modulefiles:
 +
  1) modules
 +
[sfux@eu-login-07 ~]$ lmod2env
 +
Current modulesystem is already environment modules, nothing to change for lmod2env
 +
[sfux@eu-login-07 ~]$
 +
 
 +
===Using the .csh scripts to initialize the module system===
 +
The module profile scripts to initialize the module system come in two flavors. Next to the .sh scripts that are used by default, there are also .csh versions of those scripts. If you were using those scripts to manually initialize the old software stack with the command
 +
 
 +
source /etc/profile.d/modules.csh
 +
 
 +
Then you would need to change this command to
 +
 
 +
source /cluster/apps/.moduleprofiles/modules.csh
 +
 
 +
Or if you would like to initialize the new software stack using the .csh scripts:
 +
 
 +
source /cluster/apps/.moduleprofiles/z00_lmod.csh
 +
source /cluster/apps/.moduleprofiles/z01_StdEnv.csh
 +
 
 +
===Why is set_softare_stack.sh -i always showing "old" as global default===
 +
The global default shows what software stack is initialized by default if you don't set a personal default. The personal default always takes precedence over the global default.

Latest revision as of 13:35, 20 September 2021

Introduction

Some time ago we introduced a new software stack on Euler that uses LMOD modules instead of environment modules. LMOD has useful additional features compared environment modules. So far upon login to the Euler cluster, the old software stack is initialized as the default and we provide the scripts env2lmod and lmod2env to switch between the old and the new software stack. Having the old software stack initialized by default upon login causes some issues for users of the new software stack. Therefore we now provide the possibility for users to set a permanent default for the software stack that is initialized upon login.

Issues with the old setup

Users of the new software stack could add the command source /cluster/apps/local/env2lmod.sh to their .bashrc to automatically switch to the new software stack directly after login, but this setup would still first initialize environment modules and then switch to LMOD modules.

Interactive jobs

Interactive jobs are not correctly picking up the environment for the new software stack. Therefore users could only use the new software stack on Euler, when starting the interactive job with the old modules system being initialized and then users could switch inside the interactive job to the new software stack.

Jupyter notebooks

The script to run jupyter notebooks on Euler or Leonahrd Open is using the old software stack. It could only be adapted to use the new LMOD modules, when users change the modules that are loaded by the script and in addition added the command source /cluster/apps/local/env2lmod.sh to their .bashrc or .bash_profile.

Setting a permanent default for the software stack to be initialized upon login to Euler

We introduce now a new script set_software_stack.sh that allows the users to permanently set the default for the software stack to be initialized upon login to Euler. Please note that after setting a default with the new script, you would need to logout and login again to make the change becoming active.

/cluster/apps/local/set_software_stack.sh: Command to set the old (environment modules) or new (LMOD modules) software stack as default upon login on the Euler cluster

Usage: set_software_stack.sh [-h] [-s] [-i] [old | new]

Options:

        -h | --help                      Display this help message and exit
        -s | --silent                    Do not print anything to stdout except errors when changing the default for the software stack
        -i | --info                      Show which software stack is set as default and exit
        old | new                        Choices for the default software stack

Examples:

        Set the new software stack as default:

                set_software_stack.sh new

        Set the old software stack as default:

                set_software_stack.sh old

        Show which software stack is set as default

                set_software_stack.sh -i

Documentation of module commands:

        We provide a general overview on module commands on our wiki.

                https://scicomp.ethz.ch/wiki/Setting_up_your_environment

Old software stack (environment modules):

        The old software stack (2014-2021+) on Euler uses environment modules. An overview on available
        modules can be found on our wiki:

                https://scicomp.ethz.ch/wiki/Category:Application
                https://scicomp.ethz.ch/wiki/Euler_applications

New software stack (LMOD modules):

        The new software stack (2018-2021+) on Euler uses LMOD modules. LMOD modules provide additional
        features like a hierarchy of modules that prevents users from mixing different toolchains:

                https://scicomp.ethz.ch/wiki/New_SPACK_software_stack_on_Euler

        An overview on the available modules can be found on our wiki:

                https://scicomp.ethz.ch/wiki/Euler_applications_and_libraries

        List of all software not currently available in the new software stack

                https://scicomp.ethz.ch/wiki/Difference_between_old_and_new_software_stacks_on_Euler

See also:

        env2lmod; switch from old to new software stack in the shell (change not permanent)
        lmod2env; switch from the new to the old software stack in the shell (change not permanent)

Troubleshooting

I am sourcing the env2lmod.sh script in my .bashrc/.bash_profile, will this break once the new scripts are in place?

The env2lmod.sh and lmod2env.sh script are idempotent. If you run the env2lmod.sh script or use the alias env2lmod while the new software stack is already set as default, then nothing will break and the script will just print a line telling you that no action is taken:

[sfux@eu-login-36 ~]$ module list

Currently Loaded Modules:
  1) StdEnv   2) gcc/4.8.5



[sfux@eu-login-36 ~]$ env2lmod
Current modulesystem is already LMOD modules, nothing to change for env2lmod
[sfux@eu-login-36 ~]$
[sfux@eu-login-07 ~]$ module list
Currently Loaded Modulefiles:
  1) modules
[sfux@eu-login-07 ~]$ lmod2env
Current modulesystem is already environment modules, nothing to change for lmod2env
[sfux@eu-login-07 ~]$

Using the .csh scripts to initialize the module system

The module profile scripts to initialize the module system come in two flavors. Next to the .sh scripts that are used by default, there are also .csh versions of those scripts. If you were using those scripts to manually initialize the old software stack with the command

source /etc/profile.d/modules.csh

Then you would need to change this command to

source /cluster/apps/.moduleprofiles/modules.csh

Or if you would like to initialize the new software stack using the .csh scripts:

source /cluster/apps/.moduleprofiles/z00_lmod.csh
source /cluster/apps/.moduleprofiles/z01_StdEnv.csh

Why is set_softare_stack.sh -i always showing "old" as global default

The global default shows what software stack is initialized by default if you don't set a personal default. The personal default always takes precedence over the global default.