- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -
CPE: Difference between revisions
From HLRS Platforms
Jump to navigationJump to search
(→Setup) |
|||
Line 66: | Line 66: | ||
/opt/hlrs/non-spack/rev-009_2022-09-01/compiler/gcc/10.2.0/lib64 | /opt/hlrs/non-spack/rev-009_2022-09-01/compiler/gcc/10.2.0/lib64 | ||
/opt/cray/pe/lib64 # <--- Need a proper modulefile to undo this change | /opt/cray/pe/lib64 # <--- Need a proper modulefile to undo this change | ||
=== General Notes === | |||
* Use the compiler drivers <code>cc</code>, <code>CC</code>, and <code>ftn</code> to compile and link C, C++, and Fortran code. If you need to debug a build or want to see which tools are invoked with which flags and options, compile with <code>-v</code> or <code>--cray-print-opts=all</code>. | |||
* Cray compilers can generate detailed yet readable optimization reports. Try out <code>-fsave-loopmark</code> (C/C++) or <code>-rm</code> (Fortran) and inspect the resulting listings files (*.lst). | |||
* The Cray Fortran compiler is a highly optimizing compiler that performs extensive analyses at <code>-O2</code> or greater. If you value short compile times during development, consider dialing down the optimization level to <code>-O1</code> or <code>-O0</code>, or see if <code>-Oipa1</code> or <code>-Oipa0</code> makes a difference. Be aware that the default optimization level is <code>-O2</code> (and <code>-Oipa3</code>), not <code>-O0</code>. | |||
* To clarify compiler messages, warnings, errors, and runtime errors, use <code>explain</code>, for example, <code>explain ftn-2103</code> for more information about Fortran warning 2103. | |||
* <code>man intro_directives</code> gives an overview of pragmas and directives supported by the Cray compilers, should you look for specific extensions. | |||
* Prefer <code>mpiexec</code> to <code>mpirun</code> in PBS batch scripts, unless you make sure that aliases are expanded, using <code>shopt -s expand_aliases</code>, for example. | |||
* <code>man mpiexec</code> contains a few examples of binding processes and threads to CPUs. Use <code>--cpu-bind depth -d $OMP_NUM_THREADS</code> for hybrid programs. In general, we recommend to play around with xthi to make sure you achieve your preferred binding. | |||
* The Parallel Application Launch Service (PALS) is not configured to allow launching applications on login nodes. You can do <code>mpirun</code> or <code>mpiexec</code> only on compute nodes. | |||
* The environment variable PE_ENV can be used to determine which PrgEnv-<env> is active. If something requires Cray compilers, for example, you can test if <code>[ "$PE_ENV" = "CRAY" ]</code>. | |||
* In some cases, it is necessary to prepend CRAY_LD_LIBRARY_PATH to LD_LIBRARY_PATH, in particular when you want to use a non-default version of a dynamic library that is not present in /opt/cray/pe/lib64. If <code>ldd <exe></code> reports missing dependencies, check if <code>LD_LIBRARY_PATH=$CRAY_LD_LIBRARY_PATH:$LD_LIBRARY_PATH ldd <exe></code> resolves them. | |||
* When running <code>pat_report</code> on an empty experiment data directory, include <code>-i <exe></code> to specify where your instrumented executable <code><exe></code> can be found. This is more robust than relying on a recorded path, which may not exist anymore at the time of running <code>pat_report</code>. You won't need this option if you launch your instrumented program with <code>mpiexec --no-transfer</code>. |
Revision as of 17:14, 17 July 2023
Cray Programming Environment User Guide: CSM for HPE Cray EX Systems HPE CPE User Guide
CPE on Hawk
Setup
Archive cpe_on_hawk.tar contains
$ tar -tf cpe_on_hawk.tar enable_cpe.sh compiler/aocc/lmod/modulefiles/core/ (...) compiler/intel/lmod/modulefiles/core/ (...) test/placement/job.sh
- Bash script to initialize CPE: enable_cpe.sh
- Additional module files for PrgEnv-aocc and PrgEnv-intel: compiler/
- Example PBS job script (for xthi): test/placement/job.sh
To use PrgEnv-aocc and PrgEnv-intel, put compiler in DIR and set REPO_ROOT=DIR in enable_cpe.sh.
Loading CPE
$ module list Currently Loaded Modules: 1) system/site_names 3) system/wrappers/1.0 5) gcc/10.2.0 2) system/ws/1.4.0 4) hlrs-software-stack/current 6) mpt/2.26 $ . enable_cpe.sh $ module list Currently Loaded Modules: 1) system/site_names 6) perftools-base/22.09.0 11) cray-libsci/22.11.1.2 2) system/ws/1.4.0 7) cce/15.0.0 12) cray-pals/1.2.4 3) system/wrappers/1.0 8) craype/2.7.19 13) PrgEnv-cray/8.3.4 4) craype-x86-rome 9) cray-dsmml/0.2.2 5) craype-network-ucx 10) cray-mpich-ucx/8.1.21 $ cc --version Cray clang version 15.0.0 (324a8e7de6a18594c06a0ee5d8c0eda2109c6ac6) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /opt/cray/pe/cce/15.0.0/cce-clang/x86_64/share/../bin
Unloading CPE
$ module restore Resetting modules to system default (...) $ echo $MODULEPATH | tr : '\n' /opt/hlrs/non-spack/rev-009_2022-09-01/modulefiles/mpt/2.26/gcc/10.2.0 /sw/hawk-rh8/hlrs/spack/rev-009_2022-09-01/modulefiles/linux-rocky8-x86_64/mpt/2.26-zbg2lgp/gcc/10.2.0 /opt/hlrs/spack/rev-009_2022-09-01/modulefiles/linux-rocky8-x86_64/gcc/10.2.0 /opt/hlrs/non-spack/rev-009_2022-09-01/modulefiles/gcc/10.2.0 /opt/hlrs/spack/rev-009_2022-09-01/modulefiles/linux-rocky8-x86_64/gcc/8.5.0 /opt/hlrs/non-spack/rev-009_2022-09-01/modulefiles/gcc/8.5.0 /opt/hlrs/non-spack/system/modulefiles $ echo $LD_LIBRARY_PATH | tr : '\n' /opt/hlrs/non-spack/rev-009_2022-09-01/compiler/gcc/10.2.0/mpt_custom_fortran_modules/2.26 /opt/hlrs/non-spack/mpi/mpt/2.26/lib /opt/hlrs/non-spack/rev-009_2022-09-01/compiler/gcc/10.2.0/lib64 /opt/cray/pe/lib64 # <--- Need a proper modulefile to undo this change
General Notes
- Use the compiler drivers
cc
,CC
, andftn
to compile and link C, C++, and Fortran code. If you need to debug a build or want to see which tools are invoked with which flags and options, compile with-v
or--cray-print-opts=all
.
- Cray compilers can generate detailed yet readable optimization reports. Try out
-fsave-loopmark
(C/C++) or-rm
(Fortran) and inspect the resulting listings files (*.lst).
- The Cray Fortran compiler is a highly optimizing compiler that performs extensive analyses at
-O2
or greater. If you value short compile times during development, consider dialing down the optimization level to-O1
or-O0
, or see if-Oipa1
or-Oipa0
makes a difference. Be aware that the default optimization level is-O2
(and-Oipa3
), not-O0
.
- To clarify compiler messages, warnings, errors, and runtime errors, use
explain
, for example,explain ftn-2103
for more information about Fortran warning 2103.
man intro_directives
gives an overview of pragmas and directives supported by the Cray compilers, should you look for specific extensions.
- Prefer
mpiexec
tompirun
in PBS batch scripts, unless you make sure that aliases are expanded, usingshopt -s expand_aliases
, for example.
man mpiexec
contains a few examples of binding processes and threads to CPUs. Use--cpu-bind depth -d $OMP_NUM_THREADS
for hybrid programs. In general, we recommend to play around with xthi to make sure you achieve your preferred binding.
- The Parallel Application Launch Service (PALS) is not configured to allow launching applications on login nodes. You can do
mpirun
ormpiexec
only on compute nodes.
- The environment variable PE_ENV can be used to determine which PrgEnv-<env> is active. If something requires Cray compilers, for example, you can test if
[ "$PE_ENV" = "CRAY" ]
.
- In some cases, it is necessary to prepend CRAY_LD_LIBRARY_PATH to LD_LIBRARY_PATH, in particular when you want to use a non-default version of a dynamic library that is not present in /opt/cray/pe/lib64. If
ldd <exe>
reports missing dependencies, check ifLD_LIBRARY_PATH=$CRAY_LD_LIBRARY_PATH:$LD_LIBRARY_PATH ldd <exe>
resolves them.
- When running
pat_report
on an empty experiment data directory, include-i <exe>
to specify where your instrumented executable<exe>
can be found. This is more robust than relying on a recorded path, which may not exist anymore at the time of runningpat_report
. You won't need this option if you launch your instrumented program withmpiexec --no-transfer
.