Add OpenMP parallelization for computeForce.

This commit is contained in:
Jan Eitzinger 2020-08-19 11:19:16 +02:00
parent a0acce6cb3
commit 0fd51e8a9c
2 changed files with 3 additions and 2 deletions

View File

@ -7,11 +7,11 @@ ANSI_CFLAGS += -std=c99
ANSI_CFLAGS += -pedantic
ANSI_CFLAGS += -Wextra
CFLAGS = -Ofast $(ANSI_CFLAGS) #-g
CFLAGS = -Ofast $(ANSI_CFLAGS) -Xpreprocessor -fopenmp #-g
ASFLAGS = -masm=intel
CXXFLAGS = $(CFLAGS)
FCFLAGS =
LFLAGS =
DEFINES = -D_GNU_SOURCE -DALIGNMENT=64
INCLUDES =
LIBS =
LIBS = -lomp

View File

@ -156,6 +156,7 @@ double computeForce(Parameter *param, Atom *atom, Neighbor *neighbor)
fz[i] = 0.0;
}
#pragma omp parallel for
for(int i = 0; i < Nlocal; i++) {
neighs = &neighbor->neighbors[i * neighbor->maxneighs];
int numneighs = neighbor->numneigh[i];