1 !-------------------------------------------------------------------------!
3 ! N A S P A R A L L E L B E N C H M A R K S 3.3 !
7 !-------------------------------------------------------------------------!
9 ! This benchmark is part of the NAS Parallel Benchmark 3.3 suite. !
10 ! It is described in NAS Technical Reports 95-020 and 02-007. !
12 ! Permission to use, copy, distribute and modify this software !
13 ! for any purpose with or without fee is hereby granted. We !
14 ! request, however, that all derived work reference the NAS !
15 ! Parallel Benchmarks 3.3. This software is provided "as is" !
16 ! without express or implied warranty. !
18 ! Information on NPB 3.3, including the technical report, the !
19 ! original specifications, source code, results and information !
20 ! on how to submit new results, is available at: !
22 ! http://www.nas.nasa.gov/Software/NPB/ !
24 ! Send comments or suggestions to npb@nas.nasa.gov !
26 ! NAS Parallel Benchmarks Group !
27 ! NASA Ames Research Center !
29 ! Moffett Field, CA 94035-1000 !
31 ! E-mail: npb@nas.nasa.gov !
32 ! Fax: (650) 604-3957 !
34 !-------------------------------------------------------------------------!
36 c---------------------------------------------------------------------
38 c Authors: R. F. Van der Wijngaart
42 c---------------------------------------------------------------------
44 c---------------------------------------------------------------------
46 c---------------------------------------------------------------------
51 integer i, niter, step, c, error, fstatus
52 double precision navg, mflops, mbytes, n3
55 double precision t, tmax, tiominv, tpc, timer_read
57 character class, cbuff*40
62 if (.not. active) goto 999
64 c---------------------------------------------------------------------
65 c Root node reads input file (if it exists) else takes
66 c defaults from parameters
67 c---------------------------------------------------------------------
68 if (node .eq. root) then
71 open (unit=2,file='inputbt.data',status='old', iostat=fstatus)
74 if (fstatus .eq. 0) then
76 233 format(' Reading from input file inputbt.data')
79 read (2,*) grid_points(1), grid_points(2), grid_points(3)
80 if (iotype .ne. 0) then
82 read (cbuff,*,iostat=i) wr_interval, rd_interval
83 if (i .ne. 0) rd_interval = 0
84 if (wr_interval .le. 0) wr_interval = wr_default
86 if (iotype .eq. 1) then
87 read (2,*) collbuf_nodes, collbuf_size
88 write(*,*) 'collbuf_nodes ', collbuf_nodes
89 write(*,*) 'collbuf_size ', collbuf_size
96 grid_points(1) = problem_size
97 grid_points(2) = problem_size
98 grid_points(3) = problem_size
99 wr_interval = wr_default
100 if (iotype .eq. 1) then
101 c set number of nodes involved in collective buffering to 4,
102 c unless total number of nodes is smaller than that.
103 c set buffer size for collective buffering to 1MB per node
104 c collbuf_nodes = min(4,no_nodes)
105 c set default to No-File-Hints with a value of 0
107 collbuf_size = 1000000
110 234 format(' No input file inputbt.data. Using compiled defaults')
112 write(*, 1001) grid_points(1), grid_points(2), grid_points(3)
113 write(*, 1002) niter, dt
114 if (no_nodes .ne. total_nodes) write(*, 1004) total_nodes
115 if (no_nodes .ne. maxcells*maxcells)
116 > write(*, 1005) maxcells*maxcells
117 write(*, 1003) no_nodes
119 if (iotype .eq. 1) write(*, 1006) 'FULL MPI-IO', wr_interval
120 if (iotype .eq. 2) write(*, 1006) 'SIMPLE MPI-IO', wr_interval
121 if (iotype .eq. 3) write(*, 1006) 'EPIO', wr_interval
122 if (iotype .eq. 4) write(*, 1006) 'FORTRAN IO', wr_interval
124 1000 format(//, ' NAS Parallel Benchmarks 3.3 -- BT Benchmark ',/)
125 1001 format(' Size: ', i4, 'x', i4, 'x', i4)
126 1002 format(' Iterations: ', i4, ' dt: ', F11.7)
127 1004 format(' Total number of processes: ', i5)
128 1005 format(' WARNING: compiled for ', i5, ' processes ')
129 1003 format(' Number of active processes: ', i5, /)
130 1006 format(' BTIO -- ', A, ' write interval: ', i3 /)
134 call mpi_bcast(niter, 1, MPI_INTEGER,
135 > root, comm_setup, error)
137 call mpi_bcast(dt, 1, dp_type,
138 > root, comm_setup, error)
140 call mpi_bcast(grid_points(1), 3, MPI_INTEGER,
141 > root, comm_setup, error)
143 call mpi_bcast(wr_interval, 1, MPI_INTEGER,
144 > root, comm_setup, error)
146 call mpi_bcast(rd_interval, 1, MPI_INTEGER,
147 > root, comm_setup, error)
152 if ( (cell_size(1,c) .gt. IMAX) .or.
153 > (cell_size(2,c) .gt. JMAX) .or.
154 > (cell_size(3,c) .gt. KMAX) ) then
155 print *,node, c, (cell_size(i,c),i=1,3)
156 print *,' Problem size too big for compiled array sizes'
172 call compute_buffer_size(5)
174 c---------------------------------------------------------------------
175 c do one time step to touch all code, and reinitialize
176 c---------------------------------------------------------------------
182 c---------------------------------------------------------------------
183 c Synchronize before placing time stamp
184 c---------------------------------------------------------------------
185 call mpi_barrier(comm_setup, error)
192 if (node .eq. root) then
193 if (mod(step, 20) .eq. 0 .or. step .eq. niter .or.
196 200 format(' Time step ', i4)
202 if (iotype .ne. 0) then
204 if (mod(step, wr_interval).eq.0 .or. step .eq. niter) then
205 if (node .eq. root) then
206 print *, 'Writing data set, time step', step
208 if (step .eq. niter .and. rd_interval .gt. 1) then
223 call verify(niter, class, verified)
225 call mpi_reduce(t, tmax, 1,
227 > root, comm_setup, error)
229 if (iotype .ne. 0) then
231 if (t .ne. 0.d0) t = 1.0d0 / t
232 call mpi_reduce(t, tiominv, 1,
234 > root, comm_setup, error)
237 if( node .eq. root ) then
238 n3 = 1.0d0*grid_points(1)*grid_points(2)*grid_points(3)
239 navg = (grid_points(1)+grid_points(2)+grid_points(3))/3.0
240 if( tmax .ne. 0. ) then
241 mflops = 1.0e-6*float(niter)*
242 > (3478.8*n3-17655.7*navg**2+28023.7*navg)
248 if (iotype .ne. 0) then
249 mbytes = n3 * 40.0 * idump * 1.0d-6
250 tiominv = tiominv / no_nodes
252 if (tiominv .ne. 0.) t = 1.d0 / tiominv
254 if (tmax .ne. 0.) tpc = t * 100.0 / tmax
255 write(*,1100) t, tpc, mbytes, mbytes*tiominv
256 1100 format(/' BTIO -- statistics:'/
257 > ' I/O timing in seconds : ', f14.2/
258 > ' I/O timing percentage : ', f14.2/
259 > ' Total data written (MB) : ', f14.2/
260 > ' I/O data rate (MB/sec) : ', f14.2)
263 call print_results('BT', class, grid_points(1),
264 > grid_points(2), grid_points(3), niter, maxcells*maxcells,
265 > total_nodes, tmax, mflops, ' floating point',
266 > verified, npbversion,compiletime, cs1, cs2, cs3, cs4, cs5,
271 call mpi_barrier(MPI_COMM_WORLD, error)
272 call mpi_finalize(error)