HOWTOs

LaPalma3 (3a): Useful commands

Please note that all the SIEpedia's articles address specific issues or questions raised by IAC users, so they do not attempt to be rigorous or exhaustive, and may or may not be useful or applicable in different or more general contexts.

Useful commands for LaPalma3 (preparations)

We have gathered a list of useful commands when working with LaPalma3. These commands are classified in the next sections, please, let us know if you use other commands that you think we should add to this list:

  1. Connecting
  2. Transferring files
  3. Available software on LaPalma
  4. Specifying which software you want to use
  5. Compiling
  6. Profiling and debugging

Useful commands for executing your parallel application are listed at Useful Commands (executions).

Connecting

Before connecting you need an account in LaPalma3 and send us your public key (please, see this page for more details). You only need to do those previous steps once, if they are already done, simply use ssh in a shell terminal:

  [mymachine]$ ssh username@lapalma1.iac.es

Transferring files

For transferring files to LaPalma from Unix systems (Linux, MacOS,...), you can use secure copy (scp) and secure ftp (sftp), both tools have the same syntax as the old and insecure tools such as rcp (remote copy) and ftp. You can use remote sync (rsync), too, as long as you use ssh as remote shell. As have been said before, no connections are allowed from inside LaPalma to the outside world so all scp, sftp and rsync commands have to be executed from your local machines and not inside LaPalma.

Here there are some examples of each of this tools transferring files to LaPalma:

  [mymachine]$ scp localfile usertest@lapalma1.iac.es:remotedir

  [mymachine]$ sftp usertest@lapalma1.iac.es  
  sftp> cd remotedir
  sftp> put localfile    

  [mymachine]$ rsync -auv localfile usertest@lapalma1.iac.es:remotedir

These are the ways to retrieve files from LaPalma to your local machine:

  [mymachine]$ scp usertest@lapalma1.iac.es:remotefile localdir

  [mymachine]$ sftp usertest@lapalma1.iac.es
  sftp> cd remotedir
  sftp> get remotefile

  [mymachine]$ rsync -auv usertest@lapalma1.iac.es:remotefile localdir

If you are not familiar with these transferring tools, please, check documentation to know the different options they offer. For instance, with sftp you can use mget or mput for multiple transfers, -r for recursion in directories, lcd to change the local directory, use ! to execute some commands locally, etc. rsync also offers a lot of different useful options.


On a Windows system, most of the secure shell clients come with a tool to make secure copies or secure ftp's. There are several tools that accomplishes the requirements, There are several different clients, but as previously mentioned, IAC recommends the use of putty clients for transferring files: psftp and pscp. You can find it at the same web page as putty (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html).

Other possible tool for users requiring graphical file transfers could be:

In order to start remote X applications you need and X-Server running in your local machine. Here is a list of most common X-servers for windows:

Once the X-Server is running run putty with X11 forwarding enabled

Available software on LaPalma

You will find installed on LaPalma the most common software used in scientific computation, like GNU and Intel compilers, OpenMPI and MVAPICH2 MPI compilers, scientific librarires (scalapack, fftw, GSL, MKL, hdf5, ...), tools (cmake, gnuplot, python, ...), parallel applications (VASP, SIESTA, ...), etc.

There are several compilers on LaPalma, and due to compatibility reasons, some software have been compiled with different compilers, so you can choose the version that best fits your needs. For instance, hdf5/gnu/openmpi/1.10.1 means that HDF5 version 1.10.1 has been compiled with gnu compilers (sequential) and with OpenMPI compilers (parallel). That will also give you a hint about prerequisites: to load this version of hdf5 you should first load at least gnu and openmpi/gnu (you can equally use gnu or gcc, both are the same).

The list of available software on LaPalma is continuously being updated, since we frequently install new software or upgrade existing one according to the needs of our users. If you would like to ask for time to execute on LaPalma, but you need to know first which software is available, please, contact us and inquire whether a specific software (and version) is already available or we can install it. Also you can check next list to have an idea:

List of installed software on La Palma (May 2018)

   ----------------------------------------------- compilers ----------------------------------------------- 
   gcc/4.8.5           gnu/7.2.0(default)   mvapich2/intel/2.3rc2  openmpi/gnu/3.0.0    openmpi/intel/3.0.1  
   gcc/7.2.0(default)  intel/2018.2         openmpi/3.0.0          openmpi/gnu/3.0.1    
   gnu/4.8.5           mvapich2/gnu/2.3rc2  openmpi/gnu(default)   openmpi/intel/3.0.0  

   ----------------------------------------------- libraries ----------------------------------------------- 
   cfitsio/3.420              hdf5/gnu/openmpi/1.10.1      netcdf/4.4.4-parallel-fortran  slepc/3.6.0-real     
   fftw/gnu/openmpi/2.1.5     hdf5/intel/impi/1.10.1       netcdf/4.5.0-parallel-c        slepc/3.7.1-complex  
   fftw/gnu/openmpi/2.1.5f    hdf5/intel/openmpi(default)  petsc/3.7.1-complex            slepc/3.7.1-real     
   fftw/gnu/openmpi/3.3.7     hdf5/intel/openmpi/1.10.1    petsc/3.7.1-real               slepc/3.7.3-real     
   gsl/1.9                    impi/2018.1                  qt/4.8.5                       szip/gnu/2.1.1       
   hdf5/1.8.20                impi/2018.2                  qt/5.6.1                       szip/intel/2.1.1     
   hdf5/gnu(default)          lapack/3.5.0                 scalapack/2.0.1                
   hdf5/gnu/openmpi(default)  mkl/2018.1                   scalapack/2.0.2                
   hdf5/gnu/openmpi/1.8.20    mkl/2018.2                   slepc/3.6.0-complex            

   ------------------------------------------------- tools ------------------------------------------------- 
   autoconf/2.69       cmake/gnu/3.11.1    gnuplot/5.0.1           perl/5.24.0    python/3.6.4     
   cmake/gnu(default)  cmake/intel/3.10.0  gnuplot/5.2.2(default)  python/2.7.14  valgrind/3.10.1  
   cmake/gnu/3.10.0    extrae/3.5.2        paraver/4.7.1           python/3.5.0   

   --------------------------------------------- applications ---------------------------------------------- 
   octave/4.0.0           paraview/4.3.1  siesta/4.0.1  vasp/5.3.5           vasp/5.4.4  vtk/7.0.0  vtk/8.1.0  
   octave/4.2.1(default)  qhull/2015.2    vasp/5.2      vasp/5.4.1(default)  vtk/6.2.0   vtk/7.1.1  

Specifying which software you want to use

All installed software (compilers, applications, numerical and graphical libraries, tools, etc.) can be found at /storage/apps/ or directly /apps. There is a directory for each application (uppercase letters) and then a subdirectory with the installed versions. For better flexibility, users are allowed to choose which software packages and version want to use on their executions. By using the Environment Modules package you can dynamically load and/or unload specific modules using the commands listed below (remember to load your required modules in your submission scripts). To manage the modules, you only need to use module command and the proper option, the most common ones are listed bellow:

  • List all available modules
 [lapalma1]$ module avail
  • List all available versions of a specific package
 [lapalma1]$ module avail <package>               # For example: module avail gnu
  • Load an specific module
 [lapalma1]$ module load <module_name>            # For example: module load gnu/7.2.0
  • List all loaded modules
 [lapalma1]$ module list
  • Unload modules
 [lapalma1]$ module rm <module_name>              # Unload a specific module. For example: module rm python/2.6
 [lapalma1]$ module purge                         # Unload all modules
 [lapalma1]$ module switch <old_mod> <new_mod>    # Replace modules (unload old_mod and then load new_mod)
  • Show detailed info (like prerequisites and conflicts)
 [lapalma1]$ module show <module_name>              # Display details for a module (you can also use display) 
 [lapalma1]$ module show <module_name> | grep "prereq\|conflict"     # Show prerequisites and conflicts 


NOTES:

  • Some modules have prerequisites and/or conflicts, so you might need to load them following the proper order. If you have problems when loading your modules, please, check this FAQ.
  • Some of the modules could be needed when executing your code, in order to properly load dynamic libraries, etc. Be careful and do not forget to add the right modules in your script file when submitting it.

Compiling

There are several available compilers in LaPalma3, remember to load their modules before using those compilers. Some modules are not compatible among them, so you may need to unload first a module to load a new one (some examples about how to load and unload modules are shown above).

Sequential

You can use the GNU or Intel(*) compilers in order to compile your sequential codes:

  #           C            C++      Fortran          Compiler
  [lapalma1]$ gcc ...      g++      gfortran         # GNU:      module load gnu
  [lapalma1]$ icc ...      icpc     ifort            # Intel(*): module load intel

OpenMP

The same compilers used for sequential codes can be used for OpenMP applications, adding the proper flag:

  #           C                     C++        Fortran          Compiler
  [lapalma1]$ gcc -fopenmp ...      g++        gfortran         # GNU:      module load gnu
  [lapalma1]$ icc -qopenmp ...      icpc       ifort            # Intel(*): module load intel

MPI

If you need to compile MPI programs, you can use OpenMPI or MVAPICH2 (both compiled with gnu and intel(*))

  #           C              C++        Fortran         Compiler
  [lapalma1]$ mpicc ...      mpicxx     mpifort         # OpenMPI(gnu):    module load gnu openmpi/gnu
  [lapalma1]$ mpicc ...      mpicxx     mpifort         # OpenMPI(intel):  module load intel openmpi/intel
  [lapalma1]$ mpicc ...      mpicxx     mpifort         # MVAPICH2(gnu):   module load gnu mvapich2/gnu
  [lapalma1]$ mpicc ...      mpicxx     mpifort         # MVAPICH2(intel): module load intel mvapich2/intel


NOTES:

  • (*): A valid license is needed to use Intel compilers. It should be available for sequential and OpenMP parallel program. Please, contact us if you have any issue related to licenses.
  • The recommended commands to invoke the compilers are those listed above, but depending on the modules that have been loaded, there might be many others: mpif90, mpif77, mpigcc, mpigxx, etc. You can use the one that best fits your needs, most times they are just wrappers or links, but check the documentation since some of them are deprecated.
  • Use man to get the complete list of options of each compiler (i.e. man gcc or man icc)
  • Optimization options: Using the proper optimizations options when compiling could considerably increase the performance of your program, but bear in mind that optimizations highly depend on each code, so you should check which options are the best ones for your application. Here we recommend some generic ones:
    • GNU compilers: -O3 -mtune=native -march=native [-O3: optimize for maximum speed and enable more aggressive optimizations; -mtune=native and -march=native: pick the current architecture (sandybridge) and apply specific optimizations accordingly. If you want to see the detailed list of optimizations that are applied, add next flags: -Q --help=target -v]
    • Intel compilers: -O3 -ip [-O3: optimize for maximum speed and enable more aggressive optimizations; -ip: allow the expansion of inline functions). It is supposed that flag -xAVX (enable Advanced Vector Extensions) should increase the speed of applications when running on LaPalma3 cores, but we have found out that for some codes it works in the opposite way and using it will notably reduce the performance: please, run some tests to decide whether this optimization option (-xAVX) is suitable for your code or not]
  • By default all compilers will use the 64 bit addressing
  • Automatic parallelization: the GCC compiler will attempt to automatically parallelize simple loop constructs. Use the option -ftree-parallelize-loops=N where N is the number of threads you want to use
  • If your application needs some external libraries (like gsl, mkl, hdf5, netcdf, etc.), use command module avail <package> to see if they are available. If so, load the one(s) you need with module load <module> before compiling your application (and also remember that you might also need to load them in your submit script when running your application). Also check all available versions before loading a module, since sometimes there are specific modules depending on the compilers that you are going to use (for instance, openmpi has different modules for gnu or intel. You can see all those versions using: module avail <package>, usually dependencies are indicated after the version number). Please, contact us if you have any doubt about which version you should choose or you need any software that is not already installed.

Profiling and debugging

Next tools are available on LaPalma3:

  • GNU profiler: gprof
  • GNU code coverage: gcov
  • GNU debugger: gdb