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
*.d
# Data Files
*.bwc
*.eas
# Object files
*.o
*.ko
@ -135,9 +131,13 @@ share/python-wheels/
MANIFEST
# Files and Archives
.eas
.npz
.zip
*.eas
*.npz
*.zip
*.bwc
# Profiling assets
valgrind-out.txt
# PyInstaller
# 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 #
# 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)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")

View File

@ -54,6 +54,7 @@
.PHONY: tool
.PHONY: profiling
.PHONY: omp
.PHONY: eas3
.PHONY: netCDF
@ -80,6 +81,8 @@ BUILD_TOOL="False"
BUILD_PROF="False"
BUILD_OMP="False"
BUILD_EAS3="False"
BUILD_NETCDF="False"
@ -138,6 +141,8 @@ help:
@echo ""
@echo " profiling Enable Profiling."
@echo ""
@echo " omp Enable OpenMP parallelization."
@echo ""
@echo " eas3 Adds support for the eas3 file format to the com-"
@echo " mand line tool."
@echo ""
@ -166,11 +171,17 @@ tool:
$(eval BUILD_TOOL="True")
#*--------------------------------------------------------*#
# Define target used to activate command line tool build. #
# Define target used to activate profiling. #
#*--------------------------------------------------------*#
profiling:
$(eval BUILD_PROF="True")
#*--------------------------------------------------------*#
# Define target used to activate OpenMP parallelization. #
#*--------------------------------------------------------*#
omp:
$(eval BUILD_OMP="True")
#*--------------------------------------------------------*#
# Define targets used to activate file format support. #
#*--------------------------------------------------------*#
@ -222,7 +233,7 @@ display:
# Define the main compile command targets. #
#*--------------------------------------------------------*#
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:
- /bin/rm -rf build/ bin/ lib/ lib64/ include/library/public