KOKKOS+CUDA with Intel compiler

Dear all,

i tried compiling lammps with kokkos, icpc and openmpi.
I changed the compiler-variable in the lib/kokkos/config/nvcc_wrapper to icpc, and set the OMPI_CXX variable to this wrapper.
This compiles most files just fine, but for some I get errors of the like:

/usr/include/x86_64-linux-gnu/c++/4.8/bits/opt_random.h(68): error: identifier “_mm_set1_epi64x” is undefined

Considering these are gnu-headers, this does not surprise me, but i can’t figure out where the compiler gets the idea to include these files, as I don’t see anything referring to this directory in the wrapper.

Can anyone nudge me in the right direction?

Is this combination even expected to be working atm?

Thanks for your help,

Sebastian

Dear all,

i tried compiling lammps with kokkos, icpc and openmpi.
I changed the compiler-variable in the lib/kokkos/config/nvcc_wrapper to
icpc, and set the OMPI_CXX variable to this wrapper.
This compiles most files just fine, but for some I get errors of the like:

/usr/include/x86_64-linux-gnu/c++/4.8/bits/opt_random.h(68): error:
identifier "_mm_set1_epi64x" is undefined

Considering these are gnu-headers, this does not surprise me, but i can't
figure out where the compiler gets the idea to include these files, as I
don't see anything referring to this directory in the wrapper.

by default, the intel compiler will adapt to the C++ ABI of the
hosting gnu compiler, and thus it will use the same include files.
the error you are showing is an indication for an incompatibility,
most likely due to the intel compiler version being too old.

Can anyone nudge me in the right direction?

why use the intel compiler when also using GPU support? you are making
your life needlessly complicated. have you tried to compile with gnu
c++ only (and OpenMP)?
or intel compiler (and OpenMP)? that is what i would have tried first.
then try to compile with CUDA and gnu.

Is this combination even expected to be working atm?

that depends on the specific compiler versions (for CUDA's nvcc, gnu
c++ and intel c++). the KOKKOS readme file(s) should provide a list of
tested combinations.
i've had success with gnu 4.9.3 and cuda 7.5 for example.

axel.

You shouldn't need to make any changes to the nvcc_wrapper to use the intel compiler. And since you are using OpenMPI, you also shouldn't need to modify Makefile.kokkos_cuda_openmpi. Just be sure that your intel compiler is 14.0 or higher and your underlying gnu version is 4.7.2 or higher. Then compiling using the default Makefile.kokkos_cuda_openmpi. If you have more problems let us know.

Stan

Well, i need to either set the host_compiler variable in the wrapper or add -ccbin icpc to the ccflags in the makefile, don’t i?

The versions are:

Intel 16.0

GCC 4.8.1

CUDA 8.0

I also tried cuda 7.5 with intel 15.0, but this combination fails to compile anything resembling c++11…

Yes, that is correct, I was mistaken. I talked to Christian Trott, one of the Kokkos lib developers, and he said that they recommend using the GNU compiler with Kokkos-CUDA if possible. The tested compilers for Kokkos-CUDA from the Kokkos README file are:

CUDA 6.5 (with gcc 4.7.2)

CUDA 7.0 (with gcc 4.7.2)

CUDA 7.5 (with gcc 4.8.4)

In theory you can build Kokkos-CUDA with the intel compiler but it isn’t tested and Christian said you will need the correct version of the intel compiler for the corresponding version of CUDA or it will error out. Christian said you could hack out that error check (but in that case you are on your own). As Axel said, unless you enjoy pain, use GNU.

Stan

Thanks for your effort!

I guess i’ll postpone this until the wrapper is no longer needed, until then switching between the executables should be good enough.

Yeah, sorry for the inconvenience…

Stan