diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 6657bd31eb3dfc4bdd2080dd5e921586a1482d6a..48378d38402f42041af19e57ff29774260379fb0 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -28,12 +28,10 @@ #ifndef LMP_INTEL_PREPROCESS_H #define LMP_INTEL_PREPROCESS_H -#ifndef LAMMPS_MEMALIGN -#error Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS for your LAMMPS makefile. -#else -#if (LAMMPS_MEMALIGN != 64) -#error Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS for your LAMMPS makefile. -#endif +// LAMMPS_MEMALIGN is set to 64 by default for -DLMP_USER_INTEL +// so we only need to error out in case of a different alignment +#if LAMMPS_MEMALIGN && (LAMMPS_MEMALIGN != 64) +#error Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS of your LAMMPS makefile for USER-INTEL package #endif #if defined(_OPENMP) diff --git a/src/memory.cpp b/src/memory.cpp index d7c3e1d535b5a61cc392d6e396f9057134ed73ef..1ab5074079c0f0ae730db783d5682d286d5c289e 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -22,6 +22,10 @@ #include "tbb/scalable_allocator.h" #endif +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) +#define LAMMPS_MEMALIGN 64 +#endif + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ diff --git a/src/my_page.h b/src/my_page.h index 9df08dc31cf444e844a66b2659affc52d21aa3ba..a6b69db1b565c63accdfeb8321ab0239d1e85bc9 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -48,6 +48,10 @@ methods: #ifndef LAMMPS_MY_PAGE_H #define LAMMPS_MY_PAGE_H +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) +#define LAMMPS_MEMALIGN 64 +#endif + #include <stdlib.h> namespace LAMMPS_NS {