diff --git a/.github/workflows/build_and_lint.yml b/.github/workflows/build_and_lint.yml index 0ea34c687..d0a42529f 100644 --- a/.github/workflows/build_and_lint.yml +++ b/.github/workflows/build_and_lint.yml @@ -88,9 +88,6 @@ jobs: - name: Display tidy_results_cpp.log if: ${{ (matrix.container.name == 'CUDA') && (always()) }} run: cat tidy_results_cpp.log - - name: Display tidy_results_c.log - if: ${{ (matrix.container.name == 'CUDA') && (always()) }} - run: cat tidy_results_c.log - name: Display tidy_results_gpu.log if: ${{ (matrix.container.name == 'CUDA') && (always()) }} run: cat tidy_results_gpu.log diff --git a/Makefile b/Makefile index 782eaf71c..302654aac 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,11 @@ DIRS := src src/analysis src/chemistry_gpu src/cooling src/cooling_grackle s SUFFIX ?= .$(TYPE).$(MACHINE) -CFILES := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.c)) CPPFILES := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.cpp)) GPUFILES := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.cu)) # Build a list of all potential object files so cleaning works properly -CLEAN_OBJS := $(subst .c,.o,$(CFILES)) \ - $(subst .cpp,.o,$(CPPFILES)) \ +CLEAN_OBJS := $(subst .cpp,.o,$(CPPFILES)) \ $(subst .cu,.o,$(GPUFILES)) # Check if it should include testing flags @@ -49,30 +47,24 @@ ifeq ($(ADD_TEST_FLAGS), yes) SUFFIX := $(strip $(SUFFIX)).tests LIBS += -L$(GOOGLETEST_ROOT)/lib64 -pthread -lgtest -lhdf5_cpp TEST_FLAGS = -I$(GOOGLETEST_ROOT)/include - CFLAGS += $(TEST_FLAGS) CXXFLAGS += $(TEST_FLAGS) GPUFLAGS += $(TEST_FLAGS) else # This isn't a test build so clear out testing related files - CFILES := $(filter-out src/system_tests/% %_tests.c,$(CFILES)) CPPFILES := $(filter-out src/system_tests/% %_tests.cpp,$(CPPFILES)) CPPFILES := $(filter-out src/utils/testing_utilities.cpp,$(CPPFILES)) GPUFILES := $(filter-out src/system_tests/% %_tests.cu,$(GPUFILES)) endif -OBJS := $(subst .c,.o,$(CFILES)) \ - $(subst .cpp,.o,$(CPPFILES)) \ +OBJS := $(subst .cpp,.o,$(CPPFILES)) \ $(subst .cu,.o,$(GPUFILES)) #-- Set default compilers and flags -CC ?= cc CXX ?= CC -CFLAGS_OPTIMIZE ?= -g -Ofast CXXFLAGS_OPTIMIZE ?= -g -Ofast -std=c++17 GPUFLAGS_OPTIMIZE ?= -g -O3 -std=c++17 -CFLAGS_DEBUG ?= -g -O0 CXXFLAGS_DEBUG ?= -g -O0 -std=c++17 ifdef HIPCONFIG GPUFLAGS_DEBUG ?= -g -O0 -std=c++17 @@ -82,13 +74,11 @@ endif BUILD ?= OPTIMIZE -CFLAGS += $(CFLAGS_$(BUILD)) CXXFLAGS += $(CXXFLAGS_$(BUILD)) GPUFLAGS += $(GPUFLAGS_$(BUILD)) #-- Add flags and libraries as needed -CFLAGS += $(DFLAGS) -Isrc CXXFLAGS += $(DFLAGS) -Isrc GPUFLAGS += $(DFLAGS) -Isrc @@ -170,7 +160,7 @@ ifeq ($(findstring -DCHEMISTRY_GPU,$(DFLAGS)),-DCHEMISTRY_GPU) DFLAGS += -DSCALAR endif -.SUFFIXES: .c .cpp .cu .o +.SUFFIXES: .cpp .cu .o EXEC := bin/cholla$(SUFFIX) @@ -184,17 +174,14 @@ DFLAGS += $(MACRO_FLAGS) LIBS_CLANG_TIDY := $(subst -I/, -isystem /,$(LIBS)) LIBS_CLANG_TIDY += -isystem $(MPI_ROOT)/include CXXFLAGS_CLANG_TIDY := $(subst -I/, -isystem /,$(LDFLAGS)) -CFLAGS_CLANG_TIDY := $(subst -I/, -isystem /,$(CFLAGS)) GPUFLAGS_CLANG_TIDY := $(subst -I/, -isystem /,$(GPUFLAGS)) GPUFLAGS_CLANG_TIDY := $(filter-out -ccbin=mpicxx -fmad=false --expt-extended-lambda,$(GPUFLAGS)) GPUFLAGS_CLANG_TIDY += --cuda-host-only --cuda-path=$(CUDA_ROOT) -isystem /clang/includes CPPFILES_TIDY := $(CPPFILES) -CFILES_TIDY := $(CFILES) GPUFILES_TIDY := $(GPUFILES) ifdef TIDY_FILES CPPFILES_TIDY := $(filter $(TIDY_FILES), $(CPPFILES_TIDY)) - CFILES_TIDY := $(filter $(TIDY_FILES), $(CFILES_TIDY)) GPUFILES_TIDY := $(filter $(TIDY_FILES), $(GPUFILES_TIDY)) endif @@ -202,9 +189,6 @@ $(EXEC): prereq-build $(OBJS) mkdir -p bin/ && $(LD) $(LDFLAGS) $(OBJS) -o $(EXEC) $(LIBS) eval $(EXTRA_COMMANDS) -%.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ - %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ @@ -221,9 +205,8 @@ tidy: # - --warnings-as-errors= Upgrade all warnings to error, good for CI clang-tidy --verify-config (time clang-tidy $(CLANG_TIDY_ARGS) $(CPPFILES_TIDY) -- $(DFLAGS) $(CXXFLAGS_CLANG_TIDY) $(LIBS_CLANG_TIDY)) > tidy_results_cpp.log 2>&1 & \ - (time clang-tidy $(CLANG_TIDY_ARGS) $(CFILES_TIDY) -- $(DFLAGS) $(CFLAGS_CLANG_TIDY) $(LIBS_CLANG_TIDY)) > tidy_results_c.log 2>&1 & \ (time clang-tidy $(CLANG_TIDY_ARGS) $(GPUFILES_TIDY) -- $(DFLAGS) $(GPUFLAGS_CLANG_TIDY) $(LIBS_CLANG_TIDY)) > tidy_results_gpu.log 2>&1 & \ - for i in 1 2 3; do wait -n; done + for i in 1 2; do wait -n; done clean: rm -f $(CLEAN_OBJS) diff --git a/builds/make.host.c3po b/builds/make.host.c3po index 02f658896..dc5e3d8eb 100644 --- a/builds/make.host.c3po +++ b/builds/make.host.c3po @@ -1,8 +1,5 @@ #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 ${F_OFFLOAD} CXXFLAGS_OPTIMIZE = -g -Ofast -std=c++17 ${F_OFFLOAD} GPUFLAGS_DEBUG = -g -G -cudart shared -O0 -std=c++17 -ccbin=mpicxx -Xcompiler -rdynamic diff --git a/builds/make.host.crc b/builds/make.host.crc index a4e87553e..e0c20e162 100644 --- a/builds/make.host.crc +++ b/builds/make.host.crc @@ -1,9 +1,6 @@ #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -Ofast CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 GPUFLAGS_OPTIMIZE = -g -O3 -std=c++17 diff --git a/builds/make.host.frontier b/builds/make.host.frontier index d9efba818..bae874c78 100644 --- a/builds/make.host.frontier +++ b/builds/make.host.frontier @@ -1,13 +1,9 @@ #-- make.host for Frontier at the OLCF with #-- Compiler and flags for different build type -CC = cc CXX = CC #GPUCXX ?= CC -x hip GPUCXX ?= hipcc -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 - CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -g -Ofast -std=c++17 -Wno-unused-result diff --git a/builds/make.host.github b/builds/make.host.github index 0dea956fc..46da09349 100644 --- a/builds/make.host.github +++ b/builds/make.host.github @@ -1,8 +1,5 @@ #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 ${F_OFFLOAD} CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 ${F_OFFLOAD} GPUFLAGS_DEBUG = -g -G -cudart shared -O0 -std=c++17 @@ -27,8 +24,6 @@ GOOGLETEST_ROOT := ${GOOGLETEST_ROOT} ifdef HIPCONFIG MPI_ROOT := ${MPI_ROOT} - CFLAGS_DEBUG += -fPIE - CFLAGS_OPTIMIZE += -fPIE CXXFLAGS_DEBUG += -fPIE CXXFLAGS_OPTIMIZE += -fPIE GPUFLAGS_DEBUG += -fPIE diff --git a/builds/make.host.lux b/builds/make.host.lux index f17986700..edf4e42c0 100644 --- a/builds/make.host.lux +++ b/builds/make.host.lux @@ -1,10 +1,7 @@ #-- make.inc for the Shamrock Server #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 GPUFLAGS = -std=c++17 diff --git a/builds/make.host.poplar b/builds/make.host.poplar index f44851847..f029e09e6 100644 --- a/builds/make.host.poplar +++ b/builds/make.host.poplar @@ -1,10 +1,7 @@ #-- make.inc for Poplar, COE cluster at HPE #-- Compiler and flags for different build type -CC = cc CXX = CC -CFLAGS_DEBUG = -g -O0 ${F_OFFLOAD} -CFLAGS_OPTIMIZE = -Ofast ${F_OFFLOAD} CXXFLAGS_DEBUG = -g -O0 -std=c++17 ${F_OFFLOAD} CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 ${F_OFFLOAD} diff --git a/builds/make.host.poplar.aomp b/builds/make.host.poplar.aomp index cac6b50b1..e87fe68e2 100644 --- a/builds/make.host.poplar.aomp +++ b/builds/make.host.poplar.aomp @@ -1,11 +1,8 @@ #-- make.inc for Poplar, COE cluster at HPE #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx HIPCONFIG = $(shell hipconfig -C) -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -Ofast CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 diff --git a/builds/make.host.poplar.cce+hip b/builds/make.host.poplar.cce+hip index 94963fb8a..b83268e12 100644 --- a/builds/make.host.poplar.cce+hip +++ b/builds/make.host.poplar.cce+hip @@ -1,11 +1,8 @@ #-- make.inc for Poplar, HPE COE cluster #-- Compiler and flags for different build type -CC = cc CXX = CC HIPCONFIG = $(shell hipconfig -C) -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -Ofast CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 diff --git a/builds/make.host.shamrock b/builds/make.host.shamrock index cc849b051..eec8d48e6 100644 --- a/builds/make.host.shamrock +++ b/builds/make.host.shamrock @@ -1,12 +1,9 @@ #-- make.inc for the Lux Cluster #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx #CC = gcc #CXX = g++ -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 diff --git a/builds/make.host.spock b/builds/make.host.spock index 8cac7c086..9dfc41676 100644 --- a/builds/make.host.spock +++ b/builds/make.host.spock @@ -1,12 +1,8 @@ #-- make.inc for Spock EAS at the OLCF with #-- Compiler and flags for different build type -CC = cc CXX = CC -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 - CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -g -Ofast -std=c++17 diff --git a/builds/make.host.summit b/builds/make.host.summit index ab1feda42..a9f5337f5 100644 --- a/builds/make.host.summit +++ b/builds/make.host.summit @@ -2,10 +2,7 @@ # https://www.olcf.ornl.gov/summit/ #-- Compiler and flags for different build type -CC = mpicc CXX = mpicxx -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 ${F_OFFLOAD} CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 ${F_OFFLOAD} GPUFLAGS_DEBUG = -g -O0 -std=c++17 -ccbin=mpicxx -G -cudart shared diff --git a/builds/make.host.tornado b/builds/make.host.tornado index e8cf09a62..cdcf5483f 100644 --- a/builds/make.host.tornado +++ b/builds/make.host.tornado @@ -1,10 +1,7 @@ #-- make.inc for the Lux Cluster #-- Compiler and flags for different build type -CC = gcc CXX = g++ -CFLAGS_DEBUG = -g -O0 -CFLAGS_OPTIMIZE = -g -O2 CXXFLAGS_DEBUG = -g -O0 -std=c++17 CXXFLAGS_OPTIMIZE = -Ofast -std=c++17 diff --git a/builds/setup.poplar.aomp.sh b/builds/setup.poplar.aomp.sh index 7b83e5ab7..d692711fe 100755 --- a/builds/setup.poplar.aomp.sh +++ b/builds/setup.poplar.aomp.sh @@ -1,12 +1,11 @@ #!/bin/bash module purge -module load craype-x86-naples craype-network-infiniband +module load craype-x86-naples craype-network-infiniband module load shared slurm module use /home/users/twhite/share/modulefiles module load ompi/4.0.4-rocm-3.9 hdf5 -export OMPI_CC=$(which clang) export OMPI_CXX=$(which clang) export CHOLLA_MACHINE=poplar.aomp diff --git a/tools/analyze_tidy_checks.py b/tools/analyze_tidy_checks.py index 0ea286920..de5c86313 100755 --- a/tools/analyze_tidy_checks.py +++ b/tools/analyze_tidy_checks.py @@ -6,7 +6,7 @@ failures a check represents. When running, make sure that you have already run clang-tidy with all the - checks you want enabled since this script looks for the 3 tidy_results_*.log + checks you want enabled since this script looks for the 2 tidy_results_*.log files in the root directory of Cholla ================================================================================ """ @@ -35,14 +35,12 @@ def main(): def loadTidyResults(chollaPath): - with open(chollaPath / "tidy_results_c.log", "r") as file: - cData = file.read() with open(chollaPath / "tidy_results_cpp.log", "r") as file: cppData = file.read() with open(chollaPath / "tidy_results_gpu.log", "r") as file: gpuData = file.read() - return cData + cppData + gpuData + return cppData + gpuData def getEnabledChecks(chollaPath):