Port pbc to new macros. Enable debugging flags.

This commit is contained in:
Jan Eitzinger 2021-03-23 10:03:55 +01:00
parent 6679b6c8aa
commit fc1fc9fd45
3 changed files with 22 additions and 22 deletions

View File

@ -1,4 +1,4 @@
TAG = CLANG TAG = GCC
#CONFIGURE BUILD SYSTEM #CONFIGURE BUILD SYSTEM
TARGET = MDBench-$(TAG) TARGET = MDBench-$(TAG)

View File

@ -8,14 +8,12 @@ ANSI_CFLAGS += -std=c99
ANSI_CFLAGS += -pedantic ANSI_CFLAGS += -pedantic
ANSI_CFLAGS += -Wextra ANSI_CFLAGS += -Wextra
# CFLAGS = -O0 -g -std=c99 -fargument-noalias CFLAGS = -O0 -g -std=c99 -fargument-noalias
CFLAGS = -O3 -march=znver1 -ffast-math -funroll-loops -fopenmp # CFLAGS = -O3 -march=znver1 -ffast-math -funroll-loops -fopenmp
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
ASFLAGS = -masm=intel ASFLAGS = -masm=intel
FCFLAGS = FCFLAGS =
LFLAGS = LFLAGS =
DEFINES = -D_GNU_SOURCE DEFINES = -D_GNU_SOURCE -DALIGNMENT=64 -DPRECISION=2
INCLUDES = INCLUDES =
LIBS = LIBS =

View File

@ -68,26 +68,23 @@ void updateAtomsPbc(Atom *atom, Parameter *param)
MD_FLOAT zprd = param->zprd; MD_FLOAT zprd = param->zprd;
for(int i = 0; i < atom->Nlocal; i++) { for(int i = 0; i < atom->Nlocal; i++) {
MD_FLOAT x = atom_x(i);
MD_FLOAT y = atom_y(i);
MD_FLOAT z = atom_z(i);
if(x < 0.0) { if(atom_x(i) < 0.0) {
atom_x(i) = x + xprd; atom_x(i) += xprd;
} else if(x >= xprd) { } else if(atom_x(i) >= xprd) {
atom_x(i) = x - xprd; atom_x(i) -= xprd;
} }
if(y < 0.0) { if(atom_y(i) < 0.0) {
atom_y(i) = y + yprd; atom_y(i) += yprd;
} else if(y >= yprd) { } else if(atom_y(i) >= yprd) {
atom_y(i) = y - yprd; atom_y(i) -= yprd;
} }
if(z < 0.0) { if(atom_z(i) < 0.0) {
atom_z(i) = z + zprd; atom_z(i) += zprd;
} else if(z >= zprd) { } else if(atom_z(i) >= zprd) {
atom_z(i) = z - zprd; atom_z(i) -= zprd;
} }
} }
} }
@ -96,7 +93,12 @@ void updateAtomsPbc(Atom *atom, Parameter *param)
* defining ghost atoms around domain * defining ghost atoms around domain
* only creates mapping and coordinate corrections * only creates mapping and coordinate corrections
* that are then enforced in updatePbc */ * that are then enforced in updatePbc */
#define ADDGHOST(dx,dy,dz) Nghost++; BorderMap[Nghost] = i; PBCx[Nghost] = dx; PBCy[Nghost] = dy; PBCz[Nghost] = dz; #define ADDGHOST(dx,dy,dz) \
Nghost++; \
BorderMap[Nghost] = i; \
PBCx[Nghost] = dx; \
PBCy[Nghost] = dy; \
PBCz[Nghost] = dz;
void setupPbc(Atom *atom, Parameter *param) void setupPbc(Atom *atom, Parameter *param)
{ {
MD_FLOAT xprd = param->xprd; MD_FLOAT xprd = param->xprd;