Added the option to enable OpenMP parallelization during debug

This commit is contained in:
Patrick Vogler 2024-06-28 11:28:34 +02:00
parent b3f594771f
commit ed91f1d15c
Signed by: Patrick Vogler
GPG key ID: 5536B08CE82E8509
3 changed files with 22 additions and 10 deletions

14
.gitignore vendored
View file

@ -2,10 +2,6 @@
# Prerequisites # Prerequisites
*.d *.d
# Data Files
*.bwc
*.eas
# Object files # Object files
*.o *.o
*.ko *.ko
@ -135,9 +131,13 @@ share/python-wheels/
MANIFEST MANIFEST
# Files and Archives # Files and Archives
.eas *.eas
.npz *.npz
.zip *.zip
*.bwc
# Profiling assets
valgrind-out.txt
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template

View file

@ -131,7 +131,8 @@ message(STATUS "Compiling with C++ standard: ${CMAKE_CXX_STANDARD}")
# Check if the OpenMP package is available for the current # # Check if the OpenMP package is available for the current #
# setup and set the appropriate C/C++ flags. # # setup and set the appropriate C/C++ flags. #
#----------------------------------------------------------# #----------------------------------------------------------#
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR ${OMP})
message(STATUS "Enable OpenMP parallelization")
find_package(OpenMP) find_package(OpenMP)
if (OPENMP_FOUND) if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")

View file

@ -54,6 +54,7 @@
.PHONY: tool .PHONY: tool
.PHONY: profiling .PHONY: profiling
.PHONY: omp
.PHONY: eas3 .PHONY: eas3
.PHONY: netCDF .PHONY: netCDF
@ -80,6 +81,8 @@ BUILD_TOOL="False"
BUILD_PROF="False" BUILD_PROF="False"
BUILD_OMP="False"
BUILD_EAS3="False" BUILD_EAS3="False"
BUILD_NETCDF="False" BUILD_NETCDF="False"
@ -138,6 +141,8 @@ help:
@echo "" @echo ""
@echo " profiling Enable Profiling." @echo " profiling Enable Profiling."
@echo "" @echo ""
@echo " omp Enable OpenMP parallelization."
@echo ""
@echo " eas3 Adds support for the eas3 file format to the com-" @echo " eas3 Adds support for the eas3 file format to the com-"
@echo " mand line tool." @echo " mand line tool."
@echo "" @echo ""
@ -166,11 +171,17 @@ tool:
$(eval BUILD_TOOL="True") $(eval BUILD_TOOL="True")
#*--------------------------------------------------------*# #*--------------------------------------------------------*#
# Define target used to activate command line tool build. # # Define target used to activate profiling. #
#*--------------------------------------------------------*# #*--------------------------------------------------------*#
profiling: profiling:
$(eval BUILD_PROF="True") $(eval BUILD_PROF="True")
#*--------------------------------------------------------*#
# Define target used to activate OpenMP parallelization. #
#*--------------------------------------------------------*#
omp:
$(eval BUILD_OMP="True")
#*--------------------------------------------------------*# #*--------------------------------------------------------*#
# Define targets used to activate file format support. # # Define targets used to activate file format support. #
#*--------------------------------------------------------*# #*--------------------------------------------------------*#
@ -222,7 +233,7 @@ display:
# Define the main compile command targets. # # Define the main compile command targets. #
#*--------------------------------------------------------*# #*--------------------------------------------------------*#
build_bwc: build_bwc:
mkdir -p build && cd build && cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DLINK:STRING=${LINK_TYPE}" "-DPREC:STRING=${BUILD_PREC}" "-DTOOL=${BUILD_TOOL}" "-DPROF=${BUILD_PROF}" "-DBUILD_EAS3=${BUILD_EAS3}" "-DBUILD_NETCDF=${BUILD_NETCDF}" && $(MAKE) -j mkdir -p build && cd build && cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DLINK:STRING=${LINK_TYPE}" "-DPREC:STRING=${BUILD_PREC}" "-DTOOL=${BUILD_TOOL}" "-DPROF=${BUILD_PROF}" "-DOMP=${BUILD_OMP}" "-DBUILD_EAS3=${BUILD_EAS3}" "-DBUILD_NETCDF=${BUILD_NETCDF}" && $(MAKE) -j
clean: clean:
- /bin/rm -rf build/ bin/ lib/ lib64/ include/library/public - /bin/rm -rf build/ bin/ lib/ lib64/ include/library/public