How do I use Environment Modules to select the appropriate Instruction or Research license for a software application?

Many software applications available in the CAEN Lab Software Environment (CLSE) provide two separate types of licenses: "Student Instruction License" (instruction) or "Academic Research License" (research). Depending on the type of work an individual is doing with the application, the appropriate license should always be used. Refer to the CLSE Overview for a description of these usages.

In order to select the appropriate license version of an application on the Linux CLSE, one must use Environment Modules. In addition, for applications where both an instruction and research license are available, one must also specify which type of license to use in the module load command:

module load instruction/module_name
module load research/module_name

where module_name is the command to run the application.

Setting the License Type for Each Login Session

Let's use MATLAB as an example, which offers both instruction and research licenses. In the past, one could simply type module avail matlab to get the list of available versions of MATLAB, and then use the module load command to execute a specific version. Now, you must specifically indicate which license type you need to use in the module command, similar to what is shown below:

$ module avail matlab

---------------------------------- /usr/caen/misc/modules ----------------------------------
   matlab/2021a    matlab/2022a (D)

If you intend to work using only the instruction or research license of all software applications in the CLSE, you may also set that as the default for each session by typing module load license/instruction or module load license/research, respectively. This is especially helpful when using scripts that expect applications to launch using their default commands. With MATLAB, for example, using these module load commands will ensure that the expected version of MATLAB will launch during your session:

linux terminal

Note that even when the default license type is set, you can still run the other version. So, if you set your environment to only run instruction licenses (i.e. module load license/instruction), you could still run the specific research license for MATLAB (i.e. module load research/matlab).

For some applications, including MATLAB, CAEN has provided scripts in place of the default command which will prompt from a license version in case no module has been loaded. In these cases, you will be prompted for which license type you intend to use:

linux terminal

These scripts will only work when interacting with the terminal, and are not intended for scripting. When launching an application via scripts, you must load the appropriate module as described earlier.

Setting the Default License Type for Every Login Session

If you would like to set a particular type of license as the global default for each time you log into a CLSE computer, you can do this by adding the appropriate module command to a .modules file in your home directory. Typing the following command will set your default to the instruction license type:

echo module load license/instruction >> ~/.modules

and this command will set your default to the research license type:

echo module load license/research >> ~/.modules

So, each time you logged in, your environment would automatically be configured (or loaded) with applications using the desired license type. If you would like to switch this license type during a session, but not make it your default for the next time you log in, you can use the module initswitch old new command. For example, to switch your session from using instruction licenses to using research licenses, type:

module initswitch license/instruction license/research

Finally, the module initadd command can be very useful when you want to switch the default license type for your session, but don't want to override any licenses you previously set in your .modules file. For example, if you were running the research version of MATLAB and wanted to start running the instruction version of other applications without overriding MATLAB, you would type:

module initadd license/instruction

Details

Article ID: 5511
Created
Thu 5/6/21 6:48 AM
Modified
Wed 7/19/23 8:22 AM