Skip to content

Commit

Permalink
make benchmark correctly work for the point mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cyliang368 committed Jun 18, 2024
1 parent 8664625 commit a85d095
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions raster/r.horizon/benchmark/benchmark_rhorizon.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,28 @@ def benchmark(size, step, point_mode, label, results):

generate_map(rows=size, cols=size, fname=reference)

module = Module(
"r.horizon",
elevation=reference,
output=output,
direction=0,
step=step,
)
if point_mode:
r = Region()
r.set_current()
x = (r.east + r.west) / 2
y = (r.north + r.south) / 2
module.coordinates = (x, y)

module = Module(
"r.horizon",
elevation=reference,
output=output,
direction=0,
step=step,
coordinates=(x, y),
)
else:
module = Module(
"r.horizon",
elevation=reference,
output=output,
direction=0,
step=step,
)

results.append(bm.benchmark_nprocs(module, label=label, max_nprocs=8, repeat=3))
Module(
Expand Down

0 comments on commit a85d095

Please sign in to comment.