Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix model slowness when using threading #258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ccpp/data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ add_library(
CCPP_data.F90
)

target_link_libraries(ccppdata ccpp)
target_link_libraries(ccppdata ccppphys)
target_link_libraries(ccppdata PUBLIC ccpp)
target_link_libraries(ccppdata PUBLIC ccppphys)

if(OpenMP_Fortran_FOUND)
target_link_libraries(ccppdata PUBLIC OpenMP::OpenMP_Fortran)
endif()

target_include_directories(ccppdata PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src
${CMAKE_BINARY_DIR}/FV3/ccpp/physics)
Expand Down
12 changes: 8 additions & 4 deletions ccpp/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ add_library(
# Compile GFS_diagnostics.F90 without optimization, this leads to out of memory errors on wcoss_dell_p3
set_property(SOURCE GFS_diagnostics.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "-O0")

target_link_libraries(ccppdriver ccpp)
target_link_libraries(ccppdriver ccppphys)
target_link_libraries(ccppdriver ccppdata)
target_link_libraries(ccppdriver PUBLIC ccpp)
target_link_libraries(ccppdriver PUBLIC ccppphys)
target_link_libraries(ccppdriver PUBLIC ccppdata)

if(OpenMP_Fortran_FOUND)
target_link_libraries(ccppdriver PUBLIC OpenMP::OpenMP_Fortran)
endif()

target_include_directories(ccppdriver PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src
${CMAKE_BINARY_DIR}/FV3/ccpp/physics)

set_target_properties(ccppdriver PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_compile_definitions(ccppdata PRIVATE "${_ccppdata_defs_private}")
target_compile_definitions(ccppdriver PRIVATE "${_ccppdriver_defs_private}")
target_include_directories(ccppdriver PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>)