Skip to content

Commit

Permalink
Merge pull request #1466 from ExtremeFLOW/release/0.8
Browse files Browse the repository at this point in the history
NEKO v0.8.1
  • Loading branch information
njansson authored Sep 7, 2024
2 parents e01443b + 0867cc2 commit 5e6957e
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 44 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt-get update && sudo apt-get install -y rocm-dev
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=/opt/rocm-6.1.2
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=/opt/rocm-6.2.0
make -j$(nproc)
- name: Build (OpenCL backend)
if: matrix.backend == 'opencl'
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=/opt/rocm-6.1.2
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=/opt/rocm-6.2.0
make -j $(nproc)
- name: Dist (OpenCL backend)
if: matrix.backend == 'opencl'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt-get update && sudo apt-get install -y rocm-dev
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=/opt/rocm-6.1.2
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=/opt/rocm-6.2.0
make -j$(nproc)
- name: Build (OpenCL backend)
if: matrix.backend == 'opencl'
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=/opt/rocm-6.1.2
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=/opt/rocm-6.2.0
make -j $(nproc)
- name: Dist (OpenCL backend)
if: matrix.backend == 'opencl'
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([neko],[0.8.0])
AC_INIT([neko],[0.8.1])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
Expand Down
7 changes: 4 additions & 3 deletions src/bc/non_normal.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! Copyright (c) 2020-2021, The Neko Authors
! Copyright (c) 2020-2024, The Neko Authors
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -64,8 +64,9 @@ subroutine non_normal_init_msk(this)
type(tuple_i4_t) :: bc_facet
integer :: facet, el

call non_normal_free(this)

call this%bc_x%free()
call this%bc_y%free()
call this%bc_z%free()
call this%bc_x%init(this%coef)
call this%bc_y%init(this%coef)
call this%bc_z%init(this%coef)
Expand Down
7 changes: 4 additions & 3 deletions src/bc/symmetry.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! Copyright (c) 2020-2021, The Neko Authors
! Copyright (c) 2020-2024, The Neko Authors
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -71,8 +71,9 @@ subroutine symmetry_init_msk(this)
type(tuple_i4_t) :: bc_facet
integer :: facet, el

call symmetry_free(this)

call this%bc_x%free()
call this%bc_y%free()
call this%bc_z%free()
call this%bc_x%init(this%coef)
call this%bc_y%init(this%coef)
call this%bc_z%init(this%coef)
Expand Down
71 changes: 38 additions & 33 deletions src/io/csv_file.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ subroutine csv_file_write(this, data, t)
nullify(vec)
nullify(mat)

select type(data)
select type (data)
type is (vector_t)
if (.not. allocated(data%x)) then
call neko_error("Vector is not allocated! Use &
&vector%init() to associate your array &
&with a vector_t object")
call neko_error("Vector is not allocated. Use &
&vector%init() to associate your array &
&with a vector_t object")
end if
vec => data

type is (matrix_t)
if (.not. allocated(data%x)) then
call neko_error("Matrix is not allocated! Use &
&matrix%init() to associate your array &
&with a matrix_t object")
call neko_error("Matrix is not allocated. Use &
&matrix%init() to associate your array &
&with a matrix_t object")
end if
mat => data

class default
call neko_error("Invalid data. Expected vector_t or &
&matrix_t")
&matrix_t")
end select

! Write is performed on rank 0
Expand Down Expand Up @@ -125,7 +125,8 @@ subroutine csv_file_write_vector(f, data, t)
character(len=1024) :: fname
integer :: suffix_pos, file_unit, i, ierr

open(file=trim(f%fname), position="append", iostat=ierr, newunit=file_unit)
open(file = trim(f%fname), position = "append", iostat = ierr, &
newunit = file_unit)
if (ierr .ne. 0) call neko_error("Error while opening " // trim(f%fname))

! write header if not empty and if not already written
Expand All @@ -135,10 +136,10 @@ subroutine csv_file_write_vector(f, data, t)
end if

! Add time at the beginning if specified
if (present(t)) write (file_unit, '(g0,",")', advance="no") t
if (present(t)) write (file_unit, '(g0,",")', advance = "no") t

write (file_unit, '(*(g0,","))', advance="no") data%x(1:data%n-1)
write(file_unit,'(g0)') data%x(data%n)
write (file_unit, '(*(g0,","))', advance = "no") data%x(1:data%n-1)
write (file_unit,'(g0)') data%x(data%n)

close(file_unit)

Expand All @@ -155,7 +156,8 @@ subroutine csv_file_write_matrix(f, data, t)
real(kind=rp), intent(in), optional :: t
integer :: file_unit, i,j, ierr

open(file=trim(f%fname), position="append", iostat=ierr, newunit=file_unit)
open(file = trim(f%fname), position = "append", iostat = ierr, &
newunit = file_unit)
if (ierr .ne. 0) call neko_error("Error while opening " // trim(f%fname))

! write header if not empty and if not already written
Expand All @@ -165,9 +167,10 @@ subroutine csv_file_write_matrix(f, data, t)
end if

do i = 1, data%nrows
if (present(t)) write (file_unit, '(g0,",")', advance="no") t
write (file_unit, '(*(g0,","))', advance="no") data%x(i,1:data%ncols-1)
write (file_unit, '(g0)') data%x(i,data%ncols)
if (present(t)) write (file_unit, '(g0,",")', advance = "no") t
write (file_unit, '(*(g0,","))', advance = "no") &
data%x(i, 1:data%ncols-1)
write (file_unit, '(g0)') data%x(i, data%ncols)
end do

close(file_unit)
Expand All @@ -188,27 +191,27 @@ subroutine csv_file_read(this, data)
nullify(vec)
nullify(mat)

select type(data)
select type (data)
type is (vector_t)
vec => data
if (.not. allocated(data%x)) then
call neko_error("Vector is not allocated! Use &
&vector%init() to associate your array &
&with a vector_t object")
call neko_error("Vector is not allocated. Use &
&vector%init() to associate your array &
&with a vector_t object")
end if

type is (matrix_t)
mat => data
if (.not. allocated(data%x)) then
call neko_error("Matrix is not allocated! Use &
&matrix%init() to associate your array &
&with a matrix_t object")
call neko_error("Matrix is not allocated. Use &
&matrix%init() to associate your array &
&with a matrix_t object")
end if


class default
call neko_error("Invalid data type for csv_file (expected: vector_t, &
&matrix_t)")
&matrix_t)")
end select

if (pe_rank .eq. 0) then
Expand Down Expand Up @@ -240,17 +243,18 @@ subroutine csv_file_read_vector(f, vec)

n_lines = f%count_lines()

open(file=trim(f%fname), status='old', newunit=file_unit, iostat = ierr)
open(file = trim(f%fname), status = 'old', newunit = file_unit, &
iostat = ierr)
if (ierr .ne. 0) call neko_error("Error while opening " // trim(f%fname))

! If there is more than 1 line, assume that means there is a header
if (n_lines .lt. 1) then
if (n_lines .gt. 1) then
read (file_unit, '(A)') tmp
f%header = trim(tmp)
end if

read (file_unit,*) vec%x
close(unit=file_unit)
close(unit = file_unit)


end subroutine csv_file_read_vector
Expand All @@ -268,7 +272,8 @@ subroutine csv_file_read_matrix(f, mat)

n_lines = f%count_lines()

open(file=trim(f%fname), status='old', newunit=file_unit, iostat = ierr)
open(file = trim(f%fname), status = 'old', newunit = file_unit, &
iostat = ierr)
if (ierr .ne. 0) call neko_error("Error while opening " // trim(f%fname))

! If the number of lines is larger than the number of rows in the
Expand All @@ -278,10 +283,10 @@ subroutine csv_file_read_matrix(f, mat)
f%header = trim(tmp)
end if

do i=1, mat%nrows
do i = 1, mat%nrows
read (file_unit,*) mat%x(i,:)
end do
close(unit=file_unit)
close(unit = file_unit)

end subroutine csv_file_read_matrix

Expand All @@ -305,19 +310,19 @@ function csv_file_count_lines(this) result(n)
integer :: n
integer :: ierr, file_unit

open(file=trim(this%fname), status='old', newunit=file_unit)
open(file = trim(this%fname), status = 'old', newunit = file_unit)
rewind(file_unit)

n = 0

! Keep reading (ierr = 0) until we reach the end (ierr != 0)
do
read (file_unit,*,iostat=ierr)
read (file_unit, *, iostat = ierr)
if (ierr .ne. 0) exit
n = n + 1
end do
rewind(file_unit)
close(unit=file_unit)
close(unit = file_unit)

end function csv_file_count_lines

Expand Down

0 comments on commit 5e6957e

Please sign in to comment.