Skip to content

Commit

Permalink
Merge pull request #62 from Katetc/master
Browse files Browse the repository at this point in the history
 Changes to pioperformance.F90 to get it to build and run with PIO1.
  • Loading branch information
jedwards4b committed Apr 4, 2016
2 parents a7ce0fa + d5a24c0 commit 467cb31
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
19 changes: 19 additions & 0 deletions tests/performance/kt.PIO1.perfmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all: pioperf pioperfp1

pioperf: pioperformance.o
mpif90 pioperformance.o -o pioperf ../pio_build_int/src/flib/libpiof.a ../pio_build_int/src/clib/libpioc.a ../pio_build_int/src/gptl/libgptl.a /glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/lib/libnetcdff.a /glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/lib/libnetcdf.so /glade/apps/opt/pnetcdf/1.6.1/intel/15.0.3/lib/libpnetcdf.a -lirng -ldecimal -lcilkrts -lstdc++

pioperformance.o: pioperformance.F90
mpif90 -DCPRINTEL -DHAVE_MPI -DINCLUDE_CMAKE_FCI -DLINUX -DTIMING -DUSEMPIIO -DUSE_PNETCDF_VARN -DUSE_PNETCDF_VARN_ON_READ -D_NETCDF -D_NETCDF4 -D_PNETCDF -I/glade/p/work/katec/pio_work/ncar_pio2/src/flib -I/glade/p/work/katec/pio_work/pio_build_int/src/flib -I/glade/apps/opt/netcdf-mpi/4.3.2/intel/default/include -I/glade/apps/opt/pnetcdf/1.6.1/intel/15.0.3/include -I/glade/p/work/katec/pio_work/ncar_pio2/src/clib -I/glade/p/work/katec/pio_work/ncar_pio2/src/gptl -I/glade/p/work/katec/pio_work/pio_build_int/src/gptl -c pioperformance.F90 -o pioperformance.o

pioperfp1: pioperformancep1.o
mpif90 pioperformancep1.o -o pioperfp1 ../PIO1_bld/pio/libpio.a ../pio_build_int/src/gptl/libgptl.a /glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/lib/libnetcdff.a /glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/lib/libnetcdf.so /glade/apps/opt/pnetcdf/1.6.1/intel/15.0.3/lib/libpnetcdf.a -lirng -ldecimal -lcilkrts -lstdc++ -openmp

pioperformancep1.o: pioperformance.F90
mpif90 -DPIO_GPFS_HINTS -DUSEMPIIO -D_NETCDF -D_NETCDF4 -D_NOUSEMCT -D_PNETCDF -D_USEBOX -D_PIO1 -no-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source -g -xHost -debug minimal -openmp -DLINUX -DMCT_INTERFACE -DHAVE_MPI -DTHREADED_OMP -DFORTRANUNDERSCORE -DNO_R16 -DINTEL_MKL -DHAVE_SSE2 -DLINUX -DCPRINTEL -DHAVE_SLASHPROC -I. -I/glade/p/work/katec/pio_work/PIO1_bld/pio -I/glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/include -I/glade/apps/opt/pnetcdf/1.6.1/intel/15.0.3/include -I/glade/p/work/katec/pio_work/PIO1/pio -I/glade/p/work/katec/pio_work/PIO1_bld/pio/timing -I/glade/apps/opt/netcdf-mpi/4.3.3.1/intel/default/include -I/glade/apps/opt/pnetcdf/1.6.1/intel/15.0.3/include -c pioperformance.F90 -o pioperformancep1.o

cleanp1:
rm pioperformancep1.o pioperfp1

clean:
rm pioperformance.o pioperf
21 changes: 19 additions & 2 deletions tests/performance/pioperformance.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ program pioperformance
nvars, varsize, unlimdimindof
#ifdef BGQTRY
external :: print_memusage
#endif
#ifdef _PIO1
integer, parameter :: PIO_FILL_INT = 02147483647
real, parameter :: PIO_FILL_FLOAT = 9.969209968E+36
double precision, parameter :: PIO_FILL_DOUBLE = 9.969209968E+36
#endif
!
! Initialize MPI
Expand Down Expand Up @@ -163,11 +168,18 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &
character(len=*), parameter :: rearr_name(2) = (/' BOX','SUBSET'/)

nullify(compmap)
if(mype.eq.0) print *,trim(filename)

if(trim(filename) .eq. 'ROUNDROBIN' .or. trim(filename).eq.'BLOCK') then
call init_ideal_dof(filename, mype, npe_base, ndims, gdims, compmap, varsize)
else
! Changed to support PIO1 as well
#ifdef _PIO1
call pio_readdof(filename, compmap, MPI_COMM_WORLD, 81, ndims, gdims)
#else
call pio_readdof(filename, ndims, gdims, compmap, MPI_COMM_WORLD)
#endif

! print *,__FILE__,__LINE__,' gdims=',ndims
endif
maplen = size(compmap)
! color = 0
Expand Down Expand Up @@ -249,8 +261,10 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &
ierr = PIO_CreateFile(iosystem, File, iotype, trim(fname), mode)

call WriteMetadata(File, gdims, vari, varr, vard, unlimdimindof)

call MPI_Barrier(comm,ierr)
call t_stampf(wall(1), usr(1), sys(1))

if(.not. unlimdimindof) then
#ifdef VARINT
call PIO_InitDecomp(iosystem, PIO_INT, gdims, compmap, iodesc_i4, rearr=rearr)
Expand All @@ -262,7 +276,8 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &
call PIO_InitDecomp(iosystem, PIO_DOUBLE, gdims, compmap, iodesc_r8, rearr=rearr)
#endif
endif
! print *,__FILE__,__LINE__,minval(dfld),maxval(dfld),minloc(dfld),maxloc(dfld)

! print *,__FILE__,__LINE__,minval(dfld),maxval(dfld),minloc(dfld),maxloc(dfld)

do frame=1,nframes
recnum = frame
Expand Down Expand Up @@ -550,7 +565,9 @@ subroutine WriteMetadata(File, gdims, vari, varr, vard,unlimdimindof)
ndims=ndims-1
endif
allocate(dimid(ndims+1))

do i=1,ndims

write(dimname,'(a,i6.6)') 'dim',i
iostat = PIO_def_dim(File, trim(dimname), int(gdims(i),pio_offset_kind), dimid(i))
enddo
Expand Down

0 comments on commit 467cb31

Please sign in to comment.