Error:INTEL package does not support per-atom stress (src/INTEL/pair_airebo_intel.cpp:295)

Hi, all,

I am trying to use Intel package to accelerate the calculation of lammps. However, an error occurred. Error:Intel package does not support per atom stress (src/intel/pair_irebo_intel.cpp:295).

The manual also mentioned this problem, but I can’t understand it. Since Intel can’t accelerate compute atom/stress, it’s better not to accelerate it. Why can’t it accelerate other types and run the compute command at normal speed?

I tried to use ‘’-sf hybrid intel omp’’, but the same error still occurred.This is inconsistent with the explanation of the command in the manual (the hybrid style is the only style that accepts arguments. It allows for two packages to be specified. The first package specified is the default and will be used if it is available. If no style is available for the first package, the style for the second package will be used if available. For example, “-sf hybrid intel omp” will use styles from the INTEL package if they are installed and available, but styles for the OPENMP package otherwise. If the -suffix switch is used the specified suffix (gpu,intel,kk,omp,opt) is automatically appended whenever your input script command creates a new atom style, pair style, fix, compute, or run style. If the variant version does not exist, the standard version is created.).

Only by setting omp acceleration alone, there will be no errors, but that is not the result I want. Have you ever encountered such a problem? Welcome to leave a message.

Thank you!

The reason is that compute stress/atom doesn’t compute anything, it just makes pre-computed data available. The data is accumulated by the pair style during the force computation, hence the error from the pair style. The data accumulation during the force computation also includes the global stress and per-atom and global energies. While in many cases the global stress can be computed after all forces have been tallied, the per-atom stress requires to call a function inside the individual loops over the neighbors of atoms. That however collides with the very aggressive optimizations for threading and vectorization in the INTEL package. So if you must have per-atom stress, you cannot optimize as much (as in the OPENMP package). An alternate approach to consider would be to compute and record a trajectory without collecting per-atom stress and then use the rerun command to post-process the recorded trajectory (i.e. recompute the forces) and then collect the per-atom stress and use the MANYBODY or OPENMP version instead. Of course that is only meaningful, if you need the per-atom stress at sufficiently large intervals.

No, it is consistent with the manual. It is using the “/intel” version of the pair style since it is available in your executable and would fall back to the “/omp” version only if there was no INTEL package version of the pair style. There is no compute stress/atom for any of the accelerated packages, since it - as explained earlier - does not compute anything, so there would be no value in accelerating it.

Dear Axel,

I’m very sorry that I haven’t checked the message and didn’t reply to you in time!

Thank you very much for your answer! You made it very clear and I think I already know what’s going on. Fortunately, for the time being, I don’t need the results of atomic stress very much so the effect of using Intel acceleration to get the results I need most is still very ideal. The speed is about twice that of not using Intel package (both single threads), which is very good. Thank you again for your explanation of the working principle of lammps, which has benefited me a lot!

Best,
hgc