Skip to content

Commit 1146a07

Browse files
committed
misc: Rebase fixes
1 parent 0af998d commit 1146a07

10 files changed

Lines changed: 25 additions & 11 deletions

File tree

.github/workflows/examples-mpi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ on:
1717
push:
1818
branches:
1919
- main
20+
- master
2021
pull_request:
2122
branches:
2223
- main
24+
- master
2325

2426
jobs:
2527
build:

.github/workflows/examples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- master
1314
pull_request:
1415
branches:
1516
- main
17+
- master
1618

1719
jobs:
1820
tutorials:

.github/workflows/flake8.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- master
1314
pull_request:
1415
branches:
1516
- main
17+
- master
1618

1719
jobs:
1820
flake8:

.github/workflows/pytest-core-mpi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- master
1314
pull_request:
1415
branches:
1516
- main
17+
- master
1618

1719
jobs:
1820
test-mpi-basic:

.github/workflows/pytest-core-nompi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- master
1314
pull_request:
1415
branches:
1516
- main
17+
- master
1618

1719
jobs:
1820
pytest:

.github/workflows/pytest-petsc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ on:
99
# but only for the master branch
1010
push:
1111
branches:
12+
- main
1213
- master
1314
pull_request:
1415
branches:
16+
- main
1517
- master
1618

1719
jobs:

.github/workflows/tutorials.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- master
1314
pull_request:
1415
branches:
1516
- main
17+
- master
1618

1719
jobs:
1820
tutorials:

devito/petsc/iet/routines.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from devito.ir.iet import (Call, FindSymbols, List, Uxreplace, CallableBody,
55
Dereference, DummyExpr, BlankLine, Callable, FindNodes,
66
retrieve_iteration_tree, filter_iterations, Iteration)
7-
from devito.symbolics import (Byref, FieldFromPointer, cast_mapper, VOIDP,
7+
from devito.symbolics import (Byref, FieldFromPointer, cast, VOID,
88
FieldFromComposite, IntDiv, Deref, Mod)
99
from devito.symbolics.unevaluation import Mul
1010
from devito.types.basic import AbstractFunction
@@ -671,8 +671,10 @@ def _whole_formfunc_body(self):
671671
calls += (
672672
petsc_call('VecGetSubVector', [X, field_ptr, Byref(sobjs[x_name])]),
673673
petsc_call('VecGetSubVector', [F, field_ptr, Byref(sobjs[f_name])]),
674-
petsc_call(self.formfuncs[i].name, [objs['snes'], sobjs[x_name],
675-
sobjs[f_name], VOIDP(objs['LocalSubdms'].indexed[i])]),
674+
petsc_call(self.formfuncs[i].name, [
675+
objs['snes'], sobjs[x_name], sobjs[f_name],
676+
VOID(objs['LocalSubdms'].indexed[i], stars='*')
677+
]),
676678
petsc_call('VecRestoreSubVector', [X, field_ptr, Byref(sobjs[x_name])]),
677679
petsc_call('VecRestoreSubVector', [F, field_ptr, Byref(sobjs[f_name])]),
678680
)
@@ -992,7 +994,7 @@ def snes_ctx(self):
992994
The [optional] context for private data for the function evaluation routine.
993995
https://petsc.org/main/manualpages/SNES/SNESSetFunction/
994996
"""
995-
return VOIDP(self.solver_objs['dmda'])
997+
return VOID(self.solver_objs['dmda'], stars='*')
996998

997999
def _setup(self):
9981000
objs = self.objs
@@ -1526,11 +1528,12 @@ def replace_array(self, target):
15261528
xlocal = sobjs.get(f'xlocal{target.name}', sobjs['xlocal'])
15271529
start_ptr = sobjs[f'{target.name}_ptr']
15281530

1531+
caster = cast(target.dtype, '*')
15291532
return (
15301533
petsc_call('VecGetSize', [xlocal, Byref(sobjs['localsize'])]),
15311534
DummyExpr(
15321535
start_ptr,
1533-
cast_mapper[(target.dtype, '*')](
1536+
caster(
15341537
FieldFromPointer(target._C_field_data, target._C_symbol)
15351538
) + Mul(target_time, sobjs['localsize']),
15361539
init=True

devito/petsc/types/object.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from devito.tools import CustomDtype, dtype_to_cstr, as_tuple, CustomIntType
33
from devito.types import (LocalObject, LocalCompositeObject, ModuloDimension,
44
TimeDimension, ArrayObject, CustomDimension)
5-
from devito.symbolics import Byref, Cast
5+
from devito.symbolics import Byref, cast
66
from devito.types.basic import DataSymbol
77
from devito.petsc.iet.utils import petsc_call
88

@@ -42,8 +42,7 @@ def _C_free_priority(self):
4242
return 4
4343

4444

45-
class DMCast(Cast):
46-
_base_typ = 'DM'
45+
DMCast = cast('DM')
4746

4847

4948
class CallbackMat(LocalObject):
@@ -232,8 +231,7 @@ def __init__(self, name='subctx', pname='SubMatrixCtx', fields=None,
232231
_C_modifier = None
233232

234233

235-
class JacobianStructCast(Cast):
236-
_base_typ = 'struct JacobianCtx *'
234+
JacobianStructCast = cast('struct JacobianCtx *')
237235

238236

239237
class PETScArrayObject(ArrayObject):

devito/tools/dtypes_lowering.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'CustomIntType']
2020

2121

22-
2322
# *** Custom np.dtypes
2423

2524
# NOTE: the following is inspired by pyopencl.cltypes

0 commit comments

Comments
 (0)