Skip to content

Commit

Permalink
further test development
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 28, 2020
1 parent cbed988 commit a54de42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/a3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
export CC=/home/runner/openmpi/bin/mpicc
autoreconf -i
./configure --with-mpiexec='mpiexec --oversubscribe'
which mpiexec
cat config.h
make check
- name: cmake build
run: |
Expand All @@ -138,6 +138,7 @@ jobs:
cd build
export LD_LIBRARY_PATH="/home/runner/netcdf-c/lib:/home/runner/pnetcdf/lib:/home/runner/hdf5/lib:/home/runner/openmpi/lib:$LD_LIBRARY_PATH"
cmake -Wno-dev -DWITH_MPIEXEC='/home/runner/openmpi/bin/mpiexec;--oversubscribe' -DNetCDF_C_LIBRARY=/home/runner/netcdf-c/lib/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/home/runner/netcdf-c/include -DPnetCDF_PATH='/home/runner/pnetcdf' -DPIO_ENABLE_FORTRAN=Off -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. || (cat CMakeFiles/CMakeOutput.log && cat CMakeFiles/CMakeError.log)
cat config.h
make VERBOSE=1
make tests VERBOSE=1
ctest -VV
Expand Down
19 changes: 17 additions & 2 deletions tests/unit/ftst_vars.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ program ftst_vars
use pio

type(iosystem_desc_t) :: pio_iosystem
type(file_desc_t) :: pio_file
type(file_desc_t) :: pio_file
type(var_desc_t) :: pio_var
integer :: my_rank, ntasks
integer :: niotasks = 1, stride = 1
character(len=64) :: filename = 'ftst_vars.nc'
character(len=64) :: dim_name = 'influence_on_Roman_history'
character(len=64) :: var_name = 'Caesar'
integer :: iotype = PIO_iotype_netcdf4c
integer :: dimid, dim_len = 4
integer :: ierr

! Set up MPI
Expand All @@ -36,12 +40,23 @@ program ftst_vars
ierr = PIO_createfile(pio_iosystem, pio_file, iotype, filename)
if (ierr .ne. PIO_NOERR) stop 3

! Define a dim.
ret_val = PIO_def_dim(pio_file, dim_name, dim_len, dimid)
if (ierr .ne. PIO_NOERR) stop 5

! Define a var.
ret_val = PIO_def_var(pio_file, var_name, PIO_int, (/dimid/), pio_var)
if (ierr .ne. PIO_NOERR) stop 7

! Close the file.
call PIO_closefile(pio_file)

! Open the file.
ret_val = PIO_openfile(pio_iosystem, pio_file, iotype, filename, PIO_nowrite)
if (ierr .ne. PIO_NOERR) stop 3


! Close the file.
call PIO_closefile(pio_file)

! Finalize PIO.
call PIO_finalize(pio_iosystem, ierr)
Expand Down

0 comments on commit a54de42

Please sign in to comment.