Skip to content

Commit

Permalink
Merge pull request #177 from Goddard-Fortran-Ecosystem/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tclune authored May 31, 2022
2 parents cbe4434 + f4d33aa commit 012c864
Show file tree
Hide file tree
Showing 21 changed files with 182 additions and 70 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
name: CI Tests

on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened]
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.MD"
- "Licence.txt"
- "Copyright.txt"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15, macos-11]
compiler: [gfortran-8, gfortran-9, gfortran-10]
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
compiler: [gfortran-9, gfortran-10, gfortran-11, gfortran-12]
exclude:
- os: macos-10.15
compiler: gfortran-8
- os: ubuntu-20.04
compiler: gfortran-11
- os: ubuntu-20.04
compiler: gfortran-12
- os: ubuntu-22.04
compiler: gfortran-9
- os: macos-11
compiler: gfortran-8
compiler: gfortran-12
- os: macos-12
compiler: gfortran-9
- os: macos-12
compiler: gfortran-10
- os: macos-12
compiler: gfortran-12

# fail-fast is set to 'true' here which is good for production, but when
# fail-fast if set to 'true' here is good for production, but when
# debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails
# GitHub Actions will stop any other test immediately. So good for production, bad
# when trying to figure something out. For more info see:
# https://www.edwardthomson.com/blog/github_actions_6_fail_fast_matrix_workflows.html

fail-fast: true
fail-fast: false
env:
FC: ${{ matrix.compiler }}
LANGUAGE: en_US.UTF-8
Expand All @@ -34,14 +52,10 @@ jobs:

name: ${{ matrix.os }} / ${{ matrix.compiler }}
steps:
- name: Install GCC 8 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-8'
- name: Install GCC 12 on Ubuntu 22.04
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'gfortran-12'
run: |
sudo apt-get install gfortran-8 -y
- name: Install GCC 11 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-11'
run: |
sudo apt-get install gfortran-11 -y
sudo apt-get install gfortran-12 -y
- name: Compiler Versions
run: |
${FC} --version
Expand All @@ -67,3 +81,10 @@ jobs:
run: |
cd build
ctest -j1 --output-on-failure --repeat until-pass:4
- name: Archive log files on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: logfiles
path: |
build/**/*.log
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (COMMAND cmake_policy)
endif (COMMAND cmake_policy)

project (GFTL
VERSION 1.7.2
VERSION 1.8.0
LANGUAGES NONE)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Expand Down
36 changes: 35 additions & 1 deletion ChangeLog.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,43 @@

## Unreleased

## [1.8.0] - 2022-05-31

## Changed

- Interfaces (intents) to map::at() and ordered_map::at(). The self object should be `INTENT(IN)` for these interfaces.


## Fixed

- Fix misspelling of SUCCESS
- Fixed bug in `vector::insert_range()` (needs a unit test)

- Added `TARGET` to some dummy arguments to prevent NAG from doing copy-in / copy-out. Seems to
have been causing a memory corruption issue with the yaFyaml package, but might indicate a bug
in yaFyaml (or gFTL).

- Fixed non-standard-conforming mismatched integer KIND in deque implementation.

- Fixed misspelling of SUCCESS

## Removed

- Various unused local variables that were causing annoying compiler warnings.



- Reactivated unit tests (involving Foo) that were deactivated as a workaround for some NAG 7.1 compiler releases.

## Changed

- Updated GitHub Actions
- OSs
- Remove macos-10.15
- Add ubuntu-22.04 and macos-12
- Compilers
- Removed gfortran-8
- Added gfortran-11
- Added gfortran-12 (for ubuntu-22.04)

## [1.7.2] - 2022-05-08

Expand Down
2 changes: 2 additions & 0 deletions include/v2/algorithms/find/procedures.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
type(keywordenforcer), intent(in) :: unused

j%placeholder = -1
__UNUSED_DUMMY(do_not_use)
__UNUSED_DUMMY(unused)
end function __MANGLE(find_basic)
#endif

Expand Down
49 changes: 39 additions & 10 deletions include/v2/deque/procedures.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
! define derived generic template parameters from internal parameters.
#include "parameters/T/define_derived_macros.inc"


subroutine __MANGLE(unused_procedure)()
! The following are an adhoc way to suppress compiler
! warnings about parameters not used in this template
__UNUSED_DUMMY(BAD_ALLOC)
__UNUSED_DUMMY(TYPE_HAS_NO_DEFAULT_VALUE)
__UNUSED_DUMMY(NO_TYPE__)
end subroutine __MANGLE(unused_procedure)


! =======================
! Structure constructors
! =======================
Expand Down Expand Up @@ -200,7 +210,7 @@
rc = OUT_OF_RANGE
res => null()
else
rc = 0
rc = SUCCESS
res => this%buckets(this%idx(i))%ptr%bucket_items%item
end if

Expand Down Expand Up @@ -284,6 +294,7 @@
__T_FREE__(this%buckets(ii)%ptr%bucket_items%item)
__T_COPY__(this%buckets(ii)%ptr%bucket_items%item, value)


return
end subroutine __MANGLE(set_size_kind)

Expand Down Expand Up @@ -569,21 +580,21 @@
integer, optional, intent(out) :: rc

integer(kind=GFTL_SIZE_KIND) :: old_size
integer(kind=GFTL_SIZE_KIND) :: i, ii
integer :: status

__UNUSED_DUMMY(unused)
#if defined(__T_FREE__)
integer(kind=GFTL_SIZE_KIND) :: i, ii
#endif

if (count == this%size_) then
if (present(rc)) rc = 0
if (present(rc)) rc = SUCCESS
return
end if
if (count < 0) then
if (present(rc)) rc = ILLEGAL_INPUT
return
end if

if (present(rc)) rc = 0
if (present(rc)) rc = SUCCESS

old_size = this%size_

Expand All @@ -594,6 +605,7 @@
end if

this%size_ = count
#if defined(__T_FREE__)
do i = count + 1, old_size
ii = this%idx(i)
__T_FREE__(this%buckets(ii)%ptr%bucket_items%item)
Expand All @@ -612,8 +624,10 @@
end do
end if
endif
#endif

return
__UNUSED_DUMMY(unused)
end subroutine __MANGLE(resize_size_kind)

subroutine __MANGLE(resize_default)(this, count, unused, value, rc)
Expand All @@ -637,14 +651,17 @@
class(__deque), intent(inout) :: this
integer(kind=GFTL_SIZE_KIND), intent(in) :: from, to ! assumes newsize<=size()

#if defined(__T_FREE__)
integer(kind=GFTL_SIZE_KIND) :: i, ii

if (from <= to) then

do i = from, to - 1
ii = this%idx(i)
__T_FREE__(this%buckets(ii)%ptr%bucket_items%item)
end do

else

do i = from, this%capacity()
ii = this%idx(i)
__T_FREE__(this%buckets(ii)%ptr%bucket_items%item)
Expand All @@ -653,7 +670,11 @@
ii = this%idx(i)
__T_FREE__(this%buckets(ii)%ptr%bucket_items%item)
end do

endif
__UNUSED_DUMMY(ii)
#endif

this%size_ = this%size_ - modulo(from - to, this%capacity()) - 1

return
Expand Down Expand Up @@ -753,7 +774,7 @@
rc = LENGTH_ERROR
return
else
rc = 0
rc = SUCCESS
end if
end if

Expand All @@ -777,7 +798,7 @@
rc = LENGTH_ERROR
return
else
rc = 0
rc = SUCCESS
end if
end if

Expand Down Expand Up @@ -981,6 +1002,10 @@
#endif
write(unit,'(a)') new_line('a')
write(unit,'(4x,a10,1x,i0)') 'size: ',this%size()

__UNUSED_DUMMY(iomsg)
__UNUSED_DUMMY(iotype)
__UNUSED_DUMMY(v_list)
end subroutine __MANGLE(write_formatted)


Expand All @@ -990,14 +1015,18 @@
integer(kind=GFTL_SIZE_KIND), intent(in) :: i

bucket_index = 1 + (i-1)/__deque_bucket_size__

__UNUSED_DUMMY(this)
end function __MANGLE(bucket_index)

function __MANGLE(bucket_offset)(this, i) result(bucket_offset)
integer(kind=GFTL_SIZE_KIND) :: bucket_offset
class(__deque), intent(in) :: this
integer(kind=GFTL_SIZE_KIND), intent(in) :: i

bucket_offset = 1 + modulo(i-1, __deque_bucket_size__)
bucket_offset = 1 + modulo(i-1, int(__deque_bucket_size__,kind=GFTL_SIZE_KIND))

__UNUSED_DUMMY(this)
end function __MANGLE(bucket_offset)

#include "deque/iterator_procedures.inc"
Expand Down
12 changes: 9 additions & 3 deletions include/v2/map/procedures.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
#include "parameters/Key/define_derived_macros.inc"
#include "parameters/T/define_derived_macros.inc"

subroutine __MANGLE(unused_procedure)()
! The following are an adhoc way to suppress compiler
! warnings about parameters not used in this template
__UNUSED_DUMMY(BAD_ALLOC)
__UNUSED_DUMMY(ILLEGAL_INPUT)
__UNUSED_DUMMY(LENGTH_ERROR)
__UNUSED_DUMMY(TYPE_HAS_NO_DEFAULT_VALUE)
__UNUSED_DUMMY(NO_TYPE__)
end subroutine __MANGLE(unused_procedure)

! This constructor is needed in situations where an empty dictionary needs to be
! passed to a procedure. Prevents the need of declaring a local variable.
Expand Down Expand Up @@ -139,8 +148,6 @@
__Key_declare_dummy__, intent(in) :: key
__T_declare_dummy__, target, intent(in) :: value

integer :: sz

integer, save :: depth = 0

type (__map_pair) :: p
Expand All @@ -149,7 +156,6 @@
__Key_COPY__(p%first, key)
__T_COPY__(p%second, value)

sz = this%size()
call this%tree%insert(p)
depth = depth - 1

Expand Down
Loading

0 comments on commit 012c864

Please sign in to comment.