easybuilders / easybuild-easyblocks

Collection of easyblocks that implement support for building and installing software with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
104 stars 284 forks source link

hpl easyblock uses LIBLAPACK_MT which requires toolchainopt openmp:True for gimkl #1470

Open akesandgren opened 6 years ago

akesandgren commented 6 years ago

The hpl easyblock incorrectly uses LIBLAPACK_MT without checking that toolchainopt openmp is True.

This makes it fail using gimkl toolchain.

akesandgren commented 6 years ago

Fixed in https://github.com/easybuilders/easybuild-easyblocks/pull/1471

boegel commented 6 years ago

@akesandgren How does HPL-2.1-gimkl-2.11.5.eb fail exactly without the fix?

akesandgren commented 6 years ago

HPL-2.1-gimkl-2.11.5.eb doesn't fail since it explicitly have openmp:True but see my comment in https://github.com/easybuilders/easybuild-easyblocks/pull/1471

boegel commented 6 years ago

@akesandgren OK, but then which HPL easyconfig fails when gimkl is used? I'm a bit confused why this hasn't popped up at all...

akesandgren commented 6 years ago

The one in https://github.com/easybuilders/easybuild-easyconfigs/pull/6662 which, as I said, is taken from a normal HPL-2.2-intel-x.eb and thus contains no 'openmp': True in the toolchainopts.

boegel commented 6 years ago

problem reproduced in https://gist.github.com/boegel/78853c9fcf666887eaf811ff4c0bc98c:

/user/home/gent/vsc400/vsc40023/eb_phanpyscratch/CO7/sandybridge/software/imkl/2018.3.222-gimpi-2018b/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'GOMP_loop_dynamic_start'
/user/home/gent/vsc400/vsc40023/eb_phanpyscratch/CO7/sandybridge/software/imkl/2018.3.222-gimpi-2018b/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'omp_get_thread_num'

In the light of those errors, compiling with -fopenmp is correct, so that explains why openmp: True is used in HPL easyconfigs using gimkl toolchain...

I'm not sure if that warrants to use $LIBLAPACK when openmp is False, however...

akesandgren commented 6 years ago

Well, using LIBLAPACK_MT without -fopenmp is wrong for mkl with GCC. I.e. LIBLAPACK_MT uses mkl_gnu_thread which requires -fopenmp at link time. It happens to work for intel+mkl but if OpenBLAS was built as a shared library it would fail for GCC/intel + OpenBLAS too, since that would then also need -fopenmp for LIBLAPACK/BLAS_MT

boegel commented 6 years ago

@akesandgren So isn't that something to actually fix in framework? I.e. always include -fopenmp in $LIBLAPACK_MT when GCC is used with MKL?

akesandgren commented 6 years ago

Perhaps, but it might be more complicated than that. Haven't given it that much though.