Skip to content

Commit 0c1b1e5

Browse files
committed
replace vecgetsize with vecgetlocalsize
1 parent 75b5ec7 commit 0c1b1e5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

devito/petsc/iet/builder.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ def _setup(self):
7171
v for v, dim in zip(target.shape_allocated, target.dimensions) if dim.is_Space
7272
)
7373
# TODO: Check - VecCreateSeqWithArray
74-
local_x = petsc_call('VecCreateMPIWithArray',
75-
[sobjs['comm'], 1, local_size, 'PETSC_DECIDE',
74+
# local_x = petsc_call('VecCreateMPIWithArray',
75+
# [sobjs['comm'], 1, local_size, 'PETSC_DECIDE',
76+
# field_from_ptr, Byref(sobjs['xlocal'])])
77+
local_x = petsc_call('VecCreateSeqWithArray',
78+
['PETSC_COMM_SELF', 1, local_size,
7679
field_from_ptr, Byref(sobjs['xlocal'])])
7780

7881
# TODO: potentially also need to set the DM and local/global map to xlocal
7982

80-
get_local_size = petsc_call('VecGetSize',
83+
get_local_size = petsc_call('VecGetLocalSize',
8184
[sobjs['xlocal'], Byref(sobjs['localsize'])])
8285

8386
global_b = petsc_call('DMCreateGlobalVector',

0 commit comments

Comments
 (0)