HPAC / lammps-tersoff-vector

A Vectorized Implementation of the Tersoff Potential for the LAMMPS Molecular Dynamics Software
11 stars 2 forks source link

error report: Compiling with ICC 14.0 #1

Closed danpho closed 8 years ago

danpho commented 8 years ago

I tried to compile LAMMPS on our group cluster which has four nodes each of which has two coproccessors. Following the instruction, I received following error message: In file included from ../pair_tersoff_intel.cpp(61): ../intel_intrinsics.h(262): error: MIC identifier "_mm512_sincos_pd" is undefined return _mm512_sincos_pd(reinterpret_cast<__m512d *>(cos), a); ^

In file included from ../pair_tersoff_intel.cpp(61): ../intel_intrinsics.h(395): error: MIC identifier "_mm512_sincos_ps" is undefined return _mm512_sincos_ps(reinterpret_cast<__m512 *>(cos), a); ^

compilation aborted for ../pair_tersoff_intel.cpp (code 2) make[1]: * [pair_tersoff_intel.o] Error 2 make[1]: Leaving directory `/home/cormackgroup/Shared/wly/LAMMPS_wly/lammps-16Feb16/src/Obj_intel_phi' make: * [intel_phi] Error 2

Any suggestion or help will be highly appreciated.

v0i0 commented 8 years ago

Thanks for bringing this to my attention.

I'd like to reproduce your error message. To do so, could you provide me with the version of the Intel Compiler and MPI that you're building with?

Note that right now, only ICC 15.0 onwards are tested.

If the error is caused by different features of an earlier compiler, I'll look into ways to resolve it. If the above is the entire error message, fixing it will be easy (replacing the _mm51_sincos_p[ds] with seperate calls), and I'll patch it soon.

danpho commented 8 years ago

Thank you for your response. Following is the basic system info. If you need extra ones, please let me know.

  1. CentOS Linux release 7.0.1406 (Core)
  2. Linux version:3.10.0-123.el7.x86_64
  3. Intel XEON Romley E5-2630 CPU
  4. Intel XEON Phi Coprocessor 5110P
  5. Four nodes each of which has 24 cores and 2 Coprocessors.
  6. Intel compiler xe_2013_sp1.2.144
  7. Intel MPI 4.1.3.048
  8. icpc version 14.0.2 (gcc version 4.8.0 compatibility)
  9. LAMMPS will be installed in the Shared directory to use these four nodes.
v0i0 commented 8 years ago

I could replicate your issue with ICC 14.0 on my side.

The problem disappears when compiling with 15.0 onwards (arguably the simplest solution).

I patched the code to mitigate this issue (315d97e3f1f39848a051b26ebda56f6a29fe34c4). While this code is compiling, and should absolutely be correct, I am unable to test it right now. If you are going to use the tersoff/intel style, you can test the code via the provided python test script:

cd test; python test.py path/to/binary
danpho commented 8 years ago

Thanks. I will test it on our cluster and update you on my progress. Thank you so much for your time and help.

danpho commented 8 years ago

Thank you for your batch file which solved one error I met. Now, I got following new errors related to pair_tersoff_intel.cpp, pari_tersoff_intel.h, and other files.

_NOTE: I HAVE DOWNLOAD THE pair_tersoff_intel.cpp and pair_tersoff_intel.h and put them in src/USER-INTEL/ directory. Because I am not familiar with Python tool, I only copy these files to the related directory to compile Lammps for intel+phi. _

../pair_tersoff_intel.cpp(5): error: expected a declaration <!DOCTYPE html> ^

../pair_tersoff_intel.cpp(8): warning #2221: too many characters in character literal -- extra leading characters ignored

                ^

../pair_tersoff_intel.cpp(26): error: extra text after expected end of number

lammps-tersoff-vector/pair_tersoff_intel.cpp at 315d97e3f1f39848a051b26ebda56f6a29fe34c4 · HPAC/lammps-tersoff-vector · GitHub
                                                            ^

../pair_tersoff_intel.cpp(26): error: unrecognized token

lammps-tersoff-vector/pair_tersoff_intel.cpp at 315d97e3f1f39848a051b26ebda56f6a29fe34c4 · HPAC/lammps-tersoff-vector · GitHub
                                                                                                  ^

../pair_tersoff_intel.cpp(26): error: unrecognized token

lammps-tersoff-vector/pair_tersoff_intel.cpp at 315d97e3f1f39848a051b26ebda56f6a29fe34c4 · HPAC/lammps-tersoff-vector · GitHub
                                                                                                                               ^

../pair_tersoff_intel.cpp(137): error: missing closing quote

^ ../pair_tersoff_intel.cpp(290): error: extra text after expected end of number 315d97e3f1 ^ ../pair_tersoff_intel.cpp(366): warning #12: parsing restarts here after previous syntax error Fetching contributors… ^ ../pair_tersoff_intel.cpp(367): error: expected a declaration
^ ../pair_tersoff_intel.cpp(478): error: "#" not expected here #include "math.h" ^ ../pair_tersoff_intel.cpp(478): warning #12: parsing restarts here after previous syntax error #include "math.h" ^ ../pair_tersoff_intel.cpp(478): error: expected a declaration #include "math.h" ^ ../pair_tersoff_intel.cpp(478): error: expected a declaration #include "math.h" ^ ../pair_tersoff_intel.cpp(482): error: "#" not expected here #include "stdio.h" ^ ../pair_tersoff_intel.cpp(482): warning #12: parsing restarts here after previous syntax error #include "stdio.h" ^ ../pair_tersoff_intel.cpp(482): error: expected a declaration #include "stdio.h" ^ ../pair_tersoff_intel.cpp(482): error: expected a declaration #include "stdio.h" ^ ../pair_tersoff_intel.cpp(486): error: "#" not expected here #include "stdlib.h" ^ ../pair_tersoff_intel.cpp(486): warning #12: parsing restarts here after previous syntax error #include "stdlib.h" ^ ../pair_tersoff_intel.cpp(486): error: expected a declaration #include "stdlib.h" ^ ../pair_tersoff_intel.cpp(486): error: expected a declaration #include "stdlib.h" ^ ../pair_tersoff_intel.cpp(490): error: "#" not expected here #include "string.h" ^ ../pair_tersoff_intel.cpp(490): warning #12: parsing restarts here after previous syntax error #include "string.h" ^ ../pair_tersoff_intel.cpp(490): error: expected a declaration #include "string.h" ^ ../pair_tersoff_intel.cpp(490): error: expected a declaration #include "string.h" ^ ../pair_tersoff_intel.cpp(494): error: "#" not expected here #include "pair_tersoff_intel.h" ^ ../pair_tersoff_intel.cpp(494): warning #12: parsing restarts here after previous syntax error #include "pair_tersoff_intel.h" ^ ../pair_tersoff_intel.cpp(494): error: expected a declaration #include "pair_tersoff_intel.h" ^ ../pair_tersoff_intel.cpp(494): error: expected a declaration #include "pair_tersoff_intel.h" ^ ../pair_tersoff_intel.cpp(498): error: "#" not expected here #include "atom.h" ^ ../pair_tersoff_intel.cpp(498): warning #12: parsing restarts here after previous syntax error #include "atom.h" ^ ../pair_tersoff_intel.cpp(498): error: expected a declaration #include "atom.h" ^ ../pair_tersoff_intel.cpp(498): error: expected a declaration #include "atom.h" ^ ../pair_tersoff_intel.cpp(502): error: "#" not expected here #include "neighbor.h" ^ ../pair_tersoff_intel.cpp(502): warning #12: parsing restarts here after previous syntax error #include "neighbor.h" ^ ../pair_tersoff_intel.cpp(502): error: expected a declaration #include "neighbor.h" ^ ../pair_tersoff_intel.cpp(502): error: expected a declaration #include "neighbor.h" ^ ../pair_tersoff_intel.cpp(506): error: "#" not expected here #include "neigh_list.h" ^ ../pair_tersoff_intel.cpp(506): warning #12: parsing restarts here after previous syntax error #include "neigh_list.h" ^ ../pair_tersoff_intel.cpp(506): error: expected a declaration #include "neigh_list.h" ^ ../pair_tersoff_intel.cpp(506): error: expected a declaration #include "neigh_list.h" ^ ../pair_tersoff_intel.cpp(510): error: "#" not expected here #include "neigh_request.h" ^ ../pair_tersoff_intel.cpp(510): warning #12: parsing restarts here after previous syntax error #include "neigh_request.h" ^ ../pair_tersoff_intel.cpp(510): error: expected a declaration #include "neigh_request.h" ^ ../pair_tersoff_intel.cpp(510): error: expected a declaration #include "neigh_request.h" ^ ../pair_tersoff_intel.cpp(514): error: "#" not expected here #include "force.h" ^ ../pair_tersoff_intel.cpp(514): warning #12: parsing restarts here after previous syntax error #include "force.h" ^ ../pair_tersoff_intel.cpp(514): error: expected a declaration #include "force.h" ^ ../pair_tersoff_intel.cpp(514): error: expected a declaration #include "force.h" ^ ../pair_tersoff_intel.cpp(518): error: "#" not expected here #include "comm.h" ^ ../pair_tersoff_intel.cpp(518): warning #12: parsing restarts here after previous syntax error #include "comm.h" ^ ../pair_tersoff_intel.cpp(518): error: expected a declaration #include "comm.h" ^ ../pair_tersoff_intel.cpp(518): error: expected a declaration #include "comm.h" ^ ../pair_tersoff_intel.cpp(522): error: "#" not expected here #include "memory.h" ^ ../pair_tersoff_intel.cpp(522): warning #12: parsing restarts here after previous syntax error #include "memory.h" ^ ../pair_tersoff_intel.cpp(522): error: expected a declaration #include "memory.h" ^ ../pair_tersoff_intel.cpp(522): error: expected a declaration #include "memory.h" ^ ../pair_tersoff_intel.cpp(526): error: "#" not expected here #include "error.h" ^ ../pair_tersoff_intel.cpp(526): warning #12: parsing restarts here after previous syntax error #include "error.h" ^ ../pair_tersoff_intel.cpp(526): error: expected a declaration #include "error.h" ^ ../pair_tersoff_intel.cpp(526): error: expected a declaration #include "error.h" ^ ../pair_tersoff_intel.cpp(543): error: "#" not expected here #ifndef __INTEL_COMPILER ^ ../pair_tersoff_intel.cpp(547): warning #12: parsing restarts here after previous syntax error using namespace LAMMPS_NS; ^ ../pair_tersoff_intel.cpp(547): error: expected a declaration using namespace LAMMPS_NS; ^ ../pair_tersoff_intel.cpp(631): error: "#" not expected here #else ^ ../pair_tersoff_intel.cpp(640): error: "#" not expected here #ifdef _LMP_INTEL_OFFLOAD ^ ../pair_tersoff_intel.cpp(644): error: "#" not expected here #pragma offload_attribute(push,target(mic)) ^ ../pair_tersoff_intel.cpp(648): error: "#" not expected here #endif ^ ../pair_tersoff_intel.cpp(657): error: "#" not expected here #include "intel_intrinsics.h" ^ ../pair_tersoff_intel.cpp(657): warning #12: parsing restarts here after previous syntax error #include "intel_intrinsics.h" ^ ../pair_tersoff_intel.cpp(657): error: expected a declaration #include "intel_intrinsics.h" ^ ../pair_tersoff_intel.cpp(657): error: expected a declaration #include "intel_intrinsics.h" ^ ../pair_tersoff_intel.cpp(661): error: "#" not expected here #include "math_const.h" ^ ../pair_tersoff_intel.cpp(661): warning #12: parsing restarts here after previous syntax error #include "math_const.h" ^ ../pair_tersoff_intel.cpp(661): error: expected a declaration #include "math_const.h" ^ ../pair_tersoff_intel.cpp(661): error: expected a declaration #include "math_const.h" ^ ../pair_tersoff_intel.cpp(670): error: "#" not expected here #ifdef _LMP_INTEL_OFFLOAD ^ ../pair_tersoff_intel.cpp(674): error: "#" not expected here #pragma offload_attribute(pop) ^ ../pair_tersoff_intel.cpp(678): error: "#" not expected here #endif ^ ../pair_tersoff_intel.cpp(687): error: "#" not expected here #include "group.h" ^ ../pair_tersoff_intel.cpp(687): warning #12: parsing restarts here after previous syntax error #include "group.h" ^ ../pair_tersoff_intel.cpp(687): error: expected a declaration #include "group.h" ^ ../pair_tersoff_intel.cpp(687): error: expected a declaration #include "group.h" ^ ../pair_tersoff_intel.cpp(691): error: "#" not expected here #include "kspace.h" ^ ../pair_tersoff_intel.cpp(691): warning #12: parsing restarts here after previous syntax error #include "kspace.h" ^ ../pair_tersoff_intel.cpp(691): error: expected a declaration #include "kspace.h" ^ ../pair_tersoff_intel.cpp(691): error: expected a declaration #include "kspace.h" ^ ../pair_tersoff_intel.cpp(695): error: "#" not expected here #include "modify.h" ^ ../pair_tersoff_intel.cpp(695): warning #12: parsing restarts here after previous syntax error #include "modify.h" ^ ../pair_tersoff_intel.cpp(695): error: expected a declaration #include "modify.h" ^ ../pair_tersoff_intel.cpp(695): error: expected a declaration #include "modify.h" ^ ../pair_tersoff_intel.cpp(699): error: "#" not expected here #include "suffix.h" ^ ../pair_tersoff_intel.cpp(699): warning #12: parsing restarts here after previous syntax error #include "suffix.h" ^ ../pair_tersoff_intel.cpp(699): error: expected a declaration #include "suffix.h" ^ ../pair_tersoff_intel.cpp(699): error: expected a declaration #include "suffix.h" ^ ../pair_tersoff_intel.cpp(708): warning #12: parsing restarts here after previous syntax error using namespace LAMMPS_NS; ^ ../pair_tersoff_intel.cpp(708): error: expected a declaration using namespace LAMMPS_NS; ^ ../pair_tersoff_intel.cpp(712): warning #12: parsing restarts here after previous syntax error using namespace MathConst; ^ ../pair_tersoff_intel.cpp(712): error: expected a declaration using namespace MathConst; ^ ../pair_tersoff_intel.cpp(796): warning #12: parsing restarts here after previous syntax error force_const_double); ^ ../pair_tersoff_intel.cpp(796): error: expected a declaration force_const_double); ^ ../pair_tersoff_intel.cpp(816): warning #12: parsing restarts here after previous syntax error fix->balance_stamp(); ^ ../pair_tersoff_intel.cpp(816): error: expected a declaration fix->balance_stamp(); ^ ../pair_tersoff_intel.cpp(816): error: expected a declaration fix->balance_stamp(); ^ ../pair_tersoff_intel.cpp(820): warning #12: parsing restarts here after previous syntax error vflag_fdotr = 0; ^ ../pair_tersoff_intel.cpp(820): error: expected a declaration vflag_fdotr = 0; ^ ../pair_tersoff_intel.cpp(841): warning #12: parsing restarts here after previous syntax error template <class flt_t, class acc_t> ^ ../pair_tersoff_intel.cpp(841): error: expected a declaration template <class flt_t, class acc_t> ^ ../pair_tersoff_intel.cpp(841): error: expected a declaration template <class flt_t, class acc_t> ^ ../pair_tersoff_intel.cpp(849): warning #12: parsing restarts here after previous syntax error IntelBuffers<flt_t,acc_t> *buffers, ^ ../pair_tersoff_intel.cpp(849): error: expected a declaration IntelBuffers<flt_t,acc_t> *buffers, ^ ../pair_tersoff_intel.cpp(849): error #77: this declaration has no storage class or type specifier IntelBuffers<flt_t,acc_t> *buffers, ^ ../pair_tersoff_intel.cpp(849): error: expected an identifier IntelBuffers<flt_t,acc_t> *buffers, ^ ../pair_tersoff_intel.cpp(852): warning #12: parsing restarts here after previous syntax error ^ ../pair_tersoff_intel.cpp(852): error: a value of type "const char *" cannot be used to initialize an entity of type "int" ^ ../pair_tersoff_intel.cpp(852): error: expected a ";" ^ ../pair_tersoff_intel.cpp(853): error: expected a declaration const ForceConst<flt_t> &fc) ^ ../pair_tersoff_intel.cpp(853): error #77: this declaration has no storage class or type specifier const ForceConst<flt_t> &fc) ^ ../pair_tersoff_intel.cpp(853): error: reference variable "amp" requires an initializer const ForceConst<flt_t> &fc) ^ ../pair_tersoff_intel.cpp(853): error #77: this declaration has no storage class or type specifier const ForceConst<flt_t> &fc) ^ ../pair_tersoff_intel.cpp(853): error: expected a ";" const ForceConst<flt_t> &fc) ^ ../pair_tersoff_intel.cpp(878): warning #12: parsing restarts here after previous syntax error const int inum = list->inum; ^ ../pair_tersoff_intel.cpp(878): error #77: this declaration has no storage class or type specifier const int inum = list->inum; ^ ../pair_tersoff_intel.cpp(878): error: expected a declaration const int inum = list->inum; ^ ../pair_tersoff_intel.cpp(882): warning #12: parsing restarts here after previous syntax error const int nthreads = comm->nthreads; ^ ../pair_tersoff_intel.cpp(882): error #77: this declaration has no storage class or type specifier const int nthreads = comm->nthreads; ^ ../pair_tersoff_intel.cpp(882): error: expected a declaration const int nthreads = comm->nthreads; ^ ../pair_tersoff_intel.cpp(886): warning #12: parsing restarts here after previous syntax error const int host_start = fix->host_start_pair(); ^ ../pair_tersoff_intel.cpp(886): error: expected a declaration const int host_start = fix->host_start_pair(); ^ ../pair_tersoff_intel.cpp(886): error: expected a declaration const int host_start = fix->host_start_pair(); ^ ../pair_tersoff_intel.cpp(890): warning #12: parsing restarts here after previous syntax error const int offload_end = fix->offload_end_pair(); ^ ../pair_tersoff_intel.cpp(890): error: expected a declaration const int offload_end = fix->offload_end_pair(); ^ ../pair_tersoff_intel.cpp(890): error: expected a declaration const int offload_end = fix->offload_end_pair(); ^ ../pair_tersoff_intel.cpp(894): warning #12: parsing restarts here after previous syntax error const int ago = neighbor->ago; ^ ../pair_tersoff_intel.cpp(894): error #77: this declaration has no storage class or type specifier const int ago = neighbor->ago; ^ compilation aborted for ../pair_tersoff_intel.cpp (code 4) make[1]: **\* [pair_tersoff_intel.o] Error 4 make[1]: Leaving directory `/home/Shared/LAMMPS/lammps-16Feb16/src/Obj_intel_phi' make: **\* [intel_phi] Error 2
v0i0 commented 8 years ago

Clearly, you made a mistake when downloading the files.

  1. You do not need to download pair_tersoff_intel.{cpp,h}. The commit referenced above (315d97e) did not change them. Reset them using their copies in lammps-16Feb16/src/USER-INTEL.
  2. You do need to update the intel_intrinsics.h file. You need to download the raw file, i.e. intel_intrinsics.h. You seem to have dowloaded the webpage instead. Place the correct file into the lammps-16Feb16/src directory.

TL;DR

$ cd lammps-16Feb16/src
$ cp USER-INTEL/pair_tersoff_intel.cpp pair_tersoff_intel.cpp
$ cp USER-INTEL/pair_tersoff_intel.h pair_tersoff_intel.h
$ wget https://raw.githubusercontent.com/HPAC/lammps-tersoff-vector/master/src/intel_intrinsics.h
$ make ...
danpho commented 8 years ago

Thanks for your help and sorry to make such stupid mistake.

Following your suggestion, I made little progress. Now I got new errors shown below. I do not have any idea right now. Any suggestion will be highly appreciated.

../neigh_half_bin_intel.cpp(945): error: operator "identifier" is unexpected

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

../neigh_half_bin_intel.cpp(945): error: invalid simd pragma

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

../neigh_half_bin_intel.cpp(1520): error: operator "identifier" is unexpected

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

../neigh_half_bin_intel.cpp(1520): error: invalid simd pragma

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

../neigh_half_bin_intel.cpp(2053): error: operator "identifier" is unexpected

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

../neigh_half_bin_intel.cpp(2053): error: invalid simd pragma

pragma simd reduction(max:vlmax,vgmax) reduction(min:vlmin, vgmin)

                             ^

compilation aborted for ../neigh_half_bin_intel.cpp (code 2) make[1]: * [neigh_half_bin_intel.o] Error 2 make[1]: Leaving directory `/home/Shared/LAMMPS_wly/lammps-16Feb16/src/Obj_intel_phi' make: * [intel_phi] Error 2

v0i0 commented 8 years ago

This last error message originated outside of my code, so I did contact the original author. His fix has landed in the latest LAMMPS version, so compilation with ICC 14.0 should be possible now.