Skip to content

Commit

Permalink
calling PIO_InitDecomp and PIO_freedecomp
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 16, 2019
1 parent 65df82b commit 2cfad5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/fncint/ftst_pio.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,31 @@ program ftst_pio
integer :: ncid
character*(*) FILE_NAME
parameter (FILE_NAME='ftst_pio.nc')
integer, dimension(3) :: data_buffer, compdof
integer, dimension(1) :: dims
type(io_desc_t) :: iodesc_nCells
integer :: ierr

call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD, myRank, ierr)
call MPI_Comm_size(MPI_COMM_WORLD, ntasks, ierr)


ierr = pio_set_log_level(2)
ierr = nf_set_log_level(2)
ierr = nf_init_intracom(myRank, MPI_COMM_WORLD, niotasks, numAggregator, &
stride, PIO_rearr_subset, ioSystem, base)


dims(1) = 3 * ntasks
compdof = 3 * myRank + (/1, 2, 3/) ! Where in the global array each task writes
data_buffer = myRank
call PIO_initdecomp(ioSystem, PIO_int, dims, compdof, iodesc_nCells)

ierr = nf_create(FILE_NAME, 64, ncid)
ierr = nf_close(ncid)

call PIO_freedecomp(ioSystem, iodesc_nCells)
ierr = nf_free_iosystem()
call MPI_Finalize(ierr)
if (myRank .eq. 0) then
Expand Down

0 comments on commit 2cfad5e

Please sign in to comment.