[petsc-users] Explicit linking to OpenMP results in performance drop and wrong results

Jed Brown jed at jedbrown.org
Wed Feb 17 14:14:43 CST 2021


Roland Richter <roland.richter at ntnu.no> writes:

> Hei,
>
> the compilation line is (as shown below)
>
> //usr/lib64/mpi/gcc/openmpi3/bin/mpicxx -DBOOST_ALL_NO_LIB
> -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_MPI_DYN_LINK
> -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SERIALIZATION_DYN_LINK
> -DUSE_CUDA
> -I/home/roland/Dokumente/C++-Projekte/armadillo_with_PETSc/include
> -I/opt/intel/compilers_and_libraries_2020.2.254/linux/mkl/include
> -I/opt/armadillo/include -isystem /opt/petsc_release/include -isystem
> /opt/fftw3/include -isystem /opt/boost/include -march=native
> -fopenmp-simd -DMKL_LP64 -m64 -Wall -Wextra -pedantic -fPIC -flto -O2
> -funroll-loops -funroll-all-loops -fstrict-aliasing -mavx -march=native
> -fopenmp -std=gnu++17 -c <source_files> -o <target_files>/

-fopenmp implies -fopenmp-simd so you don't need both. You have -fopenmp here so it'll use threading, and likely default to libgomp (depending on what compiler is behind the mpicxx wrapper).


More information about the petsc-users mailing list