Computing environment

The component with which the user interacts is a command interpreter, more commonly called a shell. It interprets interactive commands and shell scripts. There are multiple shells (C Shell, Bash, K-Shell, ... ). By default the shell of the users is BASH. To check which shell you have you can use the following command:

echo $SHELL
/bin/bash

If you need to change the shell type, please contact our Technical Department at to make the change.

Environment variables are a set of values that define how the system and user processes behave when running. Most operating system commands and tools, as well as the programs that the user uses in their work consult the value of certain environment variables to access information they need to know to run correctly. To consult the variables that a user has defined in his environment, he can use the env command .

The command shows the list of defined variables and their value in the form VARIABLE=value. For example, the value of the variables $MANPATH, $PATH and $HOME:

 MANPATH=usr/share/man/es:/usr/share/man:/usr/local/share/man
 PATH=/opt/jre1.7.0_21/bin:/usr/local/bin:/bin:/usr/bin
 HOME=/home/usuario

The environment variables that support a list of different values, in the previous example MANPATH and PATH, these values must be separated by the character ':'. Users can define their own environment variables using the export command:

export TMPDIR=/home/usuario/tmp

To modify the value of an already defined environment variable, it is possible to use the current value of the variable to define the new value. For example, to add a new path to the PATH variable the command would be:

export PATH=/home/usuario/tmp:$PATH

where the new path '/home/usuario/tmp' is added to the paths already stored in the $PATH variable.

Closely related to the environment variables are the startup scripts. These scripts allow the user to customize their working environment to automatically adapt it to the use of the most commonly used programs or utilities. It is not the object of this introduction to go into detail on the different types of starting a shell or interpreter of commands in a Linux system, so below are some simple instructions on the matter.

A Linux shell can be invoked in three different ways: login shell, interactive shell and non-interactive shell. In login shells and interactive shells, the user interacts with the operating system through terminals. Non-interactive shells are those that execute the scripts and do not interact with the user. For the purposes of this manual, the only important thing is that each of these shell execution types uses different startup scripts.

As detailed above, by default all users are assigned a shell, Bash. In Bash login shells, for example shells launched via the ssh command, execute one of the following files located in the user's $HOME directory: .bash_profile, .bash_login, or .profile (the first one that exists). For shells that do not login, for example shells launched with the bash command, the .bashrc file also located in the $HOME directory is executed.

To facilitate the use of the various programs, tools and libraries that are installed in the system, SCAYLE uses the Environment Modules utility. This tool allows to define in a simple way all the necessary parameters for a program to work correctly. By means of the execution of a single command all the environment variables, aliases and routes necessary for the execution of the desired program can be defined.

To check the list of software available in the modules utility:

# module avail
------------------------------------------- /soft/calendula2/modulefiles -------------------------------------------
broadwell/singularity_2.5.2   haswell/mdynamix_5.2.8_intel18       haswell/singularity_3.1.1
broadwell/singularity_3.0.0   haswell/netcdf_4.6.1_intel18         haswell/smilei_4.1
broadwell/singularity_3.1.1   haswell/openmpi_2.1.2                haswell/su2_6.2.0_intel18
haswell/bowtie2_2.3.4.3       haswell/openmpi_3.1.2_gcc8.2.0       haswell/tophat2_2.1.1
haswell/bowtie2_2.3.5.1       haswell/openmpi_3.1.2_gcc8.2.0_pmix  sandybridge/gcc_8.2.0
haswell/bwa_0.7.17            haswell/orca_4.0.1                   sandybridge/hdf5_1.8.19_intel18
haswell/FFmpeg_4.1.3_intel18  haswell/orca_4.1.2                   sandybridge/nektar++_4.4.0_intel18
haswell/gcc_8.2.0             haswell/qespresso_6.3_intel18        sandybridge/nektar++_4.4.1_intel18
haswell/GDAL_2.4.1_intel18    haswell/samtools_1.7                 sandybridge/netcdf_4.6.1_intel18
…

To define the variables and paths necessary to execute one of the previous programs, we will use the command:

module load file_modules

for example:

module load haswell/smilei_4.1

To check what modifications this command makes in the environment:

 module show haswell/smilei_4.1
-------------------------------------------------------------------
/soft/calendula2/modulefiles/haswell/smilei_4.1:

module-whatis   Variables de entorno para Smilei v4.1
module load     haswell/hdf5_1.8.19_intel18
prepend-path    PATH /soft/calendula2/haswell/Smilei/4.1
prepend-path    PATH /soft/calendula2/haswell/Smilei/miniconda3/bin
-------------------------------------------------------------------