-
Notifications
You must be signed in to change notification settings - Fork 49
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
Production de openacc test #589
Open
basava70
wants to merge
11
commits into
main
Choose a base branch
from
production_DE_openacc_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
92d3f94
Added changes so fesom2 can compile with OpenACC. Have to check the n…
59b0765
Working OpenACC code after commenting 'set(CMAKE_EXE_LINKER_FLAGS)'
ff4b425
Updated the changes regarding unneccesarry spaces and changed all ENA…
24127a9
Merge branch 'production_DE' into production_DE_openacc_test
720cff6
Updated with Miguels's comment
3389483
Now, we can compile on levante with intel and gnu
372b5de
Added suvi's changes back to env.sh (compilerId regex for levante)
624a780
Merge branch 'main' into production_DE_openacc_test
basava70 a6a0ba4
Merge branch 'main' into production_DE_openacc_test
basava70 dd467cb
Updated shell.intel and shell.nvhpc
25692cf
Merge branch 'production_DE_openacc_test' of github.com:FESOM/fesom2 …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,12 +64,13 @@ endif() | |
|
||
option(ENABLE_OPENACC "compile with OpenACC support" OFF) | ||
message(STATUS "ENABLE_OPENACC: ${ENABLE_OPENACC}") | ||
|
||
set(NV_GPU_ARCH "cc80" CACHE STRING "GPU arch for nvfortran compiler (cc35,cc50,cc60,cc70,cc80,...)") | ||
option(DISABLE_OPENACC_ATOMICS "disable kernels using atomic statement for reproducible results" ON) | ||
set(GPU_COMPUTE_CAPABILITY "cc80" CACHE STRING "GPU arch for nvfortran compiler (cc35,cc50,cc60,cc70,cc80,...)") | ||
set(GPU_FLAGS "cuda12.2,${GPU_COMPUTE_CAPABILITY}" CACHE STRING "GPU arch for nvfortran compiler (cc35,cc50,cc60,cc70,cc80,...)") | ||
|
||
option(ENABLE_OPENMP "build FESOM with OpenMP" OFF) | ||
message(STATUS "ENABLE_OPENMP: ${ENABLE_OPENMP}") | ||
if(ENABLE_OPENMP) | ||
if(${ENABLE_OPENMP}) | ||
find_package(OpenMP REQUIRED COMPONENTS Fortran) | ||
endif() | ||
|
||
|
@@ -186,7 +187,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:module/fes | |
target_link_libraries(${PROJECT_NAME} PRIVATE MPI::MPI_Fortran) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE Fortran) | ||
if(ENABLE_OPENMP) | ||
if(${ENABLE_OPENMP}) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE OpenMP::OpenMP_Fortran) | ||
endif() | ||
|
||
|
@@ -275,7 +276,7 @@ elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU ) | |
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Cray ) | ||
#target_compile_options(${PROJECT_NAME} PRIVATE -c -emf -hbyteswapio -hflex_mp=conservative -hfp1 -hadd_paren -Ounroll0 -hipa0 -r am -s real64 -N 1023 -g -G2 -O3) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -c -emf -hbyteswapio -hflex_mp=conservative -hfp1 -hadd_paren -Ounroll0 -hipa0 -r am -s real64 -N 1023 -g -G2 -O2 -hnoacc -M878) #-hnoacc is a workaround for cray automatically activate -hacc, -M878 is to suppress ftn-878 warning | ||
if(ENABLE_OPENMP) | ||
if(${ENABLE_OPENMP}) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -homp) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PRIVATE -hnoomp) | ||
|
@@ -288,13 +289,19 @@ elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Cray ) | |
endif() | ||
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL NVHPC ) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE ENABLE_NVHPC_WORKAROUNDS) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -fast -fastsse -O3 -Mallocatable=95 -Mr8 -pgf90libs) | ||
if(ENABLE_OPENACC) | ||
#target_compile_options(${PROJECT_NAME} PRIVATE -fast -fastsse -O3 -Mallocatable=95 -Mr8 -pgf90libs) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Mnofma -Mallocatable=95 -Mr8 -pgf90libs) | ||
if(${ENABLE_OPENACC}) | ||
# additional compiler settings | ||
target_compile_options(${PROJECT_NAME} PRIVATE -acc -ta=tesla:${NV_GPU_ARCH} -Minfo=accel) | ||
set(CMAKE_EXE_LINKER_FLAGS "-acc -ta=tesla:${NV_GPU_ARCH}") | ||
message("Taking ENABLE_OPENACC = ON") | ||
target_compile_options(${PROJECT_NAME} PRIVATE -acc -O2 -gpu=${GPU_FLAGS} -Minfo=accel) | ||
# set(CMAKE_EXE_LINKER_FLAGS "-acc -gpu=${GPU_FLAGS}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @suvarchal @dsidoren @mandresm |
||
if(${DISABLE_OPENACC_ATOMICS}) | ||
message("Taking DISABLE_OPENACC_ATOMICS = ON") | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE DISABLE_OPENACC_ATOMICS) | ||
endif() | ||
endif() | ||
if(ENABLE_OPENMP) | ||
if(${ENABLE_OPENMP}) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Mipa=fast) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Mipa=fast,inline) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suvarchal, this was different from a previous version that was working on Levante. @basava70 replaced this line to have a variable that contains not only
cc80
butcuda12.2,cc80
that is then passed to the-gpu
flag during compilation. Does this change make sense to you?