@@ -208,6 +208,9 @@ function filter_ghost(indices,gids,owners)
208208 n_new_ghost = 0
209209 global_to_ghost_indices = global_to_ghost (indices)
210210 for (global_i,owner) in zip (gids,owners)
211+ if global_i < 1
212+ continue
213+ end
211214 if owner != part_owner
212215 ghost_i = global_to_ghost_indices[global_i]
213216 if ghost_i == 0 && ! (global_i in set)
@@ -221,6 +224,9 @@ function filter_ghost(indices,gids,owners)
221224 new_ghost_i = 0
222225 set = Set {Int} ()
223226 for (global_i,owner) in zip (gids,owners)
227+ if global_i < 1
228+ continue
229+ end
224230 if owner != part_owner
225231 ghost_i = global_to_ghost_indices[global_i]
226232 if ghost_i == 0 && ! (global_i in set)
@@ -293,6 +299,9 @@ function map_x_to_y!(x_to_y,I,indices)
293299 local_to_global_indices = x_to_y (indices)
294300 for k in 1 : length (I)
295301 Ik = I[k]
302+ if Ik < 1
303+ continue
304+ end
296305 I[k] = local_to_global_indices[Ik]
297306 end
298307 I
@@ -1251,9 +1260,20 @@ function find_owner(indices,global_ids,::Type{<:OwnAndGhostIndices{T}}) where T
12511260 if T == Nothing
12521261 error (" Not enough data to perform this operation without communciation" )
12531262 end
1254- map (indices,global_ids) do indices,global_ids
1255- indices. global_to_owner[global_ids]
1263+ map (global_ids,indices) do global_ids, indices
1264+ map_global_to_owner (global_ids,indices. global_to_owner)
1265+ end
1266+ end
1267+
1268+ function map_global_to_owner (I,global_to_owner)
1269+ Ti = eltype (global_to_owner)
1270+ function map_g_to_o (g)
1271+ if g< 1
1272+ return zero (Ti)
1273+ end
1274+ global_to_owner[g]
12561275 end
1276+ map_g_to_o .(I)
12571277end
12581278
12591279part_id (a:: OwnAndGhostIndices ) = a. own. owner
@@ -1567,7 +1587,7 @@ function find_owner(indices,global_ids,::Type{<:LocalIndicesWithConstantBlockSiz
15671587 start
15681588 end
15691589 global_to_owner = BlockPartitionGlobalToOwner (start)
1570- global_to_owner[ global_ids]
1590+ map_global_to_owner ( global_ids,global_to_owner)
15711591 end
15721592end
15731593
@@ -1600,7 +1620,7 @@ function find_owner(indices,global_ids,::Type{<:LocalIndicesWithVariableBlockSiz
16001620 start = vcat (initial,[n+ 1 ])
16011621 end
16021622 global_to_owner = BlockPartitionGlobalToOwner (start)
1603- global_to_owner[ global_ids]
1623+ map_global_to_owner ( global_ids,global_to_owner)
16041624 end
16051625end
16061626
0 commit comments