|
6 | 6 | from devito.ir.iet import (Transformer, MapNodes, Iteration, BlankLine, |
7 | 7 | DummyExpr, CallableBody, List, Call, Callable, |
8 | 8 | FindNodes, Section) |
9 | | -from devito.symbolics import Byref, FieldFromPointer, Macro |
| 9 | +from devito.symbolics import Byref, FieldFromPointer, Macro, Null |
10 | 10 | from devito.types import Symbol, Scalar |
11 | 11 | from devito.types.basic import DataSymbol |
12 | 12 | from devito.tools import frozendict |
|
16 | 16 | PointerIS, Mat, CallbackVec, Vec, CallbackMat, SNES, |
17 | 17 | DummyArg, PetscInt, PointerDM, PointerMat, MatReuse, |
18 | 18 | CallbackPointerIS, CallbackPointerDM, JacobianStruct, |
19 | | - SubMatrixStruct, Initialize, Finalize, ArgvSymbol, |
20 | | - GetArgs, ArgvSymbolPtr, ArgcPtr) |
21 | | -from devito.petsc.types.macros import petsc_func_begin_user, Null |
| 19 | + SubMatrixStruct, Initialize, Finalize, ArgvSymbol) |
| 20 | +from devito.petsc.types.macros import petsc_func_begin_user |
22 | 21 | from devito.petsc.iet.nodes import PetscMetaData |
23 | 22 | from devito.petsc.utils import core_metadata, petsc_languages |
24 | 23 | from devito.petsc.iet.routines import (CBBuilder, CCBBuilder, BaseObjectBuilder, |
@@ -52,9 +51,6 @@ def lower_petsc(iet, **kwargs): |
52 | 51 | if any(filter(lambda i: isinstance(i.expr.rhs, Finalize), data)): |
53 | 52 | return finalize(iet), core_metadata() |
54 | 53 |
|
55 | | - if any(filter(lambda i: isinstance(i.expr.rhs, GetArgs), data)): |
56 | | - return get_args(iet), core_metadata() |
57 | | - |
58 | 54 | unique_grids = {i.expr.rhs.grid for (i,) in inject_solve_mapper.values()} |
59 | 55 | # Assumption is that all solves are on the same grid |
60 | 56 | if len(unique_grids) > 1: |
@@ -138,18 +134,6 @@ def finalize(iet): |
138 | 134 | return iet._rebuild(body=finalize_body) |
139 | 135 |
|
140 | 136 |
|
141 | | -def get_args(iet): |
142 | | - argc = ArgcPtr(name='argc', dtype=np.int32) |
143 | | - argv = ArgvSymbolPtr(name='argv') |
144 | | - |
145 | | - body = petsc_call('PetscGetArgs', [argc, argv]) |
146 | | - body = CallableBody( |
147 | | - body=(petsc_func_begin_user, body), |
148 | | - retstmt=(Call('PetscFunctionReturn', arguments=[0]),) |
149 | | - ) |
150 | | - return iet._rebuild(body=body) |
151 | | - |
152 | | - |
153 | 137 | def make_core_petsc_calls(objs, comm): |
154 | 138 | call_mpi = petsc_call_mpi('MPI_Comm_size', [comm, Byref(objs['size'])]) |
155 | 139 | return call_mpi, BlankLine |
|
0 commit comments