Skip to content

Commit

Permalink
Convert all regression tests to use ESMF managed threading (ufs-commu…
Browse files Browse the repository at this point in the history
…nity#1523)

* Convert all regression tests to use esmf-managed threading

* update CMakeLists.txt

* update rt.conf

* Comment out unneeded steps in workflows/aux.yml

* turn off control_c384 on cheyenne: all others passed

Co-authored-by: Bin.Li <[email protected]>
Co-authored-by: Brian Curtis <[email protected]>
Co-authored-by: jkbk2004 <[email protected]>
  • Loading branch information
4 people authored Dec 23, 2022
1 parent edc063e commit 5c5827d
Show file tree
Hide file tree
Showing 100 changed files with 4,343 additions and 4,107 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/aux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ jobs:
name: Preprocess
runs-on: ubuntu-20.04

steps:
- name: Share helper id
run: echo -n ${{ github.run_id }} >~/id_file

- uses: actions/cache@v2
with:
path: ~/id_file
key: helperid-${{ github.event.workflow_run.id }}

- name: Delete run-ci label
run: |
head_sha=${{ github.event.workflow_run.head_sha }}
url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
pr_number=$(curl -sS -H $app $url/pulls \
| jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
echo "pr_number is $pr_number"
curl -sS -X DELETE -H $app -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
$url/issues/$pr_number/labels/run-ci
# steps:
# - name: Share helper id
# run: echo -n ${{ github.run_id }} >~/id_file
#
# - uses: actions/cache@v2
# with:
# path: ~/id_file
# key: helperid-${{ github.event.workflow_run.id }}
#
# - name: Delete run-ci label
# run: |
# head_sha=${{ github.event.workflow_run.head_sha }}
# url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
# pr_number=$(curl -sS -H $app $url/pulls \
# | jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
# echo "pr_number is $pr_number"
# curl -sS -X DELETE -H $app -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# $url/issues/$pr_number/labels/run-ci


repocheck:
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/Modules)
###############################################################################

# Valid applications and choices
list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATML LND S2S S2SA S2SW S2SWA S2SWAL HAFS HAFSW HAFS-ALL NG-GODAS MS2SWA)
list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATML LND S2S S2SA S2SW S2SWA S2SWAL HAFS HAFSW HAFS-ALL NG-GODAS)
set(APP NONE CACHE BOOL "Application Name")
if(NOT (APP IN_LIST VALID_APPS))
message(FATAL_ERROR "${APP} is not a valid application.\nValid Applications are: ${VALID_APPS}")
Expand Down Expand Up @@ -124,10 +124,10 @@ if(FMS)
find_package(FMS 2022.04 REQUIRED COMPONENTS R4 R8)
if(APP MATCHES "^(HAFSW)$")
add_library(fms ALIAS FMS::fms_r4)
elseif (APP MATCHES "^(MS2SWA)$")
elseif (APP MATCHES "^(S2S|S2SA|S2SW|S2SWA|S2SWAL|NG-GODAS)$")
add_library(fms ALIAS FMS::fms_r8)
endif()
if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMW|ATML|LND|S2S|S2SA|S2SW|S2SWA|S2SWAL|HAFS|HAFS-ALL|NG-GODAS)$")
if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMW|ATML|LND|HAFS|HAFS-ALL)$")
if(32BIT)
add_library(fms ALIAS FMS::fms_r4)
else()
Expand Down
6 changes: 3 additions & 3 deletions cmake/configure_apps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ if(APP MATCHES "^(NG-GODAS)$")
message("Configuring UFS app in (CDEPS) Data Atmosphere mode")
endif()

if(APP MATCHES "^(S2S|S2SA|S2SW|S2SWA|S2SWAL|MS2SWA)$")
if(APP MATCHES "^(S2S|S2SA|S2SW|S2SWA|S2SWAL)$")
set(APP_MSG "Configuring UFS app in S2S")
set(CMEPS ON CACHE BOOL "Enable CMEPS" FORCE)
set(FMS ON CACHE BOOL "Enable FMS" FORCE)
set(FV3 ON CACHE BOOL "Enable FV3" FORCE)
set(MOM6 ON CACHE BOOL "Enable MOM6" FORCE)
set(CICE6 ON CACHE BOOL "Enable CICE6" FORCE)
set(STOCH_PHYS ON CACHE BOOL "Enable Stochastic Physics" FORCE)
if(APP MATCHES "^(S2SW|S2SWA|S2SWAL|MS2SWA)")
if(APP MATCHES "^(S2SW|S2SWA|S2SWAL)")
set(WW3 ON CACHE BOOL "Enable WAVEWATCH III" FORCE)
string(CONCAT APP_MSG ${APP_MSG} " with Waves")
endif()
if(APP MATCHES "^(S2SA|S2SWA|MS2SWA)")
if(APP MATCHES "^(S2SA|S2SWA)")
set(UFS_GOCART ON CACHE BOOL "Enable GOCART" FORCE)
string(CONCAT APP_MSG ${APP_MSG} " with Aerosols")
endif()
Expand Down
13 changes: 3 additions & 10 deletions driver/UFSDriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ MODULE UFSDriver
Driver_label_SetRunSequence => label_SetRunSequence, &
Driver_label_SetRunClock => label_SetRunClock
use NUOPC_Connector, only: conSS => SetServices
use NUOPC_Model, only: SetVM

! - Handle build time ATM options:
#ifdef FRONT_FV3
use FRONT_FV3, only: FV3_SS => SetServices
Expand Down Expand Up @@ -377,17 +379,8 @@ subroutine SetModelServices(driver, rc)
#endif
#ifdef FRONT_HYCOM
if (trim(model) == "hycom") then
!TODO: Remove bail code and pass info and SetVM to DriverAddComp
!TODO: once component supports threading.
if (ompNumThreads > 1) then
write (msg, *) "ESMF-aware threading NOT implemented for model: "//&
trim(model)
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msg, line=__LINE__, &
file=__FILE__, rcToReturn=rc)
return ! bail out
endif
call NUOPC_DriverAddComp(driver, trim(prefix), HYCOM_SS, &
petList=petList, comp=comp, rc=rc)
SetVM, info=info, petList=petList, comp=comp, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
found_comp = .true.
end if
Expand Down
Loading

0 comments on commit 5c5827d

Please sign in to comment.