1"use strict";(self.webpackChunksupportkc_new=self.webpackChunksupportkc_new||[]).push([[412],{3905:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>h});var l=a(67294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(e,t){if(null==e)return{};var a,l,n=function(e,t){if(null==e)return{};var a,l,n={},o=Object.keys(e);for(l=0;l<o.length;l++)a=o[l],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(l=0;l<o.length;l++)a=o[l],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=l.createContext({}),p=function(e){var t=l.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},m=function(e){var t=p(e.components);return l.createElement(s.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return l.createElement(l.Fragment,{},t)}},d=l.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,m=i(e,["components","mdxType","originalType","parentName"]),u=p(a),d=n,h=u["".concat(s,".").concat(d)]||u[d]||c[d]||o;return a?l.createElement(h,r(r({ref:t},m),{},{components:a})):l.createElement(h,r({ref:t},m))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,r=new Array(o);r[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[u]="string"==typeof e?e:n,r[1]=i;for(var p=2;p<o;p++)r[p]=a[p];return l.createElement.apply(null,r)}return l.createElement.apply(null,a)}d.displayName="MDXCreateElement"},66028:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>r,default:()=>c,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var l=a(87462),n=(a(67294),a(3905));const o={sidebar_position:5},r="Software Environment",i={unversionedId:"Nord4/environment",id:"Nord4/environment",title:"Software Environment",description:"All software and numerical libraries available at the cluster can be found at /apps/. If you need something that is not there please",source:"@site/docs/Nord4/environment.md",sourceDirName:"Nord4",slug:"/Nord4/environment",permalink:"/supportkc/docs/Nord4/environment",draft:!1,tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Running Jobs",permalink:"/supportkc/docs/Nord4/slurm"},next:{title:"Installing packages",permalink:"/supportkc/docs/Nord4/Installing packages/install_pkgs_menu"}},s={},p=[{value:"Compilation for the architecture",id:"compilation-for-the-architecture",level:2},{value:"Intel Compilers",id:"intel-compilers",level:3},{value:"Intel Compiler Licences",id:"intel-compiler-licences",level:2},{value:"GCC",id:"gcc",level:3},{value:"C Compilers",id:"c-compilers",level:2},{value:"Default datatype sizes on the machine",id:"default-datatype-sizes-on-the-machine",level:3},{value:"Distributed Memory Parallelism",id:"distributed-memory-parallelism",level:3},{value:"Shared Memory Parallelism",id:"shared-memory-parallelism",level:3},{value:"Automatic Parallelization",id:"automatic-parallelization",level:3},{value:"FORTRAN Compilers",id:"fortran-compilers",level:2},{value:"Distributed Memory Parallelism",id:"distributed-memory-parallelism-1",level:3},{value:"Shared Memory Parallelism",id:"shared-memory-parallelism-1",level:3},{value:"Automatic Parallelization",id:"automatic-parallelization-1",level:3},{value:"Modules Environment",id:"modules-environment",level:2},{value:"Modules tool usage",id:"modules-tool-usage",level:3},{value:"Module custom stack size",id:"module-custom-stack-size",level:3}],m={toc:p},u="wrapper";
1function c(e){let{components:t,...a}=e;return(0,n.kt)(u,(0,l.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"software-environment"},"Software Environment"),(0,n.kt)("p",null,"All software and numerical libraries available at the cluster can be found at /apps/. If you need something that is not there please\n",(0,n.kt)("a",{parentName:"p",href:"/FAQ#howwhen-may-i-contact-support-team"},"contact us")," to get it installed."),(0,n.kt)("h2",{id:"compilation-for-the-architecture"},"Compilation for the architecture"),(0,n.kt)("p",null,"To generate code that is optimized for the target architecture and the supported features such as SSE, MMX, AVX instruction sets you will have to use the corresponding compile flags.\nFor compilations of MPI applications an MPI installation needs to be loaded in your session as well. For example Intel MPI via ",(0,n.kt)("em",{parentName:"p"},"module load impi/2017.4")),(0,n.kt)("h3",{id:"intel-compilers"},"Intel Compilers"),(0,n.kt)("p",null,"The latest Intel compilers provide the best possible optimizations for the Xeon Platinum architecture. By default, when starting a new session on the system the basic modules for the Intel suite will be automatically loaded. That is the compilers (intel/2017.4), the Intel MPI software stack (impi/2017.4) and the math kernel libraries MKL (mkl/2017.4) in their latest versions. We highly recommend linking against MKL where supported to achieve the best performance results."),(0,n.kt)("p",null,"To separately load the Intel compilers, please use:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"module load intel/2017.4\n")),(0,n.kt)("p",null,"The corresponding optimization flags for icc are ",(0,n.kt)("strong",{parentName:"p"},'CFLAGS="-xCORE-AVX512 -mtune=skylake"'),". As the login nodes are of the exact same architecture as the compute node you can also use the flag ",(0,n.kt)("strong",{parentName:"p"},"-xHost")," which enables all possible optimizations available on the compile host."),(0,n.kt)("h2",{id:"intel-compiler-licences"},"Intel Compiler Licences"),(0,n.kt)("p",null,"For reasons of licensing we recommend compiling using either login1 or the partition ",(0,n.kt)("em",{parentName:"p"},"interactive"),". We currently have node locked licences installed that allow unlimited compilations in the machines login1 and the ones available via the queue interactive (logins 4 and 5). To compile in the rest of the compute and login nodes we have a limited amount of floating licences available. Should all of them be in use when trying to compile, you will experience a delay when the compiler starts and tries to checkout a licence."),(0,n.kt)("p",null,"In this case an error message like the one below will appear. In this case please switch to Login 1, Login 4 or Login 5 to compile without limitations and licencing issues."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"ifort: error #10052: could not checkout FLEXlm license\n\nError: A license for Comp-CL is not available (-9,57).\n\nLicense file(s) used were (in this order):\n** 1. Trusted Storage\n** 2. /gpfs/apps/MN4/INTEL/2017.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/../../Licenses\n** 3. /home/bsc18/bsc1888//Licenses\n** 4. /opt/intel/licenses\n** 5. /Users/Shared/Library/Application Support/Intel/Licenses\n** 6. /gpfs/apps/MN4/INTEL/2017.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/license.lic\n** 7. /gpfs/apps/MN4/INTEL/2017.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/login1_COM_L___1.lic\n** 8. /gpfs/apps/MN4/INTEL/2017.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/login4_COM_L___1.lic\n** 9. /gpfs/apps/MN4/INTEL/2017.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/login5_COM_L___1.lic\nPlease refer http://software.intel.com/sites/support/ for more information..\n")),(0,n.kt)("h3",{id:"gcc"},"GCC"),(0,n.kt)("p",null,"The GCC provided by the system is version 4.8.5. For better support of new and old hardware features we have different versions that can be loaded via the provided modules.\nFor example in Nord4 you can find GCC 9.2.0"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"module load gcc/9.2.0\n")),(0,n.kt)("p",null,"The corresponding flags are ",(0,n.kt)("strong",{parentName:"p"},'CFLAGS="-march=skylake-avx512"')),(0,n.kt)("h2",{id:"c-compilers"},"C Compilers"),(0,n.kt)("p",null,"In the cluster you can find these C/C++ compilers :"),(0,n.kt)("p",null,"icc / icpc -> Intel C/C++ Compilers "),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"man icc\nman icpc\n")),(0,n.kt)("admonition",{type:"note"},(0,n.kt)("p",{parentName:"admonition"},"In case you are planning on using Intel compilers, we ",(0,n.kt)("strong",{parentName:"p"},"strongly"),' recommend using the ones from our "intel" modules with a version higher than 2017.4.')),(0,n.kt)("p",null,"gcc /g++ -> GNU Compilers for C/C++"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"man gcc\nman g++\n")),(0,n.kt)("p",null,"All invocations of the C or C++ compilers follow these suffix conventions for input files:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre"},".C, .cc, .cpp, or .cxx -> C++ source file.\n.c -> C source file\n.i -> preprocessed C source file\n.so -> shared object file\n.o -> object file for ld command\n.s -> assembler source file\n")),(0,n.kt)("p",null,"By default, the preprocessor is run on both C and C++ source files."),(0,n.kt)("p",null,"These are the default sizes of the standard C/C++ datatypes on the machine"),(0,n.kt)("h3",{id:"default-datatype-sizes-on-the-machine"},"Default datatype sizes on the machine"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Type"),(0,n.kt)("th",{parentName:"tr",align:null},"Length (bytes)"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"bool (c++ only)"),(0,n.kt)("td",{parentName:"tr",align:null},"1")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"char"),(0,n.kt)("td",{parentName:"tr",align:null},"1")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"wchar","_","t"),(0,n.kt)("td",{parentName:"tr",align:null},"4")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"short"),(0,n.kt)("td",{parentName:"tr",align:null},"2")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null}
1,"int"),(0,n.kt)("td",{parentName:"tr",align:null},"4")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"long"),(0,n.kt)("td",{parentName:"tr",align:null},"8")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"float"),(0,n.kt)("td",{parentName:"tr",align:null},"4")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"double"),(0,n.kt)("td",{parentName:"tr",align:null},"8")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"long double"),(0,n.kt)("td",{parentName:"tr",align:null},"16")))),(0,n.kt)("h3",{id:"distributed-memory-parallelism"},"Distributed Memory Parallelism"),(0,n.kt)("p",null,"To compile MPI programs it is recommended to use the following handy wrappers: mpicc, mpicxx for C and C++ source code. You need to choose the Parallel environment first: module load openmpi / module load impi / module load poe. These wrappers will include all the necessary libraries to build MPI applications without having to specify all the details by hand."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"mpicc a.c -o a.exe\nmpicxx a.C -o a.exe \n")),(0,n.kt)("h3",{id:"shared-memory-parallelism"},"Shared Memory Parallelism"),(0,n.kt)("p",null,(0,n.kt)("em",{parentName:"p"},"OpenMP")," directives are fully supported by the Intel C and C++ compilers. To use it, the flag -qopenmp must be added to the compile line."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"icc -qopenmp -o exename filename.c\nicpc -qopenmp -o exename filename.C\n")),(0,n.kt)("p",null,"You can also mix MPI + OPENMP code using -openmp with the mpi wrappers mentioned above."),(0,n.kt)("h3",{id:"automatic-parallelization"},"Automatic Parallelization"),(0,n.kt)("p",null,'The Intel C and C++ compilers are able to automatically parallelize\nsimple loop constructs, using the option "-parallel" :'),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"icc -parallel a.c\n")),(0,n.kt)("h2",{id:"fortran-compilers"},"FORTRAN Compilers"),(0,n.kt)("p",null,"In the cluster you can find these compilers :"),(0,n.kt)("p",null,"ifort -> Intel Fortran Compilers "),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"man ifort\n")),(0,n.kt)("p",null,"gfortran -> GNU Compilers for FORTRAN"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"man gfortran\n")),(0,n.kt)("p",null,'By default, the compilers expect all FORTRAN source files to have\nthe extension ".f", and all FORTRAN source files that require\npreprocessing to have the extension ".F". The same applies to FORTRAN 90 source files with extensions ".f90" and ".F90".'),(0,n.kt)("h3",{id:"distributed-memory-parallelism-1"},"Distributed Memory Parallelism"),(0,n.kt)("p",null,"In order to use MPI, again you can use the wrappers mpif77 or mpif90 depending on the source code type. You can always man mpif77 to see a detailed list of options to configure the wrappers, ie: change the default compiler."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"mpif77 a.f -o a.exe\n")),(0,n.kt)("h3",{id:"shared-memory-parallelism-1"},"Shared Memory Parallelism"),(0,n.kt)("p",null,'OpenMP directives are fully supported by the Intel Fortran compiler when the option "-qopenmp" is set:'),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"ifort -qopenmp \n")),(0,n.kt)("h3",{id:"automatic-parallelization-1"},"Automatic Parallelization"),(0,n.kt)("p",null,'The Intel Fortran compiler will attempt to automatically\nparallelize simple loop constructs using the option "-parallel":'),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"ifort -parallel\n")),(0,n.kt)("h2",{id:"modules-environment"},"Modules Environment"),(0,n.kt)("p",null,"The Environment Modules package (",(0,n.kt)("a",{parentName:"p",href:"http://modules.sourceforge.net/"},"http://modules.sourceforge.net/"),") provides a dynamic modification of a user's environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application or a compilation. Modules can be loaded and unloaded dynamically, in a clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl."),(0,n.kt)("p",null,"Installed software packages are divided into five categories: "),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Environment: modulefiles dedicated to prepare the environment, for example, get all necessary variables to use openmpi to compile or run programs"),(0,n.kt)("li",{parentName:"ul"},"Tools: useful tools which can be used at any time (php, perl, ...)"),(0,n.kt)("li",{parentName:"ul"},"Applications: High Performance Computers programs (GROMACS, ...)"),(0,n.kt)("li",{parentName:"ul"},"Libraries: Those are tipycally loaded at a compilation time, they load into the environment the correct compiler and linker flags (FFTW, LAPACK, ...)"),(0,n.kt)("li",{parentName:"ul"},"Compilers: Compiler suites available for the system (intel, gcc, ...)")),(0,n.kt)("h3",{id:"modules-tool-usage"},"Modules tool usage"),(0,n.kt)("p",null,"Modules can be invoked in two ways: by name alone or by name and version. Invoking them by name implies loading the default module version. This is usually the most recent version that has been tested to be stable (recommended) or the only version available. "),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"module load intel\n")),(0,n.kt)("p",null,"Invoking by version loads the version specified of the application. As of this writing, the previous command and the following one load the same module."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"module load intel/2017.4\n")),(0,n.kt)("p",null,"The most important commands for modules are these:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module list")," shows all the loaded modules"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module avail")," shows all the modules the user is able to load"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module purge")," removes all the loaded modules"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module load \\<modulename",">")," loads the necessary environment variables for the selected modulefile (PATH, MANPATH, LD","_","LIBRARY","_","PATH...)"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module unload \\<modulename",">")," removes all environment changes made by module load command"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("em",{parentName:"li"},"module switch \\<oldmodule",">"," \\<newmodule",">")," unloads the first module (oldmodule) and loads the second module (newmodule)")),(0,n.kt)("p",null,'You can run "module help" any time to check the command\'s usage and options or check the module(1) manpage for further information.'),
1(0,n.kt)("h3",{id:"module-custom-stack-size"},"Module custom stack size"),(0,n.kt)("p",null,"The stack size is 2GB by default, but there are modules that can change that value when they are loaded. That's to prevent errors that would happen otherwise (for example, while using python threads). Here's a list of the affected modules:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"python/3-intel-2018.2 (64 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/2-intel-2018.2 (64 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/2.7.13 (10 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/2.7.13_ML (64 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/2.7.14 (10 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/3.6.1 (10 MB) "),(0,n.kt)("li",{parentName:"ul"},"python/3.6.4_ML (64 MB) "),(0,n.kt)("li",{parentName:"ul"},"paraview/5.4.0 (64 MB)"),(0,n.kt)("li",{parentName:"ul"},"paraview/5.5.2 (64 MB)"),(0,n.kt)("li",{parentName:"ul"},"vmd/1.9.3 (64 MB)"),(0,n.kt)("li",{parentName:"ul"},"vmd/1.9.3-python (64 MB)"),(0,n.kt)("li",{parentName:"ul"},"igv/2.3.94 (64 MB)")),(0,n.kt)("p",null,"You can check your stack size at any time using the command:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"ulimit -s\n")),(0,n.kt)("p",null,"If by any chance this stack size doesn't fit your needs, you can add to your job script a command to have a custom set value after the module load commands. This way, you can have an appropiate stack size while using the compute nodes:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"ulimit -Ss <new_size_in_KB>\n")))}c.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.