CP2K Intel Compiler Build Issues

560 views
Skip to first unread message

Zeke P

unread,
Mar 22, 2018, 10:20:54 AM3/22/18
to cp2k
Hello,

I have been trying to work with our cluster support people here to install CP2K with intel compilers and I have been having difficulty getting an executable that passes the regtest.

Here are the regtest results I am getting:

-----

Summary of the regression tester run from 2018-03-21_17-21-50 using Linux-x86-64-intel-ku popt

Number of FAILED  tests 165

Number of WRONG   tests 1003

Number of CORRECT tests 1524

Number of NEW     tests 10

Total number of   tests 2702


-----


We have compiled CP2K/5.1 using the following arch makefile (created by our cluster support)


-----


INTEL_INC = $(MKL_ROOT)/include/fftw

INTEL_LIB = $(MKL_ROOT)/lib/intel64

CC = mpiicc

FC = mpiifort

LD = mpiifort

AR = xiar -r

DFLAGS = -D__INTEL -D__FFTSG -D__FFTW3 -D__FFTMKL -D__parallel -D__BLACS -D__SCALAPACK

CPPFLAGS = -C -traditional $(DFLAGS) -I$(INTEL_INC)

FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -O2 -xHost -heap-arrays 64 -fpp -free -unroll -pc 64 -convert big_endian -nofor_main

LDFLAGS = $(FCFLAGS)

LIBS = -L$(INTEL_LIB) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64

OBJECTS_ARCHITECTURE = machine_intel.o


-----


That being said - we aren't having much success. During compilation we are getting remark 8291 which states "Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'."  Could this be causing the problem? I am attaching the error summary output by the regtest in case that would help.


I would appreciate any suggestions you may have - it is very likely that we are missing something stupid that is causing the compilation trouble.


Thanks so much,

Zeke Piskulich

error_summary

Nico Holmberg

unread,
Mar 22, 2018, 12:40:25 PM3/22/18
to cp2k
Hi,

Which version of the Intel compiler suite/MKL are you using? Only version 17.0.4 20170411 currently works without issues, see https://www.cp2k.org/dev:compiler_support and earlier discussions on the Google groups forum.

I am no expert on Intel compiling but I think there are some issues with the arch-file, compare yours e.g. with this one https://sourceforge.net/p/cp2k/code/18346/tree//trunk/cp2k/arch/Linux-x86-64-intel.popt from the CP2K repository. For instance, I don't think the  -D__FFTMKL flag exists (?), use -D__MKL for MKL linear algebra/FFT. Also, setting -fp-model precise to FCFLAGS might help.

The error/note you mentioned is harmless.

- Nico

Zeke P

unread,
Mar 23, 2018, 4:30:35 PM3/23/18
to cp2k
Hi Nico,

Thanks for your response. I am indeed using that version of the intel compiler.

With a new arch file (provided to me after my original post) - I was able to compile cp2k again. I didn't have much luck with the arch file that you linked. This time - I am getting a segmentation fault when I run the executable for any input. This is probably due to a small mistake in the arch file.

Here is the segfault output:

---

forrtl: severe (174): SIGSEGV, segmentation fault occurred

Image              PC                Routine            Line        Source             

cp2k.popt          00000000061CEDD4  Unknown               Unknown  Unknown

libpthread-2.12.s  00002AFB6C88A710  Unknown               Unknown  Unknown

cp2k.popt          00000000060C5B41  mkl_lapack_ps_avx     Unknown  Unknown

cp2k.popt          0000000005FE4287  Unknown               Unknown  Unknown

cp2k.popt          0000000002F9F719  Unknown               Unknown  Unknown

cp2k.popt          0000000002DC42D4  Unknown               Unknown  Unknown

cp2k.popt          0000000002A9B519  Unknown               Unknown  Unknown

cp2k.popt          0000000000CBE12C  Unknown               Unknown  Unknown

cp2k.popt          0000000000787E2A  Unknown               Unknown  Unknown

cp2k.popt          00000000007842BC  Unknown               Unknown  Unknown

cp2k.popt          0000000000599F37  Unknown               Unknown  Unknown

cp2k.popt          00000000005999F3  Unknown               Unknown  Unknown

cp2k.popt          000000000045B876  Unknown               Unknown  Unknown

cp2k.popt          0000000000450C38  Unknown               Unknown  Unknown

cp2k.popt          0000000006232E02  Unknown               Unknown  Unknown

libc-2.12.so       00002AFB6E219D5D  __libc_start_main     Unknown  Unknown

cp2k.popt          0000000000450229  Unknown               Unknown  Unknown

---

Here is the arch file:

-----

CC       = icc

CPP      =

FC       = mpiifort

LD       = mpiifort

AR       = ar -r

MKLROOT=/panfs/pfs.local/software/install/intel/17.4/mkl

INTEL_LIB = $(MKLROOT)/lib/intel64

 

DFLAGS   = -D__INTEL -D__FFTSG -D__parallel -D__BLACS -D__SCALAPACK -D__FFTSG -D__MAX_CONTR=3 -D__HAS_NO_GETLOG -D__STATM_RESIDENT -D__HAS_NO_SHARED_GLIBC

FCFLAGS   = -D__INTEL -D__FFTSG -D__parallel -D__BLACS -D__SCALAPACK -D__FFTSG  -D__MAX_CONTR=3 -D__HAS_NO_GETLOG -D__STATM_RESIDENT -D__HAS_NO_SHARED_GLIBC

FCFLAGS  = $(DFLAGS) -I$ -O3 -msse2 -heap-arrays 64 -funroll-loops -fpp -free -nofor_main

FCFLAGS2 = $(DFLAGS) -O1 -msse2 -heap-arrays 64 -fpp -free

CPPFLAGS = $(FCFLAGS)

LDFLAGS  = $(FCFLAGS)

LIBS     = -L$(INTEL_LIB) -lstdc++  ${MKLROOT}/lib/intel64/libmkl_blas95_ilp64.a ${MKLROOT}/lib/intel64/libmkl_lapack95_ilp64.a ${MKLROOT}/lib/intel64/libmkl_scalapack_ilp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl

OBJECTS_ARCHITECTURE = machine_intel.o

 

graphcon.o: graphcon.F

    $(FC) -c $(FCFLAGS2) $<

mao_methods.o: mao_methods.F

    $(FC) -c $(FCFLAGS2) $<


-----


Do you have any thoughts on where the issue might be?


Would it be better if I gave up on the intel compiler for now and switched to trying to compile with gcc?


I really appreciate your response.


Thanks,

Zeke

Alfio Lazzaro

unread,
Mar 26, 2018, 5:20:04 AM3/26/18
to cp2k
Dear Zeke,
Let me summarize:
1) You are using CP2K 5.1
2) You are using Intel 17.0.4

OK, as Nico said, your arch file contains old flags that you can remove. It is strange that the official arch doesn't work for you (https://sourceforge.net/p/cp2k/code/18346/tree//trunk/cp2k/arch/Linux-x86-64-intel.popt ). Which problem do you get?
Anway, I'm putting here a "clean" version of your latest arch file:


CC       = icc
CPP      =
FC       = mpiifort
LD       = mpiifort
AR       = ar -r
MKLROOT=/panfs/pfs.local/software/install/intel/17.4/mkl
MKL_LIB = $(MKLROOT)/lib/intel64

DFLAGS   = -D__MKL  -D__FFTW3 -D__parallel  -D__SCALAPACK -D__STATM_RESIDENT -D__HAS_NO_SHARED_GLIBC
CFLAGS   = $(DFLAGS) -O2
FCFLAGS  = $(DFLAGS) -O2 -funroll-loops -fpp -free -fp-model precise
FCFLAGS += -I$(MKLROOT)/include -I$(MKLROOT)/include/fftw

LDFLAGS  = $(FCFLAGS) -static-intel
LDFLAGS_C = $(FCFLAGS) -static-intel -nofor_main

LIBS    += $(MKL_LIB)/libmkl_scalapack_lp64.a -Wl,--start-group \
           $(MKL_LIB)/libmkl_intel_lp64.a ${MKL_LIB}/libmkl_sequential.a \
           $(MKL_LIB)/libmkl_core.a \
           ${MKL_LIB}/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group \
           -lpthread -lm


# Required due to memory leak that occurs if high optimisations are used
mp2_optimize_ri_basis.o: mp2_optimize_ri_basis.F
                         $(FC) -c $(subst O2,O0,$(FCFLAGS)) $<


In this arch file I'm assuming that you have Intel MPI (or MPICH). Otherwise, you can change the libs (you can use https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor ). I didn't test it, probably there are typos (sorry in advance). My feeling about the error you showed is that there was something wrong in the linking of MKL (it mentions AVX, but you were compiling with SSE2 support). Please, try and let me know.
BTW, I would suggest to use LIBXSMM to get performance...

Alfio

Hans Pabst

unread,
Apr 2, 2018, 3:54:27 AM4/2/18
to cp...@googlegroups.com
Hello Zeke,

you may also have a look at http://xconfigure.readthedocs.io/cp2k/README/.

It appears to focus on CP2K/intel branch, but the recipe applies to the regular/official CP2K as well (and this is also explicitly covered). If you don't mind the outgrown ARCH file(s), you can simply copy the suggested ARCH files and proceed. There are no changes/edits needed since these ARCH files pick-up the usual environment variables (as set by the Intel development tools). Please note, there is also a list of "good compilers" as well as 2018 suite excluded from being good (at least for SMP builds). Key for correct regressions is to set the -fp-model if you also set any kind of target flag (aka -xHost or -xCORE-AVX2, etc.). The ARCH files also maintain a list of overridden builds rules for miscompiled translation units. However, the suggested 2017 compilers (u4 and later) are fairly ok (I am not even sure if they need anything to be worked around). I am only trimming these rules from time to time. Please note, the recipe only does not apply (or has not been tested) to CRAY systems. On CRAY, you may be better to start with an ARCH file as recently added to CP2K/master (https://raw.githubusercontent.com/cp2k/cp2k/master/cp2k/arch/Linux-x86-64-intel.*).

Hans

Zeke P

unread,
Apr 2, 2018, 9:11:16 PM4/2/18
to cp2k
Hello Alfio -

Thanks for your response!

I went ahead and compiled with the arch file that you suggested and it worked like a charm. The compilation worked - and the first simulation I ran with it seems to be producing what I think are reasonable results. I am going to do a regression test soon and check - but I feel much better about this than what I was using before. I agree with you that it seems like it was a MKL linkage issue. 

Thank you so much for your help (and thanks for everyone else who replied as well)! 
Zeke
Reply all
Reply to author
Forward
0 new messages