Skip to content

Commit d343ae0

Browse files
Merge pull request #2412 from devitocodes/change-default-bs
compiler: Bump default block size
2 parents ea94a0f + c98988f commit d343ae0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

devito/types/dimension.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,10 +1307,8 @@ def _arg_names(self):
13071307
return ()
13081308

13091309
def _arg_defaults(self, **kwargs):
1310-
# TODO: need a heuristic to pick a default incr size
1311-
# TODO: move default value to __new__
13121310
try:
1313-
return {self.step.name: 8}
1311+
return {self.step.name: 16}
13141312
except AttributeError:
13151313
# `step` not a Symbol
13161314
return {}

tests/test_dse.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,8 +2447,6 @@ def test_ftemps_option(self):
24472447
t = grid.stepping_dim
24482448

24492449
nthreads = 2
2450-
x0_blk0_size = 8
2451-
y0_blk0_size = 8
24522450

24532451
u = TimeFunction(name='u', grid=grid, space_order=3)
24542452
u1 = TimeFunction(name="u", grid=grid, space_order=3)
@@ -2475,6 +2473,12 @@ def test_ftemps_option(self):
24752473
with pytest.raises(InvalidArgument):
24762474
op1(time_M=1, u=u1)
24772475

2476+
block_dims = [i for i in op1.dimensions if i.is_Block and i._depth == 1]
2477+
assert len(block_dims) == 2
2478+
mapper = {d.root: d for d in block_dims}
2479+
x0_blk0_size = mapper[x]._arg_defaults()[mapper[x].step.name]
2480+
y0_blk0_size = mapper[y]._arg_defaults()[mapper[y].step.name]
2481+
24782482
# Prepare to run op1
24792483
shape = [nthreads, x0_blk0_size, y0_blk0_size, grid.shape[-1]]
24802484
ofuncs = [i.make(shape) for i in op1.temporaries]
@@ -2845,7 +2849,7 @@ def test_fullopt(self):
28452849

28462850
# Check expected opcount/oi
28472851
assert summary[('section1', None)].ops == 92
2848-
assert np.isclose(summary[('section1', None)].oi, 2.072, atol=0.001)
2852+
assert np.isclose(summary[('section1', None)].oi, 1.99, atol=0.001)
28492853

28502854
# With optimizations enabled, there should be exactly four BlockDimensions
28512855
op = wavesolver.op_fwd()

0 commit comments

Comments
 (0)