spack: openmpi: A code compiled with spack gcc is slow when compiled with profiling instrumentation

I am trying to compile and run octopus-code with spack compiler (both gcc@10.3.0 with openmpi@4.1.1and gcc@11.3.0 with openmpi@4.1.4) but both of them have the following problem : when I compile the program with -ftest-coverage -fprofile-arcs the resulting binary is about 3x slower than the binary without this, all else being equal. ( on a serial-only build, it is much smaller at 50% or so slow down) I compared the same code with the toolchains compiled with EasyBuild (foss2022a and foss2021a) and there this flag has no impact. I am not sure what might be the problem, any input would be very helpful. Some of my analyses are done at https://gitlab.gwdg.de/mpsd-cs/octopus_profiling_slowdown/-/tree/master The relevant environment configuration is at https://gitlab.gwdg.de/mpsd-cs/spack-environments/-/blob/releases/23c/toolchains/foss2022a-mpi/spack.yaml?ref_type=heads

Steps to reproduce:

pipx install git+https://gitlab.gwdg.de/mpsd-cs/mpsd-software-manager
mpsd-software init
mpsd-software install 23c foss2022a-mpi # takes about 2hrs on 16 core, this copies the environment file and uses spack to install the environment
# load modules mentioned at the end of the installation 

Any thoughts: @alalazo , @michaelkuhn ?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

Since this is not particularly a spack-only related issue, I would close this issue here. For anyone having a similar issue, I solved it by using -fprofile-update=single since I knew that we were not using any multithreading in our runs.