abstract:caviness:app_dev:prog_env

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
abstract:caviness:app_dev:prog_env [2018-07-09 16:43] – external edit 127.0.0.1abstract:caviness:app_dev:prog_env [2022-08-30 10:16] (current) – [Introduction] anita
Line 20: Line 20:
  ===== Compiling code =====  ===== Compiling code =====
 <note important> <note important>
-Fortran, C and C++ programs can only be compiled on the login node. Java and Matlab (.m) programs may only be compiled on the compute nodes. **//All resulting executables should only be run on the compute nodes.//**+Fortran, CC++Java and Matlab programs should be compiled on the login node, however if lengthy compiles are required or you want to schedule a job for compilation, you must use the ''devel'' partition with ''salloc'' or ''sbatch'' to make sure you are allocated a compute node with the development tools, libraries, etc. which are needed for compilers. **//All resulting executables should only be run on the compute nodes.//**
 </note> </note>
  
Line 128: Line 128:
  
 <code bash> <code bash>
-vpkg_reguire openmpi/1.4.4-pgi+vpkg_require openmpi/1.4.4-pgi
 mpif90 -fpic fdriver.f90 -o driver mpif90 -fpic fdriver.f90 -o driver
 </code> </code>
Line 134: Line 134:
 == C example: == == C example: ==
 <code bash> <code bash>
-vpkg_reguire openmpi/1.4.4-pgi+vpkg_require openmpi/1.4.4-pgi
 mpicc -fpic cdriver.c -o driver mpicc -fpic cdriver.c -o driver
 </code> </code>
Line 167: Line 167:
 == Commercial libraries == == Commercial libraries ==
  
-  * [[http://developer.amd.com/libraries/acml/pages/default.aspx|ACML]]: AMD's Core Math Library (See [[http://developer.amd.com/libraries/acml/onlinehelp/Documents/BestLibrary.html#BestLibrary|AMD'guide on library selection]].)+  * [[https://developer.amd.com/amd-aocl/|AOCL]]: AMD Optimizing CPU Libraries (See [[https://developer.amd.com/wp-content/resources/57404_User_Guide_AMD_AOCL_v3.2_GA.pdf|AMD'AOCL User Guide]].) AOCL is the successor to ACML.
   * [[http://www.roguewave.com/products/imsl|IMSL]]: RogueWave's mathematical and statistical libraries   * [[http://www.roguewave.com/products/imsl|IMSL]]: RogueWave's mathematical and statistical libraries
   * [[http://software.intel.com/en-us/articles/intel-mkl/?utm_source=google&utm_medium=cpc&utm_term=intel_mkl&utm_content=dpd_us_hpc_mkl& utm_campaign=DIV_US_DPD_%28S%29|MKL]]: Intel's Math Kernel Library   * [[http://software.intel.com/en-us/articles/intel-mkl/?utm_source=google&utm_medium=cpc&utm_term=intel_mkl&utm_content=dpd_us_hpc_mkl& utm_campaign=DIV_US_DPD_%28S%29|MKL]]: Intel's Math Kernel Library
Line 181: Line 181:
  
 Joint use of VALET and these environment variables will also prepare your UNIX environment to support your use of **make** for program development. VALET will accommodate using one or several libraries, and you can extend its functionality for software you develop or install. Joint use of VALET and these environment variables will also prepare your UNIX environment to support your use of **make** for program development. VALET will accommodate using one or several libraries, and you can extend its functionality for software you develop or install.
 +
 +==== Intel compiler suite ====
 +
 +You should use Intel MKL — it's a highly-optimized BLAS/LAPACK library.
 +
 +If you use the Intel compilers, you can add ''-mkl'' to your link command, e.g.
 +
 +<code bash>
 +    ifort -o program -mkl=sequential [...]
 +
 +    ifort -o program -qopenmp -mkl=parallel [...]
 +</code>
 +
 +The former uses the serial library, the latter uses the threaded library that respects the OpenMP runtime environment of the job for multithreaded BLAS/LAPACK execution.
 +
 +If you're not using the Intel compilers, you'll need to generate the appropriate compiler directives using [[https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor|Intel's online tool]].
 +
 +Please use "dynamic linking" since that allows MKL to adjust the underlying kernel functions at runtime according to the hardware on which you're running.  If you use static linking, you're tied to the lowest common hardware model available and you will usually not see as good performance.
 +
 +You'll need to load a version of Intel into the environment before compiling/building and also at runtime using VALET such as
 +
 +<code bash>
 +    vpkg_require intel/2019
 +</code>
 +
 +Among other things, this will set ''MKLROOT'' in the environment to the appropriate path, which the link advisor references.  The MKL version (year) matches that of the compiler version (year).
 +
 +To determine the available versions of Intel installed use
 +
 +<code>
 +$ vpkg_versions intel
 +</code>
 +
 +==== PGI compiler suite ====
  
 === Fortran examples illustrated with the PGI compiler suite === === Fortran examples illustrated with the PGI compiler suite ===
  • abstract/caviness/app_dev/prog_env.1531168992.txt.gz
  • Last modified: 2018-07-09 16:43
  • by 127.0.0.1