# Configuring Environment Modules

Environment modules allow users to switch between different versions of compilers, libraries, and other installed software on a supercomputer. On the command line, environment modules are typically configured using commands like `module load gcc/4.6.2` or `module swap PrgEnv/cray PrgEnv/pgi`.

PTP provides the ability to configure a set of modules to be loaded when a synchronized C/C++ or Fortran project is built. Module commands can be entered manually -- just as you would enter at the command line -- or they can be configured using a graphical interface.

A brief description of Environment Management with Modules is available in the Environment Management section of Building Synchronized Projects.
This section covers more additional details.

Note: The following instructions apply only to synchronized projects. Currently, it is not possible to configure modules for local or remote projects.

To configure environment modules used to build a synchronized C/C++ or Fortran project, the information can be accessed in two places:

1. From the project context menu (right-click on a C/C++ or Fortran project), select Synchronize > Manage ...

   This brings up the Manage Synchronize Configurations dialog.

2. Alternatively, this is also available from the Project Properties dialog, on the Synchronize page.

Here we illustrate it from the first alternative, the Manage Synchronize Configurations dialog.

- Check Use an environment management system to customize the remote build environment.

- If a message appears reading The remote environment (connection name) is not connected, click the Connect button. If no such message appears, proceed to the next step.

- Within 10-15 seconds, one of one of the following will appear.
  - If a message appears reading (connection name) does not have a supported environment management system installed, you will need to specify environment configuration commands manually. Click here for further instructions.

  - If a list of modules appears, you may select the modules to be loaded from the list. Click here for further instructions.

- After you have configured the environment modules for your build, click the OK button to save the configuration and close the Project Properties dialog.

## Configuring Environment Modules Using the Module List

PTP allows modules to be configured using a list of available, and selected, modules, when the remote machine runs one of the following environment management systems:

- Modules - C or Tcl versions
- Lmod - Modules based on Lua
- SoftEnv

The module configuration area contains the following elements.

- The list of Available Modules on the left displays all of the modules available on the remote machine. Select a module from the list on the left and click the Add -> button to add it to the list of selected modules. Select a module from the list of modules on the right and use the <- Remove button to remove modules from the selected modules list. If a module is listed on the right in the Selected Modules list, that module will be loaded when the project is built. If a module is not in the list of selected modules, PTP will ensure that the module is not loaded when the project is built.
- Select a module in the list on the right and use the Up and Down buttons to re-order the selected modules so they will be loaded in the order listed.
- A Set Default button restores the list so that only the default modules are checked. The "default modules" are those that are loaded automatically when a new Bash login shell is launched on the remote machine. (Some systems allow users to customize their default modules by creating a ~/.modules file on the remote machine.)
- A Reload List button reloads the list of available modules from the remote machine. This is useful if the set of available modules changes while the dialog box is open, or if communication problems prevented the list from loading correctly.
- A Filter List text field allows you to temporarily display only a subset of the available modules. This is useful for quickly finding modules with a particular name. Note that entering filter text does not change what modules are selected; rather, it temporarily removes some modules from view. For further instructions, see below.

### Using the Filter List Text Field

The Filter List text field can be used to temporarily display only modules with a particular name. (Entering text in this field does not affect what modules are selected; it simply hides some entries from view until the filter text is cleared.)

- Typing text in the field restricts the display to only those modules whose names begin with that text. For example:
  - Entering "open" would display modules such as open64/4.5.1, open64/5.0, openmpi-1.4.3-intel-12.0.4, and openmpi_gcc-1.4.2 -- i.e., modules whose names begin with "open."
- An asterisk (*) in the text matches any text (or none at all). For example:
  - Entering "*gcc" would match modules named gcc, gcc/4.6.2, openmpi_gcc-1.4.2, and even R/2.14.2-gcc -- i.e., any module whose name contains "gcc".
  - Entering "metis/*/gnu" would match metis/4.0/gnu and metis/5.0/gnu (but not metis/4.0/intel or metis/5.0/intel).
  - Entering "m*pi" would match mpi, mpip, mvapich2 -- modules whose names start with an m and have pi later in the name.
- A question mark (?) in the text matches exactly one character. For example:
  - Entering "openmpi-1.?-intel" would match a module named openmpi-1.6-intel-12.0.4 but not openmpi-1.4.3-intel-12.0.4.)

## Configuring Environment Modules Manually

To configure environment modules manually:

1. Select Manually specify environment configuration commands.
2. A text box will appear. If the check list was previously visible, the text box will contain the commands needed to configure the modules according to the list of Selected Modules. Otherwise the text area will be blank.
3. Enter Bash shell commands necessary to configure the environment, one per line.

Back to Top | Back to Table of Contents