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

Tests to confirm get/set var cache working in F77 and F90 APIs #239

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions nf03_test4/f90tst_vars2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ program f90tst_vars2
integer :: endianness_in, deflate_level_in
logical :: shuffle_in, fletcher32_in, contiguous_in
integer (kind = EightByteInt) :: toe_san_in
integer :: cache_size_in, cache_nelems_in, cache_preemption_in
integer :: cache_size_in, cache_nelems_in, cache_preemption_in

print *, ''
print *,'*** Testing definition of netCDF-4 vars from Fortran 90.'
Expand Down Expand Up @@ -111,8 +111,8 @@ program f90tst_vars2
if (chunksizes_in(1) /= chunksizes(1) .or. chunksizes_in(2) /= chunksizes(2)) &
stop 4
if (endianness_in .ne. nf90_endian_big) stop 5
! print *, 'cache_size_in =', cache_size_in, 'cache_nelems_in =', cache_nelems_in, &
! 'cache_preemption_in =', cache_preemption
if (cache_size_in .ne. 16 .or. cache_nelems_in .ne. 4133 .or. &
cache_preemption .ne. CACHE_PREEMPTION) stop 555

! Check variable 2.
call check(nf90_inquire_variable(ncid, varid2_in, name_in, xtype_in, ndims_in, dimids_in, &
Expand Down
15 changes: 14 additions & 1 deletion nf_test4/ftst_vars.F
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
C This program tests netCDF-4 variable functions from fortran,
C testing chunking and deflate settings.

C $Id: ftst_vars.F,v 1.19 2009/09/27 21:25:23 ed Exp $
C Ed Hartnett

program ftst_vars
implicit none
Expand Down Expand Up @@ -35,6 +35,11 @@ program ftst_vars
integer endianness

C Cache size stuff.
integer DEFAULT_CACHE_SIZE, DEFAULT_CACHE_NELEMS
integer DEFAULT_CACHE_PREEMPTION
parameter (DEFAULT_CACHE_SIZE = 16777216)
parameter (DEFAULT_CACHE_NELEMS = 4133)
parameter (DEFAULT_CACHE_PREEMPTION = 75)
integer CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION
parameter (CACHE_SIZE = 8000, CACHE_NELEMS = 500)
parameter (CACHE_PREEMPTION = 50)
Expand All @@ -53,6 +58,14 @@ program ftst_vars
print *, ''
print *,'*** Testing definition of netCDF-4 vars from Fortran 77.'

C Check default chunk cache sizes.
retval = nf_get_chunk_cache(cache_size_in, cache_nelems_in,
& cache_preemption_in)
if (retval .ne. nf_noerr) stop 1
if (cache_size_in .ne. DEFAULT_CACHE_SIZE .or.
& cache_nelems_in .ne. DEFAULT_CACHE_NELEMS .or.
& cache_preemption_in .ne. DEFAULT_CACHE_PREEMPTION) stop 4

C Change the cache size for the files created/opened in this program.
retval = nf_set_chunk_cache(CACHE_SIZE, CACHE_NELEMS,
& CACHE_PREEMPTION)
Expand Down