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

CI workflow updates and migrate container #1357

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f5a51ae
move to github container registry, add cmake link test
Aug 2, 2023
ff34d39
update coupler ci image and flags
Aug 3, 2023
7021e61
fix case and libyaml for cmake
Aug 3, 2023
588d85b
fix test cmake program
Aug 3, 2023
dccf552
adjust flags for the coupler build
Aug 3, 2023
ba93f78
add git to image recipefile
Aug 3, 2023
85a62ff
add link flag for netcdf
rem1776 Aug 3, 2023
327d76d
Merge branch 'ci-updates' of github.com:noaa-gfdl/FMS into ci-updates
Aug 4, 2023
161a077
good ol input.nml
Aug 4, 2023
2f15760
add openmp flag
rem1776 Aug 4, 2023
8c362ed
add gnu flag for mpich
rem1776 Aug 4, 2023
4ce8895
adds target flags from mkmf template
rem1776 Aug 15, 2023
3b5cc01
try setting on configure line
rem1776 Aug 16, 2023
8463353
Update github_autotools_gnu.yml
rem1776 Aug 16, 2023
792bad7
Update github_autotools_gnu.yml
rem1776 Aug 16, 2023
bd81583
add repro flag + comment
rem1776 Aug 18, 2023
f79570b
Merge branch 'main' into gnu-ci-target-flags
rem1776 Aug 18, 2023
6a515ef
add new job for dependency build and new compilers
rem1776 Aug 18, 2023
02f7240
add step for dependency install
rem1776 Aug 18, 2023
945f2c4
Merge branch 'NOAA-GFDL:main' into intel-ci-new-compilers
rem1776 Aug 21, 2023
1fa2fc8
move io matrix to right spot, remove skipped tests
rem1776 Aug 21, 2023
496b47b
Merge branch 'NOAA-GFDL:main' into intel-ci-new-compilers
rem1776 Aug 24, 2023
34ba38f
remove repro (too many jobs)
rem1776 Aug 24, 2023
ed1c710
Merge branch 'NOAA-GFDL:main' into gnu-ci-target-flags
rem1776 Aug 24, 2023
e7e7a19
Merge branch 'ci-updates' of github.com:noaa-gfdl/FMS into ci
Aug 28, 2023
3d37d3d
Merge branch 'gnu-ci-target-flags' of github.com:rem1776/FMS into ci
Aug 28, 2023
3838ca7
Merge branch 'intel-ci-new-compilers' of github.com:rem1776/FMS into ci
Aug 28, 2023
41db460
Update github_autotools_gnu.yml
rem1776 Aug 29, 2023
e8c35de
Update github_autotools_intel.yml to push trigger
rem1776 Aug 30, 2023
52e19bc
add skip for compressed write test
rem1776 Aug 30, 2023
97eb4fe
add intel target flags
rem1776 Aug 30, 2023
15e3e4a
quick fix for parser test failure
rem1776 Aug 31, 2023
e0ca287
fix for parser test and coupler, remove skips
Aug 31, 2023
e6e84d9
fix target flags
Sep 1, 2023
b96e49c
fix target flags for intel
Sep 1, 2023
19f5147
add new fix for parser, skip for ifx bug
Sep 7, 2023
7903e14
line length
Sep 7, 2023
521fc99
fix typo
rem1776 Sep 7, 2023
993a43f
typo
rem1776 Sep 7, 2023
1d0f1f3
debug configure issue
rem1776 Sep 7, 2023
092ab2f
skip remaining parser test, fix configure issue with intel
Sep 12, 2023
37d01f4
switch to smaller image, remove problematic icx flag
rem1776 Sep 13, 2023
0a9eedc
remove not found packages (zlibc)
rem1776 Sep 13, 2023
85c5275
remove -warn flag for configure issue
rem1776 Sep 13, 2023
51d7c53
fix exclude flags + missed second intel image line
rem1776 Sep 13, 2023
beb8a08
remove zlibc install (again)
rem1776 Sep 13, 2023
133ff10
switch back to hpckit image
rem1776 Sep 14, 2023
9a6244a
bump up oneapi version
rem1776 Sep 14, 2023
49a8881
move to 2022.3.1
rem1776 Sep 14, 2023
e6b4071
remove input files and unneeded depenendencies from image
Sep 21, 2023
cc3a72e
whitespace
Sep 21, 2023
a2148a4
Merge branch 'main' of github.com:noaa-gfdl/FMS into ci
Sep 21, 2023
d11f3d6
update yaml root path
Sep 21, 2023
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: 5 additions & 3 deletions .github/workflows/Dockerfile.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ RUN sed -i 's/connect_timeout: 10/connect_timeout: 600/' /opt/spack/etc/spack/de
FROM rockylinux:9

COPY --from=builder /opt/view/ /opt/view/
COPY --from=builder /opt/deps/ /opt/deps/
COPY --from=builder /opt/deps/linux-rocky9-haswell/gcc-12.3.0/ /opt/deps/linux-rocky9-haswell/gcc-12.3.0/

# leaving this out due to storage constraints
#
# input files used with --enable-input-tests
# need to be on the dev boxes if building
COPY ./fms_test_input /home/unit_tests_input
#COPY ./fms_test_input /home/unit_tests_input

RUN dnf install -y autoconf make automake m4 libtool pkg-config zip
RUN dnf install -y autoconf make automake m4 libtool pkg-config zip cmake git

ENV FC="mpifort"
ENV CC="mpicc"
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/github_autotools_gnu.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
# 'main' required ci, does a distcheck (builds, tests, check install)
# GNU ci run on pull requests, checks more configure options than intel
# does a distcheck (builds, tests, check install)
# image created off dockerfile in repo, compile/link flags are set there
name: Build libFMS test with autotools

on: [push, pull_request]
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
conf-flag: [ --disable-openmp, --enable-mixed-mode, --disable-setting-flags, --with-mpi=no]
input-flag: [--with-yaml, --enable-test-input=/home/unit_tests_input]
input-flag: [--with-yaml, ""]
target-fcflags: [ "-O2 -fno-expensive-optimizations", "-O0 -g -W -fbounds-check -ffpe-trap=invalid,zero,overflow"] # prod, debug
target-cflags: [ "-O2", "-O0"] # prod, debug
exclude:
- conf-flag: --with-mpi=no
input-flag: --enable-test-input=/home/unit_tests_input
- target-fcflags: "-O2 -fno-expensive-optimizations"
target-cflags: "-O0"
- target-fcflags: "-O0 -g -W -fbounds-check -ffpe-trap=invalid,zero,overflow"
target-cflags: "-O2"
container:
image: noaagfdl/fms-ci-rocky-gnu:12.3.0
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:12.3.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
TEST_VERBOSE: 1
DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flag }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}"
SKIP_TESTS: "test_yaml_parser.5" # temporary till fixes are in
DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flag }} ${{ matrix.input-flag }}"
TARGET_FLAGS: "${{ matrix.target-fcflags }} ${{ matrix.target-cflags }}"
SKIP_TESTS: "test_yaml_parser.5" # TODO
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare GNU autoconf for build
run: autoreconf -if
- name: Configure the build
if: ${{ matrix.conf-flag != '--disable-setting-flags' }}
run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} || cat config.log
run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="${TARGET_FLAGS} ${FCFLAGS}"
- name: Configure the build with compiler flags
if: ${{ matrix.conf-flag == '--disable-setting-flags' }}
run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include $FCFLAGS" || cat config.log
run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include ${FCFLAGS} ${TARGET_FLAGS}"
- name: Build the library
run: make distcheck
if: ${{ matrix.conf-flag != '--with-mpi=no' }}
Expand Down
62 changes: 47 additions & 15 deletions .github/workflows/github_autotools_intel.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
on: pull_request
on: [push, pull_request]
jobs:
intel-autotools:
build-dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
io-flag: ["--disable-deprecated-io", "--enable-deprecated-io"]
container:
image: intel/oneapi-hpckit:2023.1.0-devel-ubuntu20.04
image: intel/oneapi-hpckit:2022.3.1-devel-ubuntu20.04
env:
CC: mpiicc
FC: mpiifort
CFLAGS: "-I/libs/include"
FCFLAGS: "-I/libs/include -g -traceback ${{ matrix.io-flag }}"
FCFLAGS: "-I/libs/include"
LDFLAGS: "-L/libs/lib"
TEST_VERBOSE: 1
I_MPI_FABRICS: "shm" # needed for mpi in image
# intel bug causes some failures with shm option(required in container)
SKIP_TESTS: "test_mpp_update_domains.1 test_update_domains_performance.1 test_diag_manager2.23"
steps:
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: /libs
key: ${{ runner.os }}-intel-libs
key: ${{ runner.os }}-intel-libs${{ matrix.io-flag }}
- name: Install packages for building
run: apt-get update && apt-get install -y autoconf libtool automake zlibc zlib1g-dev
run: apt-get update && apt-get install -y autoconf libtool automake
- if: steps.cache.outputs.cache-hit != 'true'
name: Build netcdf
run: |
Expand All @@ -46,11 +39,50 @@ jobs:
tar xf yaml-0.2.5.tar.gz && cd yaml-0.2.5
./configure --prefix=/libs
make -j install && cd
make-check-fms:
needs: build-dependencies
runs-on: ubuntu-latest
strategy:
matrix:
FC: ["ifx", "ifort"]
CC: ["icx", "icc"]
target-fcflags: [ "-O3 -debug minimal -fp-model source", "-g -O0 -check -check noarg_temp_created -check nopointer -warn noerrors -fpe0 -ftrapuv" ] # prod, debug
target-cflags: [ "-O2 -debug minimal", "-O0 -g" ] # prod, debug (-ftrapuv was removed since its incompatible with icx)
io-flag: ["--disable-deprecated-io", "--enable-deprecated-io"]
exclude:
- FC: "ifx"
CC: "icc"
- target-fcflags: "-O3 -debug minimal -fp-model source"
target-cflags: "-O0 -g"
- target-fcflags: "-g -O0 -check -check noarg_temp_created -check nopointer -warn noerrors -fpe0 -ftrapuv"
target-cflags: "-O2 -debug minimal"
- FC: "ifx" # bug with ifx will cause ICE if using -check flag (issue #1348)
target-fcflags: "-g -O0 -check -check noarg_temp_created -check nopointer -warn noerrors -fpe0 -ftrapuv"
container:
image: intel/oneapi-hpckit:2022.3.1-devel-ubuntu20.04
env:
CC: mpicc -cc=${{ matrix.CC }}
FC: mpifc -fc=${{ matrix.FC }}
CFLAGS: "-I/libs/include ${{ matrix.target-cflags }}"
FCFLAGS: "-I/libs/include ${{ matrix.target-fcflags }}"
LDFLAGS: "-L/libs/lib"
TEST_VERBOSE: 1
I_MPI_FABRICS: "shm" # needed for mpi in image
SKIP_TESTS: "test_fms2_io.2" # TODO compressed writes test fails with ifx
steps:
- name: Get dependencies from cache
id: cache
uses: actions/cache@v3
with:
path: /libs
key: ${{ runner.os }}-intel-libs
- name: Install packages for building
run: apt-get update && apt-get install -y autoconf libtool automake zip
- name: checkout
uses: actions/checkout@v2
- name: Configure
run: autoreconf -if ./configure.ac && ./configure --with-yaml
run: autoreconf -if ./configure.ac && ./configure --with-yaml ${{ matrix.io-flag }} || cat config.log
- name: Compile
run: make -j || make
- name: Run test suite
run: make check LD_LIBRARY_PATH="/libs/lib:$LD_LIBRARY_PATH" TEST_VERBOSE=1
run: make distcheck LD_LIBRARY_PATH="/libs/lib:$LD_LIBRARY_PATH" TEST_VERBOSE=1
19 changes: 17 additions & 2 deletions .github/workflows/github_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@ jobs:
libyaml-flag: [ "", -DWITH_YAML=on ]
io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
container:
image: noaagfdl/hpc-me.ubuntu-minimal:cmake
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:12.3.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
LIBYAML_ROOT: "/opt/deps/linux-rocky9-haswell/gcc-12.3.0/libyaml-0.2.5-fpd3ebh7gulljpolqosg6adfuiqzhwk2/" # TODO should find better way for cmake to find this
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Generate makefiles with CMake
run: cmake $CMAKE_FLAGS .
run: cmake -DNetCDF_INCLUDE_DIR=/opt/view/include/ -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" $CMAKE_FLAGS .
- name: Build the library
run: make
- name: Link with basic executable
run: |
echo "program test" > test.F90
echo " use fms_mod" >> test.F90
echo " call fms_init" >> test.F90
echo " call fms_end" >> test.F90
echo "end program" >> test.F90
mpifort -L/opt/view/lib -fopenmp `nf-config --flibs` -Iinclude_r4 -Iinclude_r8 test.F90 libfms_r4.a libfms_r8.a -o test.x
touch input.nml
- name: Run executable
run: ./test.x
13 changes: 7 additions & 6 deletions .github/workflows/github_coupler_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ jobs:
coupler-build:
runs-on: ubuntu-latest
container:
image: ryanmulhall/hpc-me.ubuntu-minimal:coupler
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:12.3.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
CC: mpicc
FC: mpif90
CPPFLAGS: '-I/usr/include -Duse_LARGEFILE -DMAXFIELDMETHODS_=500'
FCFLAGS: '-fcray-pointer -fdefault-double-8 -fdefault-real-8 -Waliasing -ffree-line-length-none -fno-range-check -I/usr/include'
LDFLAGS: '-L/usr/lib'
CPPFLAGS: '-I/opt/view/include'
FFLAGS: '-fallow-argument-mismatch' # mkmf uses FFLAGS instead of FC
LDFLAGS: '-L/opt/view/lib'
VERBOSE: 1
steps:
- name: Checkout FMS
Expand Down
4 changes: 3 additions & 1 deletion parser/fms_yaml_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ subroutine write_yaml_from_struct_3 (yamlname, a1size, keys, vals, a2size, key2,
key3, val3, lvl2keyeach) bind(C, name="write_yaml_from_struct_3")
use iso_c_binding
import fmsYamlOutKeys_type, fmsYamlOutValues_type, lvl2_key_parameter
character (c_char) :: yamlname !< The output yaml file name
character (c_char) :: yamlname !< The output yaml file name, type is a c char for the binding
!! but seems to only work with a fortran string.
!! Input string should be trimmed to prevent any unwanted characters sneaking in.
integer (c_int), value :: a1size !< The size of the first yaml array
type (fmsYamlOutKeys_type) :: keys(a1size) !< Top level yaml keys
type (fmsYamlOutValues_type) :: vals(a1size) !< Values corresponding to keys
Expand Down
2 changes: 1 addition & 1 deletion parser/yaml_output_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void write_yaml_from_struct_3 (char *yamlname, int asize, struct fmsyamloutkeys

// trim any trailing whitespace
int ws_ind = strlen(yamlname)-1;
while(*(yamlname+ws_ind) == ' ') ws_ind--;
while(yamlname[ws_ind] == ' ') ws_ind--;
if( ws_ind != strlen(yamlname)-1) yamlname[ws_ind+1] = '\0';

/* open the yaml output file. Only 1 core should do this */
Expand Down
15 changes: 9 additions & 6 deletions test_fms/parser/test_output_yaml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ program test_output_yaml
character(len=yaml_len) :: yaml_output_read
character(len=string_len_parameter) :: tmpstr
integer :: i, io_status !< for looping
integer :: unum
call fms_init
call mpp_init

Expand Down Expand Up @@ -203,27 +204,29 @@ program test_output_yaml
call yaml_out_add_level2key( "order 4",k1(1))
call yaml_out_add_level2key( "sides", k2(1))
call yaml_out_add_level2key( "specials", k2(2))
call write_yaml_from_struct_3 (filename, 1, k1, v1, a2, k2, v2, a3, (/1, 1, 1, 1, 2, 1/), k3, v3, &
call write_yaml_from_struct_3 (trim(filename), 1, k1, v1, a2, k2, v2, a3, (/1, 1, 1, 1, 2, 1/), k3, v3, &
& (/ 1, 1, 1 , 1, 0 ,0 ,0 ,0/))
else
!> Write the yaml
call write_yaml_from_struct_3 (filename, 1, k1, v1, a2, k2, v2, a3, a3each, k3, v3, (/ 3, 0, 0 , 0, 0 ,0 ,0 ,0/))
call write_yaml_from_struct_3 (trim(filename), 1, k1, v1, a2, k2, v2, a3, a3each, k3, v3, (/3,0,0,0,0,0,0,0/))
endif

call mpp_sync()

!> Check yaml output against reference
if (mpp_pe() == mpp_root_pe() ) then
do i = 1,yaml_len
yaml_reference(i:i) = " "
yaml_output_read(i:i) = " "
enddo
write (6,*) "open "//ref_yaml_name
open(unit=29, file=ref_yaml_name, status="old", access="stream")
open(newunit=unum, file=ref_yaml_name, status="old", access="stream")
write (6,*) "read "//ref_yaml_name
read(29,iostat=i) yaml_reference
read(unum,iostat=i) yaml_reference
write (6,*) "open "//filename
open(unit=28, file=filename, status="old", access="stream")
open(newunit=unum, file=filename, status="old", access="stream")
write (6,*) "read "//filename
read(28,iostat=i) yaml_output_read
read(unum,iostat=i) yaml_output_read
write(6,*) yaml_reference
write(6,*) yaml_output_read
if (trim(yaml_reference) .ne. trim (yaml_output_read)) then
Expand Down
Loading