Skip to content

Commit

Permalink
engineering_optim_trials - correcting the measurement of memory-I/O l…
Browse files Browse the repository at this point in the history
…oad in the benchmarking kernel
  • Loading branch information
CKehl committed Jan 20, 2021
1 parent 2a7e9ae commit 5f5ca89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parcels/kernel_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ def execute_jit(self, pset, endtime, dt):
if not g.lat.flags.c_contiguous:
# g.lat = g.lat.copy()
g.lat = np.array(g.lat, order='C')

fargs = [byref(f.ctypes_struct) for f in self.field_args.values()]
fargs += [c_double(f) for f in self.const_args.values()]
self._mem_io_timings.stop_timing()
self._mem_io_timings.accumulate_timing()

self._compute_timings.start_timing()
fargs = [byref(f.ctypes_struct) for f in self.field_args.values()]
fargs += [c_double(f) for f in self.const_args.values()]
particle_data = pset._particle_data.ctypes.data_as(c_void_p)
self._function(c_int(len(pset)), particle_data,
c_double(endtime),
Expand Down

0 comments on commit 5f5ca89

Please sign in to comment.