howto:pgo
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howto:pgo [2015/04/28 11:23] – faq:pgo renamed to howto:pgo oschuett | howto:pgo [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Profile guided optimization for CP2K ====== | ====== Profile guided optimization for CP2K ====== | ||
- | Using profile guided optimization (PGO) helps to generate faster CP2K executables, | + | Using profile guided optimization (PGO) helps to generate faster CP2K executables, |
- | 1. Introduce in the used arch file (e.g. local.sopt) the variable $(PROFOPT) as part as the FCFLAGS. | + | 1. Introduce in the used arch file (e.g. local.sopt) the variable $(PROFOPT) as part as the FCFLAGS |
| | ||
2. Clean any eventual leftovers from previous compilations, | 2. Clean any eventual leftovers from previous compilations, | ||
Line 9: | Line 9: | ||
3. Build the code with extra instrumentation (this binary is slow, and used only for training purposes) | 3. Build the code with extra instrumentation (this binary is slow, and used only for training purposes) | ||
make -j ARCH=local VERSION=sopt PROFOPT=-fprofile-generate | make -j ARCH=local VERSION=sopt PROFOPT=-fprofile-generate | ||
- | 4. Run the binary either on a specific testcase, or on the full testsuite | + | 4. Run the binary either on a specific testcase, or better |
- | ../../exe/local/cp2k.sopt -i test.inp | + | make -j ARCH=local VERSION=sopt PROFOPT=-fprofile-generate |
- | 5. Remove the old instrumented object files, retaining the .gcda files (i.e. clean) | + | 5. Remove the old instrumented object files, retaining the .gcda files (i.e. clean not realclean) |
- | make -j ARCH=local VERSION=sopt clean | + | make -j ARCH=local VERSION=sopt |
6. Recompile to build the optimized binary using the profile data. | 6. Recompile to build the optimized binary using the profile data. | ||
make -j ARCH=local VERSION=sopt PROFOPT=-fprofile-use | make -j ARCH=local VERSION=sopt PROFOPT=-fprofile-use |
howto/pgo.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1