[cig-commits] [commit] master: enabling blocking, collective IO for wavefields (700e7f5)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Fri Oct 17 05:29:24 PDT 2014
Repository : https://github.com/geodynamics/axisem
On branch : master
Link : https://github.com/geodynamics/axisem/compare/607f803cf074063627513d235f9ed0837fc1dd44...b6457db24acdde4a4e1c08935ae1b22adf87f5bf
>---------------------------------------------------------------
commit 700e7f517be7615e819b0eb95c2ce002272da6a6
Author: martinvandriel <martin at vandriel.de>
Date: Wed Oct 15 17:16:28 2014 +0200
enabling blocking, collective IO for wavefields
>---------------------------------------------------------------
700e7f517be7615e819b0eb95c2ce002272da6a6
SOLVER/nc_routines.F90 | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/SOLVER/nc_routines.F90 b/SOLVER/nc_routines.F90
index 18affea..8cba973 100644
--- a/SOLVER/nc_routines.F90
+++ b/SOLVER/nc_routines.F90
@@ -320,6 +320,7 @@ subroutine nc_dump_strain(isnap_loc)
stepstodump = stepstodump + 1
if (isnap_loc == 0) return
+#ifndef upnc
if (dumpposition(mod(isnap_loc, dumpstepsnap))) then
! wait for other processes to finish writing, measure waiting time and
@@ -353,6 +354,7 @@ subroutine nc_dump_strain(isnap_loc)
& 'dumping processor. Consider adapting netCDF output variables',&
& '(disable compression, increase dumpstepsnap)')") tackl-tickl
end if
+#endif
isnap_global = isnap_loc
ndumps = stepstodump
@@ -369,11 +371,17 @@ subroutine nc_dump_strain(isnap_loc)
copy_surfdumpvar_velo = surfdumpvar_velo(1:ndumps, 1:3, 1:maxind)
copy_surfdumpvar_srcdisp = surfdumpvar_srcdisp(1:ndumps, 1:3, 1:maxind)
+#ifndef upnc
call c_spawn_dumpthread(stepstodump)
stepstodump = 0
end if
end if
+#else
+ call nc_dump_strain_to_disk
+ stepstodump = 0
+#endif
+#ifndef upnc
! Final and last dump of all remaining
! not done in unblocking fashion using a thread, as there is nothing to
! compute anymore
@@ -408,6 +416,7 @@ subroutine nc_dump_strain(isnap_loc)
call barrier
end do
end if
+#endif
#endif
end subroutine nc_dump_strain
@@ -429,9 +438,12 @@ subroutine nc_dump_strain_to_disk() bind(c, name="nc_dump_strain_to_disk")
dumpsize = 0
call cpu_time(tick)
+#ifndef upnc
call check( nf90_open(path=datapath(1:lfdata)//"/axisem_output.nc4", &
mode=NF90_WRITE, ncid=ncid_out) )
+#endif
+ call barrier
call getgrpid(ncid_out, "Snapshots", ncid_snapout)
isnap_loc = isnap_global
if (verbose > 0) then
@@ -482,7 +494,9 @@ subroutine nc_dump_strain_to_disk() bind(c, name="nc_dump_strain_to_disk")
call check( nf90_put_att(ncid_out, NF90_GLOBAL, 'percent completed', &
isnap_loc*100/nstrain) )
+#ifndef upnc
call check( nf90_close(ncid_out) )
+#endif
call cpu_time(tack)
deallocate(copy_oneddumpvar)
@@ -948,6 +962,7 @@ subroutine nc_define_outputfile(nrec, rec_names, rec_th, rec_th_req, rec_ph, rec
call barrier
+#ifndef upnc
if (nc_dumpbuffersize < nproc) then
write(6,*) 'ERROR: NETCDF_DUMP_BUFFER needs to be larger then the number of processors'
stop
@@ -972,6 +987,13 @@ subroutine nc_define_outputfile(nrec, rec_names, rec_th, rec_th_req, rec_ph, rec
end if
call barrier ! for nicer output only
end do
+#else
+ ! in parallel IO, always everybody dumps collectively
+ dumpstepsnap = 1
+ allocate(dumpposition(0:dumpstepsnap-1))
+ dumpposition = .true.
+ outputplan = 0
+#endif
nc_fnam = datapath(1:lfdata)//"/axisem_output.nc4"
More information about the CIG-COMMITS
mailing list