Fix bugs and improve build system
Fix bug if ANIMATE define is set Move all defines to config.mk Add clangd generation in Makefile Move ICC to ICX config
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -53,3 +53,5 @@ Module.symvers
|
|||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
PoissonSolver/2D-seq/.cache/clangd/index
|
||||||
|
PoissonSolver/2D-seq/compile_commands.json
|
||||||
|
|||||||
3
PoissonSolver/2D-seq/.clangd
Normal file
3
PoissonSolver/2D-seq/.clangd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
CompileFlags:
|
||||||
|
Add: [-D_GNU_SOURCE,-DANIMATE,-DARRAY_ALIGNMENT=64,-I./src/includes,-I./CLANG, -Ofast,-std=c99, -xc]
|
||||||
|
Compiler: clang
|
||||||
@@ -21,8 +21,16 @@ VPATH = $(SRC_DIR)
|
|||||||
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c))
|
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c))
|
||||||
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
||||||
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
||||||
|
c := ,
|
||||||
|
clist = $(subst $(eval) ,$c,$(strip $1))
|
||||||
|
|
||||||
${TARGET}: $(BUILD_DIR) $(OBJ)
|
define CLANGD_TEMPLATE
|
||||||
|
CompileFlags:
|
||||||
|
Add: [$(call clist,$(CPPFLAGS)), $(call clist,$(CFLAGS)), -xc]
|
||||||
|
Compiler: clang
|
||||||
|
endef
|
||||||
|
|
||||||
|
${TARGET}: $(BUILD_DIR) .clangd $(OBJ)
|
||||||
$(info ===> LINKING $(TARGET))
|
$(info ===> LINKING $(TARGET))
|
||||||
$(Q)${LINKER} ${LFLAGS} -o $(TARGET) $(OBJ) $(LIBS)
|
$(Q)${LINKER} ${LFLAGS} -o $(TARGET) $(OBJ) $(LIBS)
|
||||||
|
|
||||||
@@ -59,4 +67,7 @@ tags:
|
|||||||
$(BUILD_DIR):
|
$(BUILD_DIR):
|
||||||
@mkdir $(BUILD_DIR)
|
@mkdir $(BUILD_DIR)
|
||||||
|
|
||||||
|
.clangd:
|
||||||
|
$(file > .clangd,$(CLANGD_TEMPLATE))
|
||||||
|
|
||||||
-include $(OBJ:.o=.d)
|
-include $(OBJ:.o=.d)
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
# Supported: GCC, CLANG, ICC
|
# Supported: CLANG, CLANG, ICX
|
||||||
TAG ?= CLANG
|
TAG ?= GCC
|
||||||
|
|
||||||
#Feature options
|
#Feature options
|
||||||
OPTIONS += -DARRAY_ALIGNMENT=64
|
OPTIONS += -DARRAY_ALIGNMENT=64
|
||||||
#OPTIONS += -DVERBOSE_AFFINITY
|
#OPTIONS += -DANIMATE
|
||||||
#OPTIONS += -DVERBOSE_DATASIZE
|
#OPTIONS += -DDEBUG
|
||||||
#OPTIONS += -DVERBOSE_TIMER
|
#OPTIONS += -DVERBOSE_AFFINITY
|
||||||
|
#OPTIONS += -DVERBOSE_DATASIZE
|
||||||
|
#OPTIONS += -DVERBOSE_TIMER
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ LIBS = # -lomp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
VERSION = --version
|
VERSION = --version
|
||||||
CFLAGS = -Ofast -std=c99 $(OPENMP)
|
CFLAGS = -O3 -ffast-math -std=c99 $(OPENMP)
|
||||||
#CFLAGS = -Ofast -fnt-store=aggressive -std=c99 $(OPENMP) #AMD CLANG
|
|
||||||
LFLAGS = $(OPENMP) -lm
|
LFLAGS = $(OPENMP) -lm
|
||||||
DEFINES = -D_GNU_SOURCE
|
DEFINES = -D_GNU_SOURCE
|
||||||
DEFINES += -DANIMATE
|
|
||||||
# DEFINES += -DDEBUG
|
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ OPENMP = -fopenmp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
VERSION = --version
|
VERSION = --version
|
||||||
CFLAGS = -Ofast -ffreestanding -std=c99 $(OPENMP)
|
CFLAGS = -O3 -ffast-math -ffreestanding -std=c99 $(OPENMP)
|
||||||
LFLAGS = $(OPENMP)
|
LFLAGS = $(OPENMP)
|
||||||
DEFINES = -D_GNU_SOURCE
|
DEFINES = -D_GNU_SOURCE
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
LIBS =
|
LIBS = -lm
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
CC = icc
|
CC = icx
|
||||||
GCC = gcc
|
GCC = gcc
|
||||||
LINKER = $(CC)
|
LINKER = $(CC)
|
||||||
|
|
||||||
@@ -7,7 +7,8 @@ OPENMP = -qopenmp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
VERSION = --version
|
VERSION = --version
|
||||||
CFLAGS = -O3 -xHost -qopt-zmm-usage=high -std=c99 $(OPENMP)
|
CFLAGS = -O3 -xHost -std=c99 $(OPENMP)
|
||||||
|
#CFLAGS += -qopt-zmm-usage=high #on CPUs with AVX512 support
|
||||||
LFLAGS = $(OPENMP)
|
LFLAGS = $(OPENMP)
|
||||||
DEFINES = -D_GNU_SOURCE
|
DEFINES = -D_GNU_SOURCE
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
@@ -2,12 +2,10 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Use of this source code is governed by a MIT-style
|
* Use of this source code is governed by a MIT-style
|
||||||
* license that can be found in the LICENSE file. */
|
* license that can be found in the LICENSE file. */
|
||||||
|
#include "parameter.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
//---
|
|
||||||
#include "parameter.h"
|
|
||||||
#include "util.h"
|
|
||||||
#define MAXLINE 4096
|
#define MAXLINE 4096
|
||||||
|
|
||||||
void initParameter(Parameter* param)
|
void initParameter(Parameter* param)
|
||||||
@@ -35,7 +33,10 @@ void readParameter(Parameter* param, const char* filename)
|
|||||||
|
|
||||||
while (!feof(fp)) {
|
while (!feof(fp)) {
|
||||||
line[0] = '\0';
|
line[0] = '\0';
|
||||||
fgets(line, MAXLINE, fp);
|
if (fgets(line, MAXLINE, fp) == NULL && ferror(fp) != 0) {
|
||||||
|
fprintf(stderr, "Error in fgets function\n");
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; line[i] != '\0' && line[i] != '#'; i++)
|
for (i = 0; line[i] != '\0' && line[i] != '#'; i++)
|
||||||
;
|
;
|
||||||
line[i] = '\0';
|
line[i] = '\0';
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ void solveRB(Solver* solver)
|
|||||||
int it = 0;
|
int it = 0;
|
||||||
double res = 1.0;
|
double res = 1.0;
|
||||||
int pass, jsw, isw;
|
int pass, jsw, isw;
|
||||||
|
char filename[20];
|
||||||
|
|
||||||
while ((res >= epssq) && (it < itermax)) {
|
while ((res >= epssq) && (it < itermax)) {
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
@@ -198,6 +199,7 @@ void solveRBA(Solver* solver)
|
|||||||
double res = 1.0;
|
double res = 1.0;
|
||||||
int pass, jsw, isw;
|
int pass, jsw, isw;
|
||||||
double omega = 1.0;
|
double omega = 1.0;
|
||||||
|
char filename[20];
|
||||||
|
|
||||||
while ((res >= epssq) && (it < itermax)) {
|
while ((res >= epssq) && (it < itermax)) {
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user