lammps 22Aug18, airebo/intel, xe2015 -> airebo intel bug on line 1030

Dear Sir/Madam,

I’ve been using lammps for minor simulations with the AIREBO potential. I want to ramp this up to much longer times, larger number of atoms/etc - so the acceleration package (user-intel + airebo/intel) is the next step.

After speaking to my HPC local expert about this - he stated that the loading the xe2015 (compilers, mkl and mpi) on the HPC will results in an error when compiling the latest version and to email this bug to the mailing list for guidance - "latest version of LAMMPS definitely supports airebo/intel style. But there might be a bug at line 1030 of the intel_intrinsics_airebo.h file."

As stated, below is what caused the ‘make intel_cpu’ to crash.

‘’’

mpiicpc -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload -fno-alias -ansi-alias -restrict -tbb -xHost -O2 -fp-model fast=2 -no-prec-div -override-limits -DLAMMPS_GZIP -DLAMMPS_JPEG -DLMP_USER_INTEL -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_MKL -DFFT_SINGLE -c …/pair_airebo.cpp
mpiicpc -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload -fno-alias -ansi-alias -restrict -tbb -xHost -O2 -fp-model fast=2 -no-prec-div -override-limits -DLAMMPS_GZIP -DLAMMPS_JPEG -DLMP_USER_INTEL -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_MKL -DFFT_SINGLE -c …/pair_airebo_intel.cpp
In file included from …/pair_airebo_intel.cpp(31):
…/intel_intrinsics_airebo.h(1030): error: no operator “[]” matches these operands
In file included from …/pair_airebo_intel.cpp(31):
operand types are: __m256 [ int ]
In file included from …/pair_airebo_intel.cpp(31):
if (mask[i]) {
^

In file included from …/pair_airebo_intel.cpp(31):
…/intel_intrinsics_airebo.h(1055): error: no operator “[]” matches these operands
In file included from …/pair_airebo_intel.cpp(31):
operand types are: __m256 [ int ]
In file included from …/pair_airebo_intel.cpp(31):
if (mask[i]) {
^

compilation aborted for …/pair_airebo_intel.cpp (code 2)
make[1]: *** [pair_airebo_intel.o] Error 2
make[1]: Leaving directory `/home/mp/mpbrs3/lammps-22Aug18/src/Obj_intel_cpu’
make: *** [intel_cpu] Error 2
‘’’

Any advice is appreciated.

Kind regards,
Ben

Hi Ben,

Thanks for letting me know, this indeed is bug-ish (I.e. unintentional).
It only triggers with the Intel Compiler <= 15.0.
So you can either upgrade the compiler, or apply the following patch:

1055c1055
< if (mask_buf[i]) {

markus,

can you please send this as a context diff or unidiff?

it is missing crucial information to integrate the change and it looks
like you did the diff in reverse, too.
also, what about the very similar statement in line 1030? should this
be changed, too?

axel.

Hi Alex,

Yes, you're right, sorry.
Hope this helps:

diff --git a/src/intel_intrinsics_airebo.h b/src/intel_intrinsics_airebo.h
index f17fd69..bd197f9 100644
--- a/src/intel_intrinsics_airebo.h
+++ b/src/intel_intrinsics_airebo.h
@@ -1027,7 +1027,7 @@ VEC_INLINE inline __m256
_mm256_compress_ps(__m256 mask, __m256 a) {
   _mm256_store_ps(a_buf, a);
   int k = 0;
   for (int i = 0; i < 8; i++) {
- if (mask[i]) {
+ if (mask_buf[i]) {
       dst_buf[k++] = a_buf[i];
     }
   }
@@ -1052,7 +1052,7 @@ VEC_INLINE inline __m256 _mm256_expand_ps(__m256
mask, __m256 a) {
   _mm256_store_ps(a_buf, a);
   int k = 0;
   for (int i = 0; i < 8; i++) {
- if (mask[i]) {
+ if (mask_buf[i]) {
       dst_buf[i] = a_buf[k++];
     }
   }

ok. this will be included in the next LAMMPS patch:
https://github.com/lammps/lammps/pull/1282/commits/a3b45d789a6253b9d61f302508adbf6bf037f660