Skip to content

Commit

Permalink
Merge pull request NCAR#41 from climbfuji/update_gsd_develop_from_dev…
Browse files Browse the repository at this point in the history
…elop_20200903

Update gsd/develop from develop 2020/10/01
  • Loading branch information
DomHeinzeller authored Oct 2, 2020
2 parents 05a5f1f + a745b79 commit d45d46b
Show file tree
Hide file tree
Showing 295 changed files with 5,229 additions and 4,687 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
.git
.gitignore
tests/*.log
tests/log_ut_linux.gnu
8 changes: 2 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
Provide a detailed description of what this PR does.
What bug does it fix, or what feature does it add?
Is a change of answers expected from this PR?


Are any library updates included in this PR (modulefiles etc.)?

### Issue(s) addressed

Expand All @@ -14,15 +13,12 @@ Link the issues to be closed with this PR, whether in this repository, or in ano
- fixes #<issue_number>
- fixes noaa-emc/fv3atm/issues/<issue_number>



## Testing

How were these changes tested?
What compilers / HPCs was it tested with?
Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)


Have regression tests and unit tests (utests) been run? On which platforms and with which compilers? (Note that unit tests can only be run on tier-1 platforms)

## Dependencies

Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Pull Request Tests

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
setup:
name: Set up
runs-on: ubuntu-latest

outputs:
tn: ${{ steps.parse.outputs.tn }}
bld: ${{ steps.parse.outputs.bld }}
test: ${{ steps.parse.outputs.test }}
img: ${{ steps.parse.outputs.img }}

steps:
- name: Checkout codes
uses: actions/checkout@v2

- name: Parse cases
id: parse
run: |
cd ${GITHUB_WORKSPACE}/tests/ci
parsed_output=( $(./parse.sh) )
name_=${parsed_output[0]}
bld_=${parsed_output[1]}
test_=${parsed_output[2]}
img_=${parsed_output[3]}
echo "::set-output name=tn::$name_"
echo "::set-output name=bld::$bld_"
echo "::set-output name=test::$test_"
echo "::set-output name=img::$img_"
echo "test name : $name_"
echo "build set : $bld_"
echo "test set : $test_"
echo "image name: $img_"
build:
name: Build (${{ matrix.bld_set }})
needs: setup
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.bld) }}

steps:
- name: Checkout codes
uses: actions/checkout@v2
with:
submodules: recursive

- name: Build
run: |
printf '{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json >/dev/null
sudo systemctl restart docker
sleep 10
cd tests/ci && ./ci.sh -n ${{ needs.setup.outputs.tn }} -b ${{ matrix.bld_set }}
- name: Free up disk space
run: |
sudo docker rmi $(sudo docker image ls | grep -E -m1 '<none>' | awk '{ print $3 }')
sudo docker rmi $(sudo docker image ls | awk '/ci-test-base/ { print $3 }')
- name: Prepare artifacts
run: |
cd tests/ci
sudo docker save ${{ needs.setup.outputs.img }} | gzip >${{ needs.setup.outputs.img }}.tar.gz
tar cvjf artifact.tar.bz2 ${{ needs.setup.outputs.img }}.tar.gz ci.sh ci.test
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.bld_set }}.artifact.tar.bz2
path: tests/ci/artifact.tar.bz2

utest:
name: Unit test (${{ needs.setup.outputs.tn }}, ${{ matrix.test_set }})
needs: [setup,build]
runs-on: ubuntu-latest
#runs-on: self-hosted

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.test) }}

steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ matrix.artifact }}.artifact.tar.bz2

- name: Prepare artifacts
run: |
tar xvjf artifact.tar.bz2 && rm -f artifact.tar.bz2
sudo docker load --input ${{ needs.setup.outputs.img }}.tar.gz && rm -f ${{ needs.setup.outputs.img }}.tar.gz
- name: Run utest
run: ./ci.sh -n ${{ needs.setup.outputs.tn }} -r ${{ matrix.test_set }}

- name: Upload memory usage file
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: memory_stat_${{ matrix.test_set }}
path: memory_stat

- name: Clean up
if: ${{ always() }}
run: |
rm -f ci.sh ci.test
sudo docker rm my-container && sudo docker rmi ${{ needs.setup.outputs.img }}:latest
sudo docker volume rm DataVolume
54 changes: 54 additions & 0 deletions .github/workflows/manage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Manage workflows

on:
workflow_run:
workflows: ["Pull Request Tests"]
types:
- requested

jobs:
job1:
name: Job 1
runs-on: ubuntu-latest

steps:
- name: Checkout codes
uses: actions/checkout@v2

- name: Check if skip-ci is requested
run: |
cd ${GITHUB_WORKSPACE}/tests/ci
repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs"
tr_id=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_id)
tr_br=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_br)
check=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py check_skip)
echo "::set-env name=TRIGGER_ID::${tr_id}"
echo "::set-env name=TRIGGER_BR::${tr_br}"
echo "skip-ci: ${check}"
if [[ $check == yes ]]; then
echo "skip-ci is requested"
echo '::set-env name=CURR_JOB::cancelled'
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$tr_id/cancel
else
echo '::set-env name=CURR_JOB::running'
fi
- name: Cancel redundant jobs
run: |
echo "CURR_JOB is $CURR_JOB"
echo "TRIGGER_ID is $TRIGGER_ID"
echo "TRIGGER_BR is $TRIGGER_BR"
export GITHUB_ACTOR
export GITHUB_RUN_ID
export TRIGGER_ID
export TRIGGER_BR
cd ${GITHUB_WORKSPACE}/tests/ci
repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs"
cancel_ids=$(curl -H "Accept: application/vnd.github.v3+json" ${repo} | ./json_helper.py cancel_workflow)
echo "cancel ids: $cancel_ids"
if [[ $cancel_ids != '' ]]; then
for i in $cancel_ids; do
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$i/cancel
done
fi
if: ${{ env.CURR_JOB == 'running' }}
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set(AVX2 ON CACHE BOOL "Enable AVX2 instruction set")
set(SIMDMULTIARCH OFF CACHE BOOL "Enable multi-target SIMD instruction sets")
set(CCPP ON CACHE BOOL "Enable CCPP")
set(DEBUG OFF CACHE BOOL "Enable DEBUG mode")
set(DEBUG_LINKMPI ON CACHE BOOL "Enable linkmpi option when DEBUG mode is on")
set(INLINE_POST OFF CACHE BOOL "Enable inline post")
set(MULTI_GASES OFF CACHE BOOL "Enable MULTI_GASES")
set(OPENMP ON CACHE BOOL "Enable OpenMP threading")
Expand All @@ -46,6 +47,7 @@ message("AVX2 ............. ${AVX2}")
message("SIMDMULTIARCH ${SIMDMULTIARCH}")
message("CCPP ............. ${CCPP}")
message("DEBUG ............ ${DEBUG}")
message("DEBUG_LINKMPI .... ${DEBUG_LINKMPI}")
message("INLINE_POST ...... ${INLINE_POST}")
message("MULTI_GASES ...... ${MULTI_GASES}")
message("OPENMP ........... ${OPENMP}")
Expand Down Expand Up @@ -108,7 +110,8 @@ if(CCPP)

if(DEFINED CCPP_SUITES)
message("Calling CCPP code generator (ccpp_prebuild.py) for SUITES = ${CCPP_SUITES}")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
execute_process(COMMAND ${Python_EXECUTABLE}
"FV3/ccpp/framework/scripts/ccpp_prebuild.py"
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--suites=${CCPP_SUITES}"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
Expand All @@ -119,7 +122,8 @@ if(CCPP)
)
else()
message("Calling CCPP code generator (ccpp_prebuild.py) ...")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
execute_process(COMMAND ${Python_EXECUTABLE}
"FV3/ccpp/framework/scripts/ccpp_prebuild.py"
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion FV3
Submodule FV3 updated from 4e6475 to 4a64b7
2 changes: 1 addition & 1 deletion WW3
Submodule WW3 updated 422 files
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
set -eu

MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
if [[ $(uname -s) == Darwin ]]; then
readonly MYDIR=$(cd "$(dirname "$(greadlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
else
readonly MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
fi

export CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-mpicc}
export CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER:-mpicxx}
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindESMF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if (ESMF_FOUND)
set(ESMF_INTERFACE_LINK_LIBRARIES "")
else()
# When linking the static library, also need the ESMF linker flags; strip any leading/trailing whitespaces
string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES)
string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES)
message(STATUS "Found ESMF library: ${esmf_lib}")
endif()

Expand Down
3 changes: 3 additions & 0 deletions cmake/FindNetCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ foreach( _comp IN LISTS _search_components )
IMPORTED_LOCATION ${NetCDF_${_comp}_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES "${NetCDF_${_comp}_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} )
if( NOT _comp MATCHES "^(C)$" )
target_link_libraries(NetCDF::NetCDF_${_comp} INTERFACE NetCDF::NetCDF_C)
endif()
endif()
endif()
endforeach()
Expand Down
7 changes: 5 additions & 2 deletions cmake/GNU.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -ffree-line-length-none -fno-range-check -fbacktrace")

if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()

if(DEBUG)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O0 -ggdb")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -ggdb")
add_definitions(-DDEBUG)
elseif(REPRO)
if (APPLE)
Expand Down
7 changes: 7 additions & 0 deletions cmake/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ if(REPRO)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -debug minimal")
elseif(DEBUG)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -traceback -ftrapuv")
if(DEBUG_LINKMPI)
if(OPENMP)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -link_mpi=dbg_mt")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -link_mpi=dbg")
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -ftrapuv -traceback")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3")
Expand Down
2 changes: 1 addition & 1 deletion cmake/configure_cheyenne.gnu.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
1 change: 1 addition & 0 deletions cmake/configure_cheyenne.intel.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(DEBUG_LINKMPI OFF CACHE BOOL "Enable linkmpi option when DEBUG mode is on" FORCE)
1 change: 1 addition & 0 deletions cmake/configure_gaea.intel.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(DEBUG_LINKMPI OFF CACHE BOOL "Enable linkmpi option when DEBUG mode is on" FORCE)
3 changes: 2 additions & 1 deletion cmake/configure_hera.gnu.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
2 changes: 2 additions & 0 deletions cmake/configure_wcoss_cray.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
set(DEBUG_LINKMPI OFF CACHE BOOL "Enable linkmpi option when DEBUG mode is on" FORCE)
9 changes: 3 additions & 6 deletions conf/configure.fv3.cheyenne.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ include $(ESMFMKFILE)
ESMF_INC = $(ESMF_F90COMPILEPATHS)

NEMSIOINC = -I$(NEMSIO_INC)
NCEPLIBS = $(NEMSIO_LIB) $(BACIO_LIB4) $(SP_LIBd) $(W3EMC_LIBd) $(W3NCO_LIBd)
NCEPLIBS = $(POST_LIB) $(NEMSIO_LIB) $(G2_LIB4) $(G2TMPL_LIB) $(BACIO_LIB4) $(SP_LIBd) $(W3EMC_LIBd) $(W3NCO_LIBd) $(CRTM_LIB) -lpng -ljasper -lz
# $(PNG_LIB) $(JASPER_LIB) $(Z_LIB)

##############################################
# Need to use at least GNU Make version 3.81 #
Expand All @@ -89,18 +90,14 @@ CFLAGS := $(INCLUDE)
FFLAGS := $(INCLUDE) -fcray-pointer -ffree-line-length-none -fno-range-check -fbacktrace

CPPDEFS += -Duse_libMPI -Duse_netCDF -DSPMD -DUSE_LOG_DIAG_FIELD_INFO -DUSE_GFSL63 -DGFS_PHYS -Duse_WRTCOMP
CPPDEFS += -DNEW_TAUCTMAX -DINTERNAL_FILE_NML -DNO_INLINE_POST
CPPDEFS += -DNEW_TAUCTMAX -DINTERNAL_FILE_NML

ifeq ($(HYDRO),Y)
CPPDEFS +=
else
CPPDEFS += -DMOIST_CAPPA -DUSE_COND
endif

ifeq ($(NAM_phys),Y)
CPPDEFS += -DNAM_phys
endif

ifeq ($(32BIT),Y)
CPPDEFS += -DOVERLOAD_R4 -DOVERLOAD_R8
FFLAGS +=
Expand Down
Loading

0 comments on commit d45d46b

Please sign in to comment.