@@ -1745,7 +1745,7 @@ def g2_tilde(field, phi, theta):
17451745 assert len ([i for i in FindSymbols ().visit (bns ['x0_blk0' ]) if i .is_Array ]) == 7
17461746 assert len (FindNodes (VExpanded ).visit (pbs ['x0_blk0' ])) == 3
17471747
1748- @pytest .mark .parametrize ('so_ops' , [(4 , 147 ), (8 , 211 )])
1748+ @pytest .mark .parametrize ('so_ops' , [(4 , 146 ), (8 , 210 )])
17491749 @switchconfig (profiling = 'advanced' )
17501750 def test_tti_J_akin_complete (self , so_ops ):
17511751 grid = Grid (shape = (16 , 16 , 16 ))
@@ -2664,6 +2664,25 @@ def test_sparse_const(self):
26642664 op ()
26652665 assert np .all (src .data == 8 )
26662666
2667+ def test_space_and_time_invariant_together (self ):
2668+ grid = Grid (shape = (34 , 45 , 50 ))
2669+
2670+ a = Function (name = 'a' , grid = grid , space_order = 8 )
2671+ vx = TimeFunction (name = 'vx' , grid = grid , space_order = 8 )
2672+ tzz = vx .func (name = 'tzz' )
2673+
2674+ eqn = Eq (tzz .forward , a .dy .dz * (vx .dx .dy + vx .dx .dz ) + tzz )
2675+
2676+ op = Operator (eqn , opt = ('advanced' , {'openmp' : False }))
2677+
2678+ op .cfunction
2679+
2680+ assert_structure (
2681+ op ,
2682+ ['t,x0_blk0,y0_blk0,x,y,z' , 't,x0_blk0,y0_blk0,x,y,z' ],
2683+ 'tx0_blk0y0_blk0xyzyz'
2684+ )
2685+
26672686
26682687class TestIsoAcoustic :
26692688
@@ -2706,9 +2725,9 @@ def test_fullopt(self):
27062725 bns , _ = assert_blocking (op0 , {})
27072726 bns , _ = assert_blocking (op1 , {'x0_blk0' }) # due to loop blocking
27082727
2709- assert summary0 [('section0' , None )].ops == 50
2728+ assert summary0 [('section0' , None )].ops == 55
27102729 assert summary0 [('section1' , None )].ops == 44
2711- assert np .isclose (summary0 [('section0' , None )].oi , 2.851 , atol = 0.001 )
2730+ assert np .isclose (summary0 [('section0' , None )].oi , 3.136 , atol = 0.001 )
27122731
27132732 assert summary1 [('section0' , None )].ops == 31
27142733 assert summary1 [('section1' , None )].ops == 88
@@ -2760,7 +2779,7 @@ def tti_noopt(self):
27602779 # Make sure no opts were applied
27612780 op = wavesolver .op_fwd (False )
27622781 assert len (op ._func_table ) == 0
2763- assert summary [('section0' , None )].ops == 743
2782+ assert summary [('section0' , None )].ops == 753
27642783
27652784 return v , rec
27662785
@@ -2846,7 +2865,7 @@ class TestTTIv2:
28462865
28472866 @switchconfig (profiling = 'advanced' )
28482867 @pytest .mark .parametrize ('space_order,expected' , [
2849- (4 , 200 ), (12 , 392 )
2868+ (4 , 190 ), (12 , 382 )
28502869 ])
28512870 def test_opcounts (self , space_order , expected ):
28522871 grid = Grid (shape = (3 , 3 , 3 ))
0 commit comments