Skip to content

Commit

Permalink
add an option to allow GSI to compile using specific kJet optimization (
Browse files Browse the repository at this point in the history
  • Loading branch information
guoqing-noaa authored Sep 3, 2021
1 parent c762340 commit fb2c427
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ project(GSI)
option(BUILD_REG_TESTING "Build the Regression Testing Suite" ON)
option(BUILD_UNIT_TESTING "Build the Unit Testing Suite" OFF)
option(BUILD_GSDCLOUD_ARW "Build the GSD cloud analysis " OFF)
option(BUILD_KJET "Build GSI using kJet specific optimization " OFF)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
Expand Down
6 changes: 3 additions & 3 deletions cmake/Modules/platforms/Generic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ macro (setGeneric)
message("Setting paths for Generic System")
option(FIND_HDF5 "Try to Find HDF5 libraries" OFF)
option(FIND_HDF5_HL "Try to Find HDF5 libraries" OFF)
if(EXISTS /jetmon)
set(HOST_FLAG "" CACHE INTERNAL "Host Flag") ## default, no host_flag required
if(EXISTS /jetmon AND BUILD_KJET)
set(HOST_FLAG "-qopt-zmm-usage=high -axCORE-AVX512 -align array64byte" CACHE INTERNAL "Host Flag") ## default, no host_flag required
else()
set(HOST_FLAG "" CACHE INTERNAL "Host Flag") ## default, no host_flag required
endif()
set(MKL_FLAG "-mkl" CACHE INTERNAL "MKL Flag")
set(GSI_Intel_Platform_FLAGS "-DPOUND_FOR_STRINGIFY -O3 -fp-model source -assume byterecl -convert big_endian -g -traceback -D_REAL8_ ${OpenMP_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAGS}" CACHE INTERNAL "GSI Fortran Flags")
set(GSI_Intel_Platform_FLAGS "${HOST_FLAG} -DPOUND_FOR_STRINGIFY -O3 -fp-model source -assume byterecl -convert big_endian -g -traceback -D_REAL8_ ${OpenMP_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAGS}" CACHE INTERNAL "GSI Fortran Flags")
set(ENKF_Platform_FLAGS "-O3 ${HOST_FLAG} -warn all -implicitnone -traceback -fp-model strict -convert big_endian -DGFS -D_REAL8_ ${OpenMP_Fortran_FLAGS}" CACHE INTERNAL "ENKF Fortran Flags")

message("setting values for corelibs")
Expand Down
13 changes: 11 additions & 2 deletions ush/build.comgsi
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,21 @@ git log -1 | head -n1 >> output.log
echo -e "\ngit status:" >> output.log
git status >> output.log
echo -e "\nCompiling commands:" >> output.log

BUILD_KJET=OFF
if [[ ! -z $1 ]]; then
case $1 in
kjet|kJet|KJET|Kjet|kJET)
BUILD_KJET=ON
;;
esac
fi
echo " cmake -DCOMGSI=ON -DENKF_MODE=WRF -DBUILD_GSDCLOUD_ARW=ON -DBUILD_ENKF_PREPROCESS_ARW=ON -DBUILD_UTIL_COM=ON .." >> output.log
echo " -DBUILD_KJET=${BUILD_KJET}" >> output.log
echo " make -j8" >> output.log
cat output.log


cmake -DCOMGSI=ON -DENKF_MODE=WRF -DBUILD_GSDCLOUD_ARW=ON -DBUILD_ENKF_PREPROCESS_ARW=ON -DBUILD_UTIL_COM=ON .. 2>&1 | tee output.cmake
cmake -DCOMGSI=ON -DENKF_MODE=WRF -DBUILD_GSDCLOUD_ARW=ON -DBUILD_ENKF_PREPROCESS_ARW=ON -DBUILD_UTIL_COM=ON -DBUILD_KJET=${BUILD_KJET} .. 2>&1 | tee output.cmake
make -j 8 2>&1 | tee output.compile

###aftermath
Expand Down

0 comments on commit fb2c427

Please sign in to comment.