Skip to content
Snippets Groups Projects
Commit 19970283 authored by Lukáš Krupčík's avatar Lukáš Krupčík
Browse files

update

parent 9957468e
No related branches found
No related tags found
6 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!196Master,!167Add soft
Showing
with 3958 additions and 0 deletions
# Bioinformatics Applications
## Introduction
In addition to the many applications available through modules (deployed through EasyBuild packaging system) we provide an alternative source of applications on our clusters inferred from [Gentoo Linux](https://www.gentoo.org/). The user's environment is setup through a script which returns a bash instance to the user (you can think of it a starting a whole virtual machine but inside your current namespace) . The applications were optimized by gcc compiler for the SandyBridge and IvyBridge platforms. The binaries use paths from /apps/gentoo prefix to find the required runtime dependencies, config files, etc. The Gentoo Linux is a standalone installation not even relying on the glibc provided by host operating system (Redhat). The trick which allowed us to install Gentoo Linux on the host Redhat system is called Gentoo::RAP and uses a modified loader with a hardcoded path ([links](https://wiki.gentoo.org/wiki/Prefix/libc)).
## Starting the Environment
```console
mmokrejs@login2~$ /apps/gentoo/startprefix
```
## Starting PBS Jobs Using the Applications
Create a template file which can be used and an argument to qsub command. Notably, the 'PBS -S' line specifies full PATH to the Bourne shell of the Gentoo Linux environment.
```console
mmokrejs@login2~$ cat myjob.pbs
#PBS -S /apps/gentoo/bin/sh
#PBS -l nodes=1:ppn=16,walltime=12:00:00
#PBS -q qfree
#PBS -M my_email@foo.bar
#PBS -m ea
#PBS -N sample22
#PBS -A DD-13-5
#source ~/.bashrc
cd $PBS_O_WORKDIR || exit 255
myscript.sh foo 1>myjob.log 2>&1
$ head -n 1 myscript.sh
#! /apps/gentoo/bin/sh
$ qsub myjob.pbs
$ qstat
```
## Reading Manual Pages for Installed Applications
```console
mmokrejs@login2~$ man -M /apps/gentoo/usr/share/man bwa
mmokrejs@login2~$ man -M /apps/gentoo/usr/share/man samtools
```
## Listing of Bioinformatics Applications
```console
mmokrejs@login2~$ grep biology /scratch/mmokrejs/gentoo_rap/installed.txt
sci-biology/ANGLE-bin-20080813-r1
sci-biology/AlignGraph-9999
sci-biology/Atlas-Link-0.01-r1
sci-biology/BRANCH-9999
sci-biology/EBARDenovo-1.2.2
sci-biology/FLASH-1.2.9
sci-biology/GAL-0.2.2
sci-biology/Gambit-0.4.145
sci-biology/HTSeq-0.6.1
sci-biology/InterMine-0.98
sci-biology/MochiView-1.45
sci-biology/MuSeqBox-5.4
sci-biology/ONTO-PERL-1.41
sci-biology/ORFcor-20130507
sci-biology/Rcorrector-9999
sci-biology/SSAKE-3.8.2
sci-biology/STAR-9999
sci-biology/YASRA-2.33
sci-biology/abacas-1.3.1
sci-biology/align_to_scf-1.06
sci-biology/assembly-stats-9999
sci-biology/bambus-2.33
sci-biology/bamtools-9999
sci-biology/bcftools-1.2
sci-biology/bedtools-2.22.1
sci-biology/bfast-0.7.0a
sci-biology/biobambam2-9999
sci-biology/bismark-0.13.0
sci-biology/blat-34-r1
sci-biology/blue-1.1.3
sci-biology/bowtie-2.2.9
sci-biology/brat-1.2.4
sci-biology/bwa-0.7.13
sci-biology/bx-python-9999
sci-biology/cast-bin-20080813
sci-biology/cd-hit-4.6.5
sci-biology/cdbfasta-0.1
sci-biology/clover-2011.10.24
sci-biology/clustalw-2.1
sci-biology/cnrun-2.0.3
sci-biology/codonw-1.4.4-r2
sci-biology/conform-gt-1174
sci-biology/conifer-0.2.2
sci-biology/coral-1.4
sci-biology/cross_genome-20140822
sci-biology/cutadapt-9999
sci-biology/dawg-1.1.2
sci-biology/dna2pep-1.1
sci-biology/edena-3.131028
sci-biology/epga-9999
sci-biology/erpin-5.5b
sci-biology/estscan-3.0.3
sci-biology/eugene-4.1d
sci-biology/exonerate-gff3-9999
sci-biology/fastx_toolkit-0.0.14
sci-biology/gemini-9999
sci-biology/geneid-1.4.4
sci-biology/genepop-4.2.1
sci-biology/glimmerhmm-3.0.1-r1
sci-biology/gmap-2015.12.31.5
sci-biology/hexamer-19990330
sci-biology/hts-python-9999
sci-biology/jellyfish-2.1.4
sci-biology/jigsaw-3.2.10
sci-biology/kallisto-9999
sci-biology/karect-1.0.0
sci-biology/lastz-1.03.66
sci-biology/libgtextutils-0.6.1
sci-biology/lucy-1.20
sci-biology/megahit-9999
sci-biology/merlin-1.1.2
sci-biology/miranda-3.3a
sci-biology/mreps-2.5
sci-biology/mrfast-2.6.0.1
sci-biology/mummer-3.22-r1
sci-biology/muscle-3.8.31
sci-biology/nrcl-110625
sci-biology/nwalign-0.3.1
sci-biology/oases-9999
sci-biology/parafly-20130121
sci-biology/phrap-1.080812-r1
sci-biology/phred-071220
sci-biology/phylip-3.696-r1
sci-biology/plinkseq-0.10
sci-biology/primer3-2.3.7
sci-biology/prinseq-lite-0.20.4
sci-biology/proda-1.0
sci-biology/pybedtools-0.6.9
sci-biology/pysam-0.9.0
sci-biology/pysamstats-0.24.2
sci-biology/quast-2.3
sci-biology/quorum-1.0.0
sci-biology/reaper-15348
sci-biology/repeatmasker-libraries-20150807
sci-biology/reptile-1.1
sci-biology/samstat-20130708
sci-biology/samtools-0.1.20-r2
sci-biology/samtools-1.3-r1
sci-biology/scaffold_builder-20131122-r1
sci-biology/scan_for_matches-20121220
sci-biology/screed-0.7.1
sci-biology/scythe-0.992
sci-biology/seqan-2.1.1
sci-biology/seqtools-4.34.5
sci-biology/sff_dump-1.04
sci-biology/sgp2-1.1
sci-biology/shrimp-2.2.3
sci-biology/sickle-9999
sci-biology/smalt-0.7.6
sci-biology/snpomatic-9999
sci-biology/ssaha2-bin-2.5.5
sci-biology/stampy-1.0.28
sci-biology/stringtie-1.2.2
sci-biology/subread-1.4.6
sci-biology/swissknife-1.72
sci-biology/tagdust-20101028
sci-biology/tclust-110625
sci-biology/tigr-foundation-libs-2.0-r1
sci-biology/trans-abyss-1.4.8
sci-biology/trf-4.07b
sci-biology/uchime-4.2.40
sci-biology/velvet-1.2.10
sci-biology/velvetk-20120606
sci-biology/zmsort-110625
```
```console
mmokrejs@login2~$ grep sci-libs /scratch/mmokrejs/gentoo_rap/installed.txt
sci-libs/amd-2.3.1
sci-libs/blas-reference-20151113-r1
sci-libs/camd-2.3.1
sci-libs/cbflib-0.9.3.3
sci-libs/ccolamd-2.8.0
sci-libs/cholmod-2.1.2
sci-libs/coinor-cbc-2.8.9
sci-libs/coinor-cgl-0.58.6
sci-libs/coinor-clp-1.15.6-r1
sci-libs/coinor-dylp-1.9.4
sci-libs/coinor-osi-0.106.6
sci-libs/coinor-utils-2.9.11
sci-libs/coinor-vol-1.4.4
sci-libs/colamd-2.8.0
sci-libs/cxsparse-3.1.2
sci-libs/dcmtk-3.6.0
sci-libs/gsl-2.1
sci-libs/hdf5-1.8.15_p1
sci-libs/htslib-1.3
sci-libs/io_lib-1.14.7
sci-libs/lapack-reference-3.6.0-r1
sci-libs/lemon-1.3-r2
sci-libs/libmaus2-9999
sci-libs/qrupdate-1.1.2-r1
sci-libs/scikits-0.1-r1
sci-libs/suitesparseconfig-4.2.1
sci-libs/umfpack-5.6.2
```
## Classification of Applications
| Applications for bioinformatics at IT4I | |
| --------------------------------------- | ------ |
| error-correctors | 6 |
| aligners | 20 |
| clusterers | 5 |
| assemblers | 9 |
| scaffolders | 6 |
| motif searching | 6 |
| ORF/gene prediction/genome annotation | 13 |
| genotype/haplotype/popullation genetics | 3 |
| phylogenetics | 1 |
| transcriptome analysis | 2 |
| utilities | 15 |
| GUI | 3 |
| libraries | 4 |
| **Total** | **93** |
![graphs](../img/bio-graphs.png)
## Other Applications Available Through Gentoo Linux
Gentoo Linux is a allows compilation of its applications from source code while using compiler and optimize flags set to user's wish. This facilitates creation of optimized binaries for the host platform. Users maybe also use several versions of gcc, python and other tools.
```console
mmokrejs@login2~$ gcc-config -l
mmokrejs@login2~$ java-config -L
mmokrejs@login2~$ eselect
```
# Diagnostic component (TEAM)
## Access
TEAM is available at the [following address](http://omics.it4i.cz/team/)
!!! note
The address is accessible only via VPN.
## Diagnostic Component
VCF files are scanned by this diagnostic tool for known diagnostic disease-associated variants. When no diagnostic mutation is found, the file can be sent to the disease-causing gene discovery tool to see whether new disease associated variants can be found.
TEAM (27) is an intuitive and easy-to-use web tool that fills the gap between the predicted mutations and the final diagnostic in targeted enrichment sequencing analysis. The tool searches for known diagnostic mutations, corresponding to a disease panel, among the predicted patient’s variants. Diagnostic variants for the disease are taken from four databases of disease-related variants (HGMD-public, HUMSAVAR , ClinVar and COSMIC) If no primary diagnostic variant is found, then a list of secondary findings that can help to establish a diagnostic is produced. TEAM also provides with an interface for the definition of and customization of panels, by means of which, genes and mutations can be added or discarded to adjust panel definitions.
![Interface of the application. Panels for defining targeted regions of interest can be set up by just drag and drop known disease genes or disease definitions from the lists. Thus, virtual panels can be interactively improved as the knowledge of the disease increases.](../../img/fig5.png)
** Figure 5. **Interface of the application. Panels for defining targeted regions of interest can be set up by just drag and drop known disease genes or disease definitions from the lists. Thus, virtual panels can be interactively improved as the knowledge of the disease increases.
This diff is collapsed.
# Prioritization component (BiERapp)
## Access
BiERapp is available at the [following address](http://omics.it4i.cz/bierapp/)
!!! note
The address is accessible only via VPN.
## BiERapp
** This tool is aimed to discover new disease genes or variants by studying affected families or cases and controls. It carries out a filtering process to sequentially remove: (i) variants which are not no compatible with the disease because are not expected to have impact on the protein function; (ii) variants that exist at frequencies incompatible with the disease; (iii) variants that do not segregate with the disease. The result is a reduced set of disease gene candidates that should be further validated experimentally. **
BiERapp (28) efficiently helps in the identification of causative variants in family and sporadic genetic diseases. The program reads lists of predicted variants (nucleotide substitutions and indels) in affected individuals or tumor samples and controls. In family studies, different modes of inheritance can easily be defined to filter out variants that do not segregate with the disease along the family. Moreover, BiERapp integrates additional information such as allelic frequencies in the general population and the most popular damaging scores to further narrow down the number of putative variants in successive filtering steps. BiERapp provides an interactive and user-friendly interface that implements the filtering strategy used in the context of a large-scale genomic project carried out by the Spanish Network for Research, in Rare Diseases (CIBERER) and the Medical Genome Project. in which more than 800 exomes have been analyzed.
![Web interface to the prioritization tool. This figure shows the interface of the web tool for candidate gene prioritization with the filters available. The tool includes a genomic viewer (Genome Maps 30) that enables the representation of the variants in the corresponding genomic coordinates.](../../img/fig6.png)
** Figure 6 **. Web interface to the prioritization tool. This figure shows the interface of the web tool for candidate gene
prioritization with the filters available. The tool includes a genomic viewer (Genome Maps 30) that enables the representation of the variants in the corresponding genomic coordinates.
# COMSOL Multiphysics
## Introduction
[COMSOL](http://www.comsol.com) is a powerful environment for modelling and solving various engineering and scientific problems based on partial differential equations. COMSOL is designed to solve coupled or multiphysics phenomena. For many standard engineering problems COMSOL provides add-on products such as electrical, mechanical, fluid flow, and chemical applications.
* [Structural Mechanics Module](http://www.comsol.com/structural-mechanics-module),
* [Heat Transfer Module](http://www.comsol.com/heat-transfer-module),
* [CFD Module](http://www.comsol.com/cfd-module),
* [Acoustics Module](http://www.comsol.com/acoustics-module),
* and [many others](http://www.comsol.com/products)
COMSOL also allows an interface support for equation-based modelling of partial differential equations.
## Execution
On the clusters COMSOL is available in the latest stable version. There are two variants of the release:
* **Non commercial** or so called **EDU variant**, which can be used for research and educational purposes.
* **Commercial** or so called **COM variant**, which can used also for commercial activities. **COM variant** has only subset of features compared to the **EDU variant** available. More about licensing [here](licensing-and-available-versions/).
To load the of COMSOL load the module
```console
$ ml COMSOL
```
By default the **EDU variant** will be loaded. If user needs other version or variant, load the particular version. To obtain the list of available versions use
```console
$ ml av COMSOL
```
If user needs to prepare COMSOL jobs in the interactive mode it is recommend to use COMSOL on the compute nodes via PBS Pro scheduler. In order run the COMSOL Desktop GUI on Windows is recommended to use the [Virtual Network Computing (VNC)](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/).
Example for Salomon:
```console
$ xhost +
$ qsub -I -X -A PROJECT_ID -q qprod -l select=1:ppn=24
$ ml COMSOL
$ comsol
```
To run COMSOL in batch mode, without the COMSOL Desktop GUI environment, user can utilized the default (comsol.pbs) job script and execute it via the qsub command.
```bash
#!/bin/bash
#PBS -l select=3:ppn=24
#PBS -q qprod
#PBS -N JOB_NAME
#PBS -A PROJECT_ID
cd /scratch/work/user/$USER/ || exit # on Anselm use: /scratch/$USER
echo Time is `date`
echo Directory is `pwd`
echo '**PBS_NODEFILE***START*******'
cat $PBS_NODEFILE
echo '**PBS_NODEFILE***END*********'
text_nodes < cat $PBS_NODEFILE
module load COMSOL
# module load COMSOL/51-EDU
ntask=$(wc -l $PBS_NODEFILE)
comsol -nn ${ntask} batch -configuration /tmp –mpiarg –rmk –mpiarg pbs -tmpdir /scratch/.../$USER/ -inputfile name_input_f.mph -outputfile name_output_f.mph -batchlog name_log_f.log
```
Working directory has to be created before sending the (comsol.pbs) job script into the queue. Input file (name_input_f.mph) has to be in working directory or full path to input file has to be specified. The appropriate path to the temp directory of the job has to be set by command option (-tmpdir).
## LiveLink for MATLAB
COMSOL is the software package for the numerical solution of the partial differential equations. LiveLink for MATLAB allows connection to the COMSOL API (Application Programming Interface) with the benefits of the programming language and computing environment of the MATLAB.
LiveLink for MATLAB is available in both **EDU** and **COM** **variant** of the COMSOL release. On the clusters 1 commercial (**COM**) license and the 5 educational (**EDU**) licenses of LiveLink for MATLAB (please see the [ISV Licenses](../isv_licenses/)) are available. Following example shows how to start COMSOL model from MATLAB via LiveLink in the interactive mode (on Anselm use 16 threads).
```console
$ xhost +
$ qsub -I -X -A PROJECT_ID -q qexp -l select=1:ppn=24
$ ml MATLAB
$ ml COMSOL
$ comsol server MATLAB
```
At the first time to launch the LiveLink for MATLAB (client-MATLAB/server-COMSOL connection) the login and password is requested and this information is not requested again.
To run LiveLink for MATLAB in batch mode with (comsol_matlab.pbs) job script you can utilize/modify the following script and execute it via the qsub command.
```bash
#!/bin/bash
#PBS -l select=3:ppn=24
#PBS -q qprod
#PBS -N JOB_NAME
#PBS -A PROJECT_ID
cd /scratch/work/user/$USER || exit # on Anselm use: /scratch/$USER
echo Time is `date`
echo Directory is `pwd`
echo '**PBS_NODEFILE***START*******'
cat $PBS_NODEFILE
echo '**PBS_NODEFILE***END*********'
text_nodes < cat $PBS_NODEFILE
module load MATLAB
module load COMSOL/51-EDU
ntask=$(wc -l $PBS_NODEFILE)
comsol -nn ${ntask} server -configuration /tmp -mpiarg -rmk -mpiarg pbs -tmpdir /scratch/work/user/$USER/work &
cd /apps/cae/COMSOL/51/mli
matlab -nodesktop -nosplash -r "mphstart; addpath /scratch/work/user/$USER/work; test_job"
```
This example shows how to run Livelink for MATLAB with following configuration: 3 nodes and 24 cores per node. Working directory has to be created before submitting (comsol_matlab.pbs) job script into the queue. Input file (test_job.m) has to be in working directory or full path to input file has to be specified. The Matlab command option (-r ”mphstart”) created a connection with a COMSOL server using the default port number.
# Licensing and Available Versions
## Comsol Licence Can Be Used By:
* all persons in the carrying out of the CE IT4Innovations Project (In addition to the primary licensee, which is VSB - Technical University of Ostrava, users are CE IT4Innovations third parties - CE IT4Innovations project partners, particularly the University of Ostrava, the Brno University of Technology - Faculty of Informatics, the Silesian University in Opava, Institute of Geonics AS CR.)
* all persons who have a valid license
* students of the Technical University
## Comsol EDU Network Licence
The licence intended to be used for science and research, publications, students’ projects, teaching (academic licence).
## Comsol COM Network Licence
The licence intended to be used for science and research, publications, students’ projects, commercial research with no commercial use restrictions. Enables the solution of at least one job by one user in one program start.
## Available Versions
* ver. 51
# Intel Advisor
is tool aiming to assist you in vectorization and threading of your code. You can use it to profile your application and identify loops, that could benefit from vectorization and/or threading parallelism.
## Installed Versions
The following versions are currently available on Salomon as modules:
2016 Update 2 - Advisor/2016_update2
## Usage
Your program should be compiled with -g switch to include symbol names. You should compile with -O2 or higher to see code that is already vectorized by the compiler.
Profiling is possible either directly from the GUI, or from command line.
To profile from GUI, launch Advisor:
```console
$ advixe-gui
```
Then select menu File -> New -> Project. Choose a directory to save project data to. After clicking OK, Project properties window will appear, where you can configure path to your binary, launch arguments, working directory etc. After clicking OK, the project is ready.
In the left pane, you can switch between Vectorization and Threading workflows. Each has several possible steps which you can execute by clicking Collect button. Alternatively, you can click on Command Line, to see the command line required to run the analysis directly from command line.
## References
1. [Intel® Advisor 2015 Tutorial: Find Where to Add Parallelism - C++ Sample](https://software.intel.com/en-us/intel-advisor-tutorial-vectorization-windows-cplusplus)
1. [Product page](https://software.intel.com/en-us/intel-advisor-xe)
1. [Documentation](https://software.intel.com/en-us/intel-advisor-2016-user-guide-linux)
# Intel Compilers
The Intel compilers in multiple versions are available, via module intel. The compilers include the icc C and C++ compiler and the ifort fortran 77/90/95 compiler.
```console
$ ml intel
$ icc -v
$ ifort -v
```
The intel compilers provide for vectorization of the code, via the AVX2 instructions and support threading parallelization via OpenMP
For maximum performance on the Salomon cluster compute nodes, compile your programs using the AVX2 instructions, with reporting where the vectorization was used. We recommend following compilation options for high performance
```console
$ icc -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec myprog.c mysubroutines.c -o myprog.x
$ ifort -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec myprog.f mysubroutines.f -o myprog.x
```
In this example, we compile the program enabling interprocedural optimizations between source files (-ipo), aggresive loop optimizations (-O3) and vectorization (-xCORE-AVX2)
The compiler recognizes the omp, simd, vector and ivdep pragmas for OpenMP parallelization and AVX2 vectorization. Enable the OpenMP parallelization by the **-openmp** compiler switch.
```console
$ icc -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec -openmp myprog.c mysubroutines.c -o myprog.x
$ ifort -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec -openmp myprog.f mysubroutines.f -o myprog.x
```
Read more at <https://software.intel.com/en-us/intel-cplusplus-compiler-16.0-user-and-reference-guide>
## Sandy Bridge/Ivy Bridge/Haswell Binary Compatibility
Anselm nodes are currently equipped with Sandy Bridge CPUs, while Salomon compute nodes are equipped with Haswell based architecture. The UV1 SMP compute server has Ivy Bridge CPUs, which are equivalent to Sandy Bridge (only smaller manufacturing technology). The new processors are backward compatible with the Sandy Bridge nodes, so all programs that ran on the Sandy Bridge processors, should also run on the new Haswell nodes. To get optimal performance out of the Haswell processors a program should make use of the special AVX2 instructions for this processor. One can do this by recompiling codes with the compiler flags designated to invoke these instructions. For the Intel compiler suite, there are two ways of doing this:
* Using compiler flag (both for Fortran and C): -xCORE-AVX2. This will create a binary with AVX2 instructions, specifically for the Haswell processors. Note that the executable will not run on Sandy Bridge/Ivy Bridge nodes.
* Using compiler flags (both for Fortran and C): -xAVX -axCORE-AVX2. This will generate multiple, feature specific auto-dispatch code paths for Intel® processors, if there is a performance benefit. So this binary will run both on Sandy Bridge/Ivy Bridge and Haswell processors. During runtime it will be decided which path to follow, dependent on which processor you are running on. In general this will result in larger binaries.
# Intel Debugger
IDB is no longer available since Intel Parallel Studio 2015
## Debugging Serial Applications
The intel debugger version is available, via module intel/13.5.192. The debugger works for applications compiled with C and C++ compiler and the ifort fortran 77/90/95 compiler. The debugger provides java GUI environment. Use [X display](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/) for running the GUI.
```console
$ ml intel/13.5.192
$ ml Java
$ idb
```
The debugger may run in text mode. To debug in text mode, use
```console
$ idbc
```
To debug on the compute nodes, module intel must be loaded. The GUI on compute nodes may be accessed using the same way as in [the GUI section](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/)
Example:
```console
$ qsub -q qexp -l select=1:ncpus=24 -X -I # use 16 threads for Anselm
qsub: waiting for job 19654.srv11 to start
qsub: job 19654.srv11 ready
$ ml intel
$ ml Java
$ icc -O0 -g myprog.c -o myprog.x
$ idb ./myprog.x
```
In this example, we allocate 1 full compute node, compile program myprog.c with debugging options -O0 -g and run the idb debugger interactively on the myprog.x executable. The GUI access is via X11 port forwarding provided by the PBS workload manager.
## Debugging Parallel Applications
Intel debugger is capable of debugging multithreaded and MPI parallel programs as well.
### Small Number of MPI Ranks
For debugging small number of MPI ranks, you may execute and debug each rank in separate xterm terminal (do not forget the [X display](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/)). Using Intel MPI, this may be done in following way:
```console
$ qsub -q qexp -l select=2:ncpus=24 -X -I
qsub: waiting for job 19654.srv11 to start
qsub: job 19655.srv11 ready
$ ml intel
$ mpirun -ppn 1 -hostfile $PBS_NODEFILE --enable-x xterm -e idbc ./mympiprog.x
```
In this example, we allocate 2 full compute node, run xterm on each node and start idb debugger in command line mode, debugging two ranks of mympiprog.x application. The xterm will pop up for each rank, with idb prompt ready. The example is not limited to use of Intel MPI
### Large Number of MPI Ranks
Run the idb debugger from within the MPI debug option. This will cause the debugger to bind to all ranks and provide aggregated outputs across the ranks, pausing execution automatically just after startup. You may then set break points and step the execution manually. Using Intel MPI:
```console
$ qsub -q qexp -l select=2:ncpus=24 -X -I
qsub: waiting for job 19654.srv11 to start
qsub: job 19655.srv11 ready
$ ml intel
$ mpirun -n 48 -idb ./mympiprog.x
```
### Debugging Multithreaded Application
Run the idb debugger in GUI mode. The menu Parallel contains number of tools for debugging multiple threads. One of the most useful tools is the **Serialize Execution** tool, which serializes execution of concurrent threads for easy orientation and identification of concurrency related bugs.
## Further Information
Exhaustive manual on idb features and usage is published at Intel website, <https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/>
# Intel Inspector
Intel Inspector is a dynamic memory and threading error checking tool for C/C++/Fortran applications. It can detect issues such as memory leaks, invalid memory references, uninitalized variables, race conditions, deadlocks etc.
## Installed Versions
The following versions are currently available on Salomon as modules:
2016 Update 1 - Inspector/2016_update1
## Usage
Your program should be compiled with -g switch to include symbol names. Optimizations can be turned on.
Debugging is possible either directly from the GUI, or from command line.
### GUI Mode
To debug from GUI, launch Inspector:
```console
$ inspxe-gui &
```
Then select menu File -> New -> Project. Choose a directory to save project data to. After clicking OK, Project properties window will appear, where you can configure path to your binary, launch arguments, working directory etc. After clicking OK, the project is ready.
In the main pane, you can start a predefined analysis type or define your own. Click Start to start the analysis. Alternatively, you can click on Command Line, to see the command line required to run the analysis directly from command line.
### Batch Mode
Analysis can be also run from command line in batch mode. Batch mode analysis is run with command inspxe-cl. To obtain the required parameters, either consult the documentation or you can configure the analysis in the GUI and then click "Command Line" button in the lower right corner to the respective command line.
Results obtained from batch mode can be then viewed in the GUI by selecting File -> Open -> Result...
## References
1. [Product page](https://software.intel.com/en-us/intel-inspector-xe)
1. [Documentation and Release Notes](https://software.intel.com/en-us/intel-inspector-xe-support/documentation)
1. [Tutorials](https://software.intel.com/en-us/articles/inspectorxe-tutorials)
# Intel IPP
## Intel Integrated Performance Primitives
Intel Integrated Performance Primitives, version 9.0.1, compiled for AVX2 vector instructions is available, via module ipp. The IPP is a very rich library of highly optimized algorithmic building blocks for media and data applications. This includes signal, image and frame processing algorithms, such as FFT, FIR, Convolution, Optical Flow, Hough transform, Sum, MinMax, as well as cryptographic functions, linear algebra functions and many more.
Check out IPP before implementing own math functions for data processing, it is likely already there.
```console
$ ml ipp
```
The module sets up environment variables, required for linking and running ipp enabled applications.
## IPP Example
```cpp
#include "ipp.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
const IppLibraryVersion *lib;
Ipp64u fm;
IppStatus status;
status= ippInit(); //IPP initialization with the best optimization layer
if( status != ippStsNoErr ) {
printf("IppInit() Error:n");
printf("%sn", ippGetStatusString(status) );
return -1;
}
//Get version info
lib = ippiGetLibVersion();
printf("%s %sn", lib->Name, lib->Version);
//Get CPU features enabled with selected library level
fm=ippGetEnabledCpuFeatures();
printf("SSE :%cn",(fm>1)&1?'Y':'N');
printf("SSE2 :%cn",(fm>2)&1?'Y':'N');
printf("SSE3 :%cn",(fm>3)&1?'Y':'N');
printf("SSSE3 :%cn",(fm>4)&1?'Y':'N');
printf("SSE41 :%cn",(fm>6)&1?'Y':'N');
printf("SSE42 :%cn",(fm>7)&1?'Y':'N');
printf("AVX :%cn",(fm>8)&1 ?'Y':'N');
printf("AVX2 :%cn", (fm>15)&1 ?'Y':'N' );
printf("----------n");
printf("OS Enabled AVX :%cn", (fm>9)&1 ?'Y':'N');
printf("AES :%cn", (fm>10)&1?'Y':'N');
printf("CLMUL :%cn", (fm>11)&1?'Y':'N');
printf("RDRAND :%cn", (fm>13)&1?'Y':'N');
printf("F16C :%cn", (fm>14)&1?'Y':'N');
return 0;
}
```
Compile above example, using any compiler and the ipp module.
```console
$ ml intel
$ ml ipp
$ icc testipp.c -o testipp.x -lippi -lipps -lippcore
```
You will need the ipp module loaded to run the ipp enabled executable. This may be avoided, by compiling library search paths into the executable
```console
$ ml intel
$ ml ipp
$ icc testipp.c -o testipp.x -Wl,-rpath=$LIBRARY_PATH -lippi -lipps -lippcore
```
## Code Samples and Documentation
Intel provides number of [Code Samples for IPP](https://software.intel.com/en-us/articles/code-samples-for-intel-integrated-performance-primitives-library), illustrating use of IPP.
Read full documentation on IPP [on Intel website,](http://software.intel.com/sites/products/search/search.php?q=&x=15&y=6&product=ipp&version=7.1&docos=lin) in particular the [IPP Reference manual.](http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_manual/index.htm)
# Intel MKL
## Intel Math Kernel Library
Intel Math Kernel Library (Intel MKL) is a library of math kernel subroutines, extensively threaded and optimized for maximum performance. Intel MKL provides these basic math kernels:
* BLAS (level 1, 2, and 3) and LAPACK linear algebra routines, offering vector, vector-matrix, and matrix-matrix operations.
* The PARDISO direct sparse solver, an iterative sparse solver, and supporting sparse BLAS (level 1, 2, and 3) routines for solving sparse systems of equations.
* ScaLAPACK distributed processing linear algebra routines for Linux and Windows operating systems, as well as the Basic Linear Algebra Communications Subprograms (BLACS) and the Parallel Basic Linear Algebra Subprograms (PBLAS).
* Fast Fourier transform (FFT) functions in one, two, or three dimensions with support for mixed radices (not limited to sizes that are powers of 2), as well as distributed versions of these functions.
* Vector Math Library (VML) routines for optimized mathematical operations on vectors.
* Vector Statistical Library (VSL) routines, which offer high-performance vectorized random number generators (RNG) for several probability distributions, convolution and correlation routines, and summary statistics functions.
* Data Fitting Library, which provides capabilities for spline-based approximation of functions, derivatives and integrals of functions, and search.
* Extended Eigensolver, a shared memory version of an eigensolver based on the Feast Eigenvalue Solver.
For details see the [Intel MKL Reference Manual](http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mklman/index.htm).
Intel MKL is available on the cluster
```console
$ ml av imkl
$ ml imkl
```
The module sets up environment variables, required for linking and running mkl enabled applications. The most important variables are the $MKLROOT, $CPATH, $LD_LIBRARY_PATH and $MKL_EXAMPLES
Intel MKL library may be linked using any compiler. With intel compiler use -mkl option to link default threaded MKL.
### Interfaces
Intel MKL library provides number of interfaces. The fundamental once are the LP64 and ILP64. The Intel MKL ILP64 libraries use the 64-bit integer type (necessary for indexing large arrays, with more than 231^-1 elements), whereas the LP64 libraries index arrays with the 32-bit integer type.
| Interface | Integer type |
| --------- | -------------------------------------------- |
| LP64 | 32-bit, int, integer(kind=4), MPI_INT |
| ILP64 | 64-bit, long int, integer(kind=8), MPI_INT64 |
### Linking
Linking Intel MKL libraries may be complex. Intel [mkl link line advisor](http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor) helps. See also [examples](intel-mkl/#examples) below.
You will need the mkl module loaded to run the mkl enabled executable. This may be avoided, by compiling library search paths into the executable. Include rpath on the compile line:
```console
$ icc .... -Wl,-rpath=$LIBRARY_PATH ...
```
### Threading
Advantage in using Intel MKL library is that it brings threaded parallelization to applications that are otherwise not parallel.
For this to work, the application must link the threaded MKL library (default). Number and behaviour of MKL threads may be controlled via the OpenMP environment variables, such as OMP_NUM_THREADS and KMP_AFFINITY. MKL_NUM_THREADS takes precedence over OMP_NUM_THREADS
```console
$ export OMP_NUM_THREADS=24 # 16 for Anselm
$ export KMP_AFFINITY=granularity=fine,compact,1,0
```
The application will run with 24 threads with affinity optimized for fine grain parallelization.
## Examples
Number of examples, demonstrating use of the Intel MKL library and its linking is available on clusters, in the $MKL_EXAMPLES directory. In the examples below, we demonstrate linking Intel MKL to Intel and GNU compiled program for multi-threaded matrix multiplication.
### Working With Examples
```console
$ ml intel
$ ml imkl
$ cp -a $MKL_EXAMPLES/cblas /tmp/
$ cd /tmp/cblas
$ make sointel64 function=cblas_dgemm
```
In this example, we compile, link and run the cblas_dgemm example, demonstrating use of MKL example suite installed on clusters.
### Example: MKL and Intel Compiler
```console
$ ml intel
$ ml imkl
$ cp -a $MKL_EXAMPLES/cblas /tmp/
$ cd /tmp/cblas
$
$ icc -w source/cblas_dgemmx.c source/common_func.c -mkl -o cblas_dgemmx.x
$ ./cblas_dgemmx.x data/cblas_dgemmx.d
```
In this example, we compile, link and run the cblas_dgemm example, demonstrating use of MKL with icc -mkl option. Using the -mkl option is equivalent to:
```console
$ icc -w source/cblas_dgemmx.c source/common_func.c -o cblas_dgemmx.x -I$MKL_INC_DIR -L$MKL_LIB_DIR -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5
```
In this example, we compile and link the cblas_dgemm example, using LP64 interface to threaded MKL and Intel OMP threads implementation.
### Example: Intel MKL and GNU Compiler
```console
$ ml GCC
$ ml imkl
$ cp -a $MKL_EXAMPLES/cblas /tmp/
$ cd /tmp/cblas
$ gcc -w source/cblas_dgemmx.c source/common_func.c -o cblas_dgemmx.x -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lm
$ ./cblas_dgemmx.x data/cblas_dgemmx.d
```
In this example, we compile, link and run the cblas_dgemm example, using LP64 interface to threaded MKL and gnu OMP threads implementation.
## MKL and MIC Accelerators
The Intel MKL is capable to automatically offload the computations o the MIC accelerator. See section [Intel Xeon Phi](../intel-xeon-phi/) for details.
## LAPACKE C Interface
MKL includes LAPACKE C Interface to LAPACK. For some reason, although Intel is the author of LAPACKE, the LAPACKE header files are not present in MKL. For this reason, we have prepared LAPACKE module, which includes Intel's LAPACKE headers from official LAPACK, which you can use to compile code using LAPACKE interface against MKL.
## Further Reading
Read more on [Intel website](http://software.intel.com/en-us/intel-mkl), in particular the [MKL users guide](https://software.intel.com/en-us/intel-mkl/documentation/linux).
# Intel Parallel Studio
The Salomon cluster provides following elements of the Intel Parallel Studio XE
Intel Parallel Studio XE
* Intel Compilers
* Intel Debugger
* Intel MKL Library
* Intel Integrated Performance Primitives Library
* Intel Threading Building Blocks Library
* Intel Trace Analyzer and Collector
* Intel Advisor
* Intel Inspector
## Intel Compilers
The Intel compilers are available, via module intel. The compilers include the icc C and C++ compiler and the ifort fortran 77/90/95 compiler.
```console
$ ml intel
$ icc -v
$ ifort -v
```
Read more at the [Intel Compilers](intel-compilers/) page.
## Intel Debugger
IDB is no longer available since Parallel Studio 2015.
The intel debugger version 13.0 is available, via module intel. The debugger works for applications compiled with C and C++ compiler and the ifort fortran 77/90/95 compiler. The debugger provides java GUI environment.
```console
$ ml intel
$ idb
```
Read more at the [Intel Debugger](intel-debugger/) page.
## Intel Math Kernel Library
Intel Math Kernel Library (Intel MKL) is a library of math kernel subroutines, extensively threaded and optimized for maximum performance. Intel MKL unites and provides these basic components: BLAS, LAPACK, ScaLapack, PARDISO, FFT, VML, VSL, Data fitting, Feast Eigensolver and many more.
```console
$ ml imkl
```
Read more at the [Intel MKL](intel-mkl/) page.
## Intel Integrated Performance Primitives
Intel Integrated Performance Primitives, version 7.1.1, compiled for AVX is available, via module ipp. The IPP is a library of highly optimized algorithmic building blocks for media and data applications. This includes signal, image and frame processing algorithms, such as FFT, FIR, Convolution, Optical Flow, Hough transform, Sum, MinMax and many more.
```console
$ ml ipp
```
Read more at the [Intel IPP](intel-integrated-performance-primitives/) page.
## Intel Threading Building Blocks
Intel Threading Building Blocks (Intel TBB) is a library that supports scalable parallel programming using standard ISO C++ code. It does not require special languages or compilers. It is designed to promote scalable data parallel programming. Additionally, it fully supports nested parallelism, so you can build larger parallel components from smaller parallel components. To use the library, you specify tasks, not threads, and let the library map tasks onto threads in an efficient manner.
```console
$ ml tbb
```
Read more at the [Intel TBB](intel-tbb/) page.
# Intel TBB
## Intel Threading Building Blocks
Intel Threading Building Blocks (Intel TBB) is a library that supports scalable parallel programming using standard ISO C++ code. It does not require special languages or compilers. To use the library, you specify tasks, not threads, and let the library map tasks onto threads in an efficient manner. The tasks are executed by a runtime scheduler and may be offloaded to [MIC accelerator](../intel-xeon-phi/).
Intel is available on the cluster.
```console
$ ml av tbb
```
The module sets up environment variables, required for linking and running tbb enabled applications.
Link the tbb library, using -ltbb
## Examples
Number of examples, demonstrating use of TBB and its built-in scheduler is available on Anselm, in the $TBB_EXAMPLES directory.
```console
$ ml intel
$ ml tbb
$ cp -a $TBB_EXAMPLES/common $TBB_EXAMPLES/parallel_reduce /tmp/
$ cd /tmp/parallel_reduce/primes
$ icc -O2 -DNDEBUG -o primes.x main.cpp primes.cpp -ltbb
$ ./primes.x
```
In this example, we compile, link and run the primes example, demonstrating use of parallel task-based reduce in computation of prime numbers.
You will need the tbb module loaded to run the tbb enabled executable. This may be avoided, by compiling library search paths into the executable.
```console
$ icc -O2 -o primes.x main.cpp primes.cpp -Wl,-rpath=$LIBRARY_PATH -ltbb
```
## Further Reading
Read more on Intel website, <http://software.intel.com/sites/products/documentation/doclib/tbb_sa/help/index.htm>
# Intel Trace Analyzer and Collector
Intel Trace Analyzer and Collector (ITAC) is a tool to collect and graphicaly analyze behaviour of MPI applications. It helps you to analyze communication patterns of your application, identify hotspots, perform correctnes checking (identify deadlocks, data corruption etc), simulate how your application would run on a different interconnect.
ITAC is a offline analysis tool - first you run your application to collect a trace file, then you can open the trace in a GUI analyzer to view it.
## Installed Version
Currently on Salomon is version 9.1.2.024 available as module itac/9.1.2.024
## Collecting Traces
ITAC can collect traces from applications that are using Intel MPI. To generate a trace, simply add -trace option to your mpirun command :
```console
$ ml itac/9.1.2.024
$ mpirun -trace myapp
```
The trace will be saved in file myapp.stf in the current directory.
## Viewing Traces
To view and analyze the trace, open ITAC GUI in a [graphical environment](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/):
```console
$ ml itac/9.1.2.024
$ traceanalyzer
```
The GUI will launch and you can open the produced `*`.stf file.
![](../../img/Snmekobrazovky20151204v15.35.12.png)
Please refer to Intel documenation about usage of the GUI tool.
## References
1. [Getting Started with Intel® Trace Analyzer and Collector](https://software.intel.com/en-us/get-started-with-itac-for-linux)
1. [Intel® Trace Analyzer and Collector - Documentation](https://software.intel.com/en-us/intel-trace-analyzer)
This diff is collapsed.
This diff is collapsed.
# Lmod Environment
Lmod is a modules tool, a modern alternative to the oudated & no longer actively maintained Tcl-based environment modules tool.
Detailed documentation on Lmod is available [here](http://lmod.readthedocs.io).
## Benefits
* significantly more responsive module commands, in particular module avail (ml av)
* easier to use interface
* module files can be written in either Tcl or Lua syntax (and both types of modules can be mixed together)
## Introduction
Below you will find more details and examples.
| command | equivalent/explanation |
| ------------------------ | ---------------------------------------------------------------- |
| ml | module list |
| ml GCC/6.2.0-2.27 | module load GCC/6.2.0-2.27 |
| ml -GCC/6.2.0-2.27 | module unload GCC/6.2.0-2.27 |
| ml purge | module unload all modules |
| ml av | module avail |
| ml show GCC/6.2.0-2.27 | module show GCC |
| ml spider | gcc searches (case-insensitive) for gcc in all available modules |
| ml spider GCC/6.2.0-2.27 | show all information about the module GCC/6.2.0-2.27 |
| ml save mycollection | stores the currently loaded modules to a collection |
| ml restore mycollection | restores a previously stored collection of modules |
## Listing Loaded Modules
To get an overview of the currently loaded modules, use module list or ml (without specifying extra arguments).
```console
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S) 2) lmod/7.2.2
Where:
S: Module is Sticky, requires --force to unload or purge
```
!!! tip
For more details on sticky modules, see the section on [ml purge](#resetting-by-unloading-all-modules).
## Searching for Available Modules
To get an overview of all available modules, you can use ml avail or simply ml av:
```console
$ ml av
---------------------------------------- /apps/modules/compiler ----------------------------------------------
GCC/5.2.0 GCCcore/6.2.0 (D) icc/2013.5.192 ifort/2013.5.192 LLVM/3.9.0-intel-2017.00 (D)
... ...
---------------------------------------- /apps/modules/devel -------------------------------------------------
Autoconf/2.69-foss-2015g CMake/3.0.0-intel-2016.01 M4/1.4.17-intel-2016.01 pkg-config/0.27.1-foss-2015g
Autoconf/2.69-foss-2016a CMake/3.3.1-foss-2015g M4/1.4.17-intel-2017.00 pkg-config/0.27.1-intel-2015b
... ...
```
In the current module naming scheme, each module name consists of two parts:
* the part before the first /, corresponding to the software name
* the remainder, corresponding to the software version, the compiler toolchain that was used to install the software, and a possible version suffix
!!! tip
The (D) indicates that this particular version of the module is the default, but we strongly recommend to not rely on this as the default can change at any point. Usuall, the default will point to the latest version available.
## Searching for Modules
If you just provide a software name, for example gcc, it prints on overview of all available modules for GCC.
```console
$ ml spider gcc
---------------------------------------------------------------------------------
GCC:
---------------------------------------------------------------------------------
Description:
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...). - Homepage: http://gcc.gnu.org/
Versions:
GCC/4.4.7-system
GCC/4.7.4
GCC/4.8.3
GCC/4.9.2-binutils-2.25
GCC/4.9.2
GCC/4.9.3-binutils-2.25
GCC/4.9.3
GCC/4.9.3-2.25
GCC/5.1.0-binutils-2.25
GCC/5.2.0
GCC/5.3.0-binutils-2.25
GCC/5.3.0-2.25
GCC/5.3.0-2.26
GCC/5.3.1-snapshot-20160419-2.25
GCC/5.4.0-2.26
GCC/6.2.0-2.27
Other possible modules matches:
GCCcore
---------------------------------------------------------------------------------
To find other possible module matches do:
module -r spider '.*GCC.*'
---------------------------------------------------------------------------------
For detailed information about a specific "GCC" module (including how to load the modules) use the module's full name.
For example:
$ module spider GCC/6.2.0-2.27
---------------------------------------------------------------------------------
```
!!! tip
Spider is case-insensitive.
If you use spider on a full module name like GCC/6.2.0-2.27 it will tell on which cluster(s) that module available:
```console
$ module spider GCC/6.2.0-2.27
--------------------------------------------------------------------------------------------------------------
GCC: GCC/6.2.0-2.27
--------------------------------------------------------------------------------------------------------------
Description:
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...). - Homepage: http://gcc.gnu.org/
This module can be loaded directly: module load GCC/6.2.0-2.27
Help:
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada,
as well as libraries for these languages (libstdc++, libgcj,...). - Homepage: http://gcc.gnu.org/
```
This tells you what the module contains and a URL to the homepage of the software.
## Available Modules for a Particular Software Package
To check which modules are available for a particular software package, you can provide the software name to ml av.
For example, to check which versions of git are available:
```console
$ ml av git
-------------------------------------- /apps/modules/tools ----------------------------------------
git/2.8.0-GNU-4.9.3-2.25 git/2.8.0-intel-2017.00 git/2.9.0 git/2.9.2 git/2.11.0 (D)
Where:
D: Default Module
Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
```
!!! tip
The specified software name is treated case-insensitively.
Lmod does a partial match on the module name, so sometimes you need to use / to indicate the end of the software name you are interested in:
```console
$ ml av GCC/
------------------------------------------ /apps/modules/compiler -------------------------------------------
GCC/4.4.7-system GCC/4.8.3 GCC/4.9.2 GCC/4.9.3 GCC/5.1.0-binutils-2.25 GCC/5.3.0-binutils-2.25 GCC/5.3.0-2.26 GCC/5.4.0-2.26 GCC/4.7.4 GCC/4.9.2-binutils-2.25 GCC/4.9.3-binutils-2.25 GCC/4.9.3-2.25 GCC/5.2.0 GCC/5.3.0-2.25 GCC/6.2.0-2.27 (D)
Where:
D: Default Module
Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
```
## Inspecting a Module
To see how a module would change the environment, use ml show:
```console
$ ml show Python/3.5.2
help([[Python is a programming language that lets you work more quickly and integrate your systems more effectively. - Homepage: http://python.org/]])
whatis("Description: Python is a programming language that lets you work more quickly and integrate your systems more effectively. - Homepage: http://python.org/")
conflict("Python")
load("bzip2/1.0.6")
load("zlib/1.2.8")
load("libreadline/6.3")
load("ncurses/5.9")
load("SQLite/3.8.8.1")
load("Tk/8.6.3")
load("GMP/6.0.0a")
load("XZ/5.2.2")
prepend_path("CPATH","/apps/all/Python/3.5.2/include")
prepend_path("LD_LIBRARY_PATH","/apps/all/Python/3.5.2/lib")
prepend_path("LIBRARY_PATH","/apps/all/Python/3.5.2/lib")
prepend_path("MANPATH","/apps/all/Python/3.5.2/share/man")
prepend_path("PATH","/apps/all/Python/3.5.2/bin")
prepend_path("PKG_CONFIG_PATH","/apps/all/Python/3.5.2/lib/pkgconfig")
setenv("EBROOTPYTHON","/apps/all/Python/3.5.2")
setenv("EBVERSIONPYTHON","3.5.2")
setenv("EBDEVELPYTHON","/apps/all/Python/3.5.2/easybuild/Python-3.5.2-easybuild-devel")
setenv("EBEXTSLISTPYTHON","setuptools-20.1.1,pip-8.0.2,nose-1.3.7")
```
!!! tip
Note that both the direct changes to the environment as well as other modules that will be loaded are shown.
If you're not sure what all of this means: don't worry, you don't have to know, just try loading the module as try using the software.
## Loading Modules
The effectively apply the changes to the environment that are specified by a module, use ml and specify the name of the module.
For example, to set up your environment to use intel:
```console
$ ml intel/2017.00
$ ml
Currently Loaded Modules:
1) GCCcore/5.4.0
2) binutils/2.26-GCCcore-5.4.0 (H)
3) icc/2017.0.098-GCC-5.4.0-2.26
4) ifort/2017.0.098-GCC-5.4.0-2.26
5) iccifort/2017.0.098-GCC-5.4.0-2.26
6) impi/2017.0.098-iccifort-2017.0.098-GCC-5.4.0-2.26
7) iimpi/2017.00-GCC-5.4.0-2.26
8) imkl/2017.0.098-iimpi-2017.00-GCC-5.4.0-2.26
9) intel/2017.00
Where:
H: Hidden Module
```
!!! tip
Note that even though we only loaded a single module, the output of ml shows that a whole bunch of modules were loaded, which are required dependencies for intel/2017.00.
## Conflicting Modules
!!! warning
It is important to note that **only modules that are compatible with each other can be loaded together. In particular, modules must be installed either with the same toolchain as the modules that** are already loaded, or with a compatible (sub)toolchain.
For example, once you have loaded one or more modules that were installed with the intel/2017.00 toolchain, all other modules that you load should have been installed with the same toolchain.
In addition, only **one single version** of each software package can be loaded at a particular time. For example, once you have the Python/3.5.2-intel-2017.00 module loaded, you can not load a different version of Python in the same session/job script, neither directly, nor indirectly as a dependency of another module you want to load.
## Unloading Modules
To revert the changes to the environment that were made by a particular module, you can use ml -<modname>.
For example:
```console
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S) 2) lmod/7.2.2
$ which gcc
/usr/bin/gcc
$ ml GCC/
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S) 2) lmod/7.2.2 3) GCCcore/6.2.0 4) binutils/2.27-GCCcore-6.2.0 (H) 5) GCC/6.2.0-2.27
$ which gcc
/apps/all/GCCcore/6.2.0/bin/gcc
$ ml -GCC
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S) 2) lmod/7.2.2 3) GCCcore/6.2.0 4) binutils/2.27-GCCcore-6.2.0 (H)
$ which gcc
/usr/bin/gcc
```
## Resetting by Unloading All Modules
To reset your environment back to a clean state, you can use ml purge or ml purge --force:
```console
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S) 2) lmod/7.2.2 3) GCCcore/6.2.0 4) binutils/2.27-GCCcore-6.2.0 (H)
$ ml purge
The following modules were not unloaded:
(Use "module --force purge" to unload all):
1) EasyBuild/3.0.0
$ ml
Currently Loaded Modules:
1) EasyBuild/3.0.0 (S)
$ ml purge --force
$ ml
No modules loaded
```
As such, you should not (re)load the cluster module anymore after running ml purge.
## Module Collections
If you have a set of modules that you need to load often, you can save these in a collection (only works with Lmod).
First, load all the modules you need, for example:
```console
$ ml intel/2017.00 Python/3.5.2-intel-2017.00
```
Now store them in a collection using ml save:
```console
$ ml save my-collection
```
Later, for example in a job script, you can reload all these modules with ml restore:
```console
$ ml restore my-collection
```
With ml savelist can you gets a list of all saved collections:
```console
$ ml savelist
Named collection list:
1) my-collection
2) my-test-collection
```
To inspect a collection, use ml describe.
To remove a module collection, remove the corresponding entry in $HOME/.lmod.d.
# GPI-2
## Introduction
Programming Next Generation Supercomputers: GPI-2 is an API library for asynchronous interprocess, cross-node communication. It provides a flexible, scalable and fault tolerant interface for parallel applications.
The GPI-2 library ([www.gpi-site.com/gpi2/](http://www.gpi-site.com/gpi2/)) implements the GASPI specification (Global Address Space Programming Interface, [www.gaspi.de](http://www.gaspi.de/en/project.html)). GASPI is a Partitioned Global Address Space (PGAS) API. It aims at scalable, flexible and failure tolerant computing in massively parallel environments.
## Modules
The GPI-2, version 1.0.2 is available on Anselm via module gpi2:
```console
$ ml gpi2
$ ml av GPI-2 # Salomon
```
The module sets up environment variables, required for linking and running GPI-2 enabled applications. This particular command loads the default module, which is gpi2/1.0.2
## Linking
!!! note
Link with -lGPI2 -libverbs
Load the gpi2 module. Link using **-lGPI2** and **-libverbs** switches to link your code against GPI-2. The GPI-2 requires the OFED infinband communication library ibverbs.
### Compiling and Linking With Intel Compilers
```console
$ ml intel
$ ml gpi2
$ icc myprog.c -o myprog.x -Wl,-rpath=$LIBRARY_PATH -lGPI2 -libverbs
```
### Compiling and Linking With GNU Compilers
```console
$ ml gcc
$ ml gpi2
$ gcc myprog.c -o myprog.x -Wl,-rpath=$LIBRARY_PATH -lGPI2 -libverbs
```
## Running the GPI-2 Codes
!!! note
gaspi_run starts the GPI-2 application
The gaspi_run utility is used to start and run GPI-2 applications:
```console
$ gaspi_run -m machinefile ./myprog.x
```
A machine file (** machinefile **) with the hostnames of nodes where the application will run, must be provided. The machinefile lists all nodes on which to run, one entry per node per process. This file may be hand created or obtained from standard $PBS_NODEFILE:
```console
$ cut -f1 -d"." $PBS_NODEFILE > machinefile
```
machinefile:
```console
cn79
cn80
```
This machinefile will run 2 GPI-2 processes, one on node cn79 other on node cn80.
machinefle:
```console
cn79
cn79
cn80
cn80
```
This machinefile will run 4 GPI-2 processes, 2 on node cn79 o 2 on node cn80.
!!! note
Use the **mpiprocs**to control how many GPI-2 processes will run per node
Example:
```console
$ qsub -A OPEN-0-0 -q qexp -l select=2:ncpus=16:mpiprocs=16 -I
```
This example will produce $PBS_NODEFILE with 16 entries per node.
### Gaspi_logger
!!! note
gaspi_logger views the output form GPI-2 application ranks
The gaspi_logger utility is used to view the output from all nodes except the master node (rank 0). The gaspi_logger is started, on another session, on the master node - the node where the gaspi_run is executed. The output of the application, when called with gaspi_printf(), will be redirected to the gaspi_logger. Other I/O routines (e.g. printf) will not.
## Example
Following is an example GPI-2 enabled code:
```cpp
#include <GASPI.h>
#include <stdlib.h>
void success_or_exit ( const char* file, const int line, const int ec)
{
if (ec != GASPI_SUCCESS)
{
gaspi_printf ("Assertion failed in %s[%i]:%dn", file, line, ec);
exit (1);
}
}
#define ASSERT(ec) success_or_exit (__FILE__, __LINE__, ec);
int main(int argc, char *argv[])
{
gaspi_rank_t rank, num;
gaspi_return_t ret;
/* Initialize GPI-2 */
ASSERT( gaspi_proc_init(GASPI_BLOCK) );
/* Get ranks information */
ASSERT( gaspi_proc_rank(&rank) );
ASSERT( gaspi_proc_num(&num) );
gaspi_printf("Hello from rank %d of %dn",
rank, num);
/* Terminate */
ASSERT( gaspi_proc_term(GASPI_BLOCK) );
return 0;
}
```
Load modules and compile:
```console
$ ml gcc gpi2
$ gcc helloworld_gpi.c -o helloworld_gpi.x -Wl,-rpath=$LIBRARY_PATH -lGPI2 -libverbs
```
Submit the job and run the GPI-2 application
```console
$ qsub -q qexp -l select=2:ncpus=1:mpiprocs=1,place=scatter,walltime=00:05:00 -I
qsub: waiting for job 171247.dm2 to start
qsub: job 171247.dm2 ready
cn79 $ ml gpi2
cn79 $ cut -f1 -d"." $PBS_NODEFILE > machinefile
cn79 $ gaspi_run -m machinefile ./helloworld_gpi.x
Hello from rank 0 of 2
```
At the same time, in another session, you may start the gaspi logger:
```console
$ ssh cn79
cn79 $ gaspi_logger
GASPI Logger (v1.1)
[cn80:0] Hello from rank 1 of 2
```
In this example, we compile the helloworld_gpi.c code using the **gnu compiler**(gcc) and link it to the GPI-2 and ibverbs library. The library search path is compiled in. For execution, we use the qexp queue, 2 nodes 1 core each. The GPI module must be loaded on the master compute node (in this example the cn79), gaspi_logger is used from different session to view the output of the second process.
# OpenFOAM
a Free, Open Source CFD Software Package
## Introduction
OpenFOAM is a free, open source CFD software package developed by [**OpenCFD Ltd**](http://www.openfoam.com/about) at [**ESI Group**](http://www.esi-group.com/) and distributed by the [**OpenFOAM Foundation **](http://www.openfoam.org/). It has a large user base across most areas of engineering and science, from both commercial and academic organisations.
Homepage: <http://www.openfoam.com/>
### Installed Version
Currently, several version compiled by GCC/ICC compilers in single/double precision with several version of openmpi are available on Anselm.
For example syntax of available OpenFOAM module is:
\<openfoam\/2.2.1-icc-openmpi1.6.5-DP\>
this means openfoam version 2.2.1 compiled by ICC compiler with openmpi1.6.5 in double precision.
Naming convection of the installed versions is following:
openfoam\<VERSION\>-\<COMPILER\>\<openmpiVERSION\>-\<PRECISION\>
* \<VERSION\> - version of openfoam
* \<COMPILER\> - version of used compiler
* \<openmpiVERSION\> - version of used openmpi/impi
* \<PRECISION\> - DP/SP – double/single precision
### Available OpenFOAM Modules
To check available modules use
```console
$ ml av
```
In /opt/modules/modulefiles/engineering you can see installed engineering softwares:
```console
------------------------------------ /opt/modules/modulefiles/engineering -------------------------------------------------------------
ansys/14.5.x matlab/R2013a-COM openfoam/2.2.1-icc-impi4.1.1.036-DP
comsol/43b-COM matlab/R2013a-EDU openfoam/2.2.1-icc-openmpi1.6.5-DP
comsol/43b-EDU openfoam/2.2.1-gcc481-openmpi1.6.5-DP paraview/4.0.1-gcc481-bullxmpi1.2.4.1-osmesa10.0
lsdyna/7.x.x openfoam/2.2.1-gcc481-openmpi1.6.5-SP
```
For information how to use modules please [look here](../anselm/environment-and-modules/).
## Getting Started
To create OpenFOAM environment on ANSELM give the commands:
```console
$ ml openfoam/2.2.1-icc-openmpi1.6.5-DP
$ source $FOAM_BASHRC
```
!!! note
Please load correct module with your requirements “compiler - GCC/ICC, precision - DP/SP”.
Create a project directory within the $HOME/OpenFOAM directory named \<USER\>-\<OFversion\> and create a directory named run within it, e.g. by typing:
```console
$ mkdir -p $FOAM_RUN
```
Project directory is now available by typing:
```console
$ cd /home/<USER>/OpenFOAM/<USER>-<OFversion>/run
```
\<OFversion\> - for example \<2.2.1\>
or
```console
$ cd $FOAM_RUN
```
Copy the tutorial examples directory in the OpenFOAM distribution to the run directory:
```console
$ cp -r $FOAM_TUTORIALS $FOAM_RUN
```
Now you can run the first case for example incompressible laminar flow in a cavity.
## Running Serial Applications
Create a Bash script test.sh
```bash
#!/bin/bash
module load openfoam/2.2.1-icc-openmpi1.6.5-DP
source $FOAM_BASHRC
# source to run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
runApplication blockMesh
runApplication icoFoam
```
Job submission (example for Anselm):
```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=16,walltime=03:00:00 test.sh
```
For information about job submission please [look here](../anselm/job-submission-and-execution/).
## Running Applications in Parallel
Run the second case for example external incompressible turbulent flow - case - motorBike.
First we must run serial application bockMesh and decomposePar for preparation of parallel computation.
!!! note
Create a Bash scrip test.sh:
```bash
#!/bin/bash
module load openfoam/2.2.1-icc-openmpi1.6.5-DP
source $FOAM_BASHRC
# source to run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike
runApplication blockMesh
runApplication decomposePar
```
Job submission
```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=16,walltime=03:00:00 test.sh
```
This job create simple block mesh and domain decomposition. Check your decomposition, and submit parallel computation:
!!! note
Create a PBS script testParallel.pbs:
```bash
#!/bin/bash
#PBS -N motorBike
#PBS -l select=2:ncpus=16
#PBS -l walltime=01:00:00
#PBS -q qprod
#PBS -A OPEN-0-0
module load openfoam/2.2.1-icc-openmpi1.6.5-DP
source $FOAM_BASHRC
cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike
nproc = 32
mpirun -hostfile ${PBS_NODEFILE} -np $nproc snappyHexMesh -overwrite -parallel | tee snappyHexMesh.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc potentialFoam -noFunctionObject-writep -parallel | tee potentialFoam.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoam.log
```
nproc – number of subdomains
Job submission
```console
$ qsub testParallel.pbs
```
## Compile Your Own Solver
Initialize OpenFOAM environment before compiling your solver
```console
$ ml openfoam/2.2.1-icc-openmpi1.6.5-DP
$ source $FOAM_BASHRC
$ cd $FOAM_RUN/
```
Create directory applications/solvers in user directory
```console
$ mkdir -p applications/solvers
$ cd applications/solvers
```
Copy icoFoam solver’s source files
```console
$ cp -r $FOAM_SOLVERS/incompressible/icoFoam/ My_icoFoam
$ cd My_icoFoam
```
Rename icoFoam.C to My_icoFOAM.C
```console
$ mv icoFoam.C My_icoFoam.C
```
Edit _files_ file in _Make_ directory:
```bash
icoFoam.C
EXE = $(FOAM_APPBIN)/icoFoam
```
and change to:
```bash
My_icoFoam.C
EXE = $(FOAM_USER_APPBIN)/My_icoFoam
```
In directory My_icoFoam give the compilation command:
```console
$ wmake
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment