What are module-info mode switch statements?

1.3k Views Asked by At

The package Environment Modules defines the module-info mode command. The man page for modulefile lists the possible modes as:

load, remove, display, help, whatis, switch, switch1, switch2, or switch3.

What are the multiple switch statements?

1

There are 1 best solutions below

1
On

Couldn't find this documented anywhere, so I figured it out and want to share with you. Here's my explanation. Consider the following:

module load a
module swap a b

Here's what's executed under the hood by environment modules for each statement:

  1. module load a

    1. [ module-info mode ] == "load" for modulefile a
  2. module swap a b

    1. [module-info mode] == "switch1" for modulefile a. This should unset prereqs and is similar to remove
    2. [module-info mode] == "switch2" for modulefile b. This should add any dependencies. Simliar to "load"
    3. [module-info mode] == "switch3" for modulefile a. Not sure why you'd need this.