Skip to content

Commit 1472ec0

Browse files
committed
A test that requires the ghost to owned neighbour exchange
1 parent 74bdc02 commit 1472ec0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/dev/distributed_aggregation.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ function generate_dumbell(ranks, np, nc, ng)
1717

1818
geo1 = disk(R,x0=p0)
1919
geo2 = quadrilateral(;x0=Point(-L/4+h/4,5*h/4),
20-
d1=VectorValue(6*h+h/2,0.0),
21-
d2=VectorValue(0.0,4*h+h/2))
20+
d1=VectorValue(8*h+h/2,0.0),
21+
d2=VectorValue(0.0,5*h+h/2))
2222
geo3 = quadrilateral(;x0=Point(-L/4+3*h/4,7*h/4),
23-
d1=VectorValue(6*h-h/2,0.0),
24-
d2=VectorValue(0.0,4*h-h/2))
23+
d1=VectorValue(8*h-h/2,0.0),
24+
d2=VectorValue(0.0,5*h-h/2))
2525
geo = union(geo1,intersect(geo2,!geo3))
2626
bgmodel = CartesianDiscreteModel(ranks,np,pmin,pmax,(nc,nc);ghost=(ng,ng))
2727
return bgmodel, geo
@@ -71,6 +71,7 @@ function find_optimal_roots!(lcell_to_root,lcell_to_path_length,lcell_to_bbox_di
7171

7272
for (k,nbor) in enumerate(roots_cache.neighbors_rcv)
7373
for (lcell,root,len,bb_diam) in zip(lids_rcv[k],roots_rcv[k],lengths_rcv[k],bb_diams_rcv[k])
74+
root == 0 && continue
7475
if lcell_to_path_length[lcell] > len
7576
lcell_to_root[lcell] = root
7677
lcell_to_owner[lcell] = nbor
@@ -108,9 +109,9 @@ function find_optimal_roots!(lcell_to_root,lcell_to_path_length,lcell_to_bbox_di
108109
end
109110

110111
distribute = PartitionedArrays.DebugArray
111-
np = (2,1)
112+
np = (3,1)
112113
ranks = distribute(LinearIndices((prod(np),)))
113-
bgmodel, geo = generate_dumbell(ranks, np, 8, 2)
114+
bgmodel, geo = generate_dumbell(ranks, np, 9, 2)
114115
cutgeo = cut(bgmodel, geo)
115116

116117
cell_indices = partition(get_cell_gids(bgmodel))

0 commit comments

Comments
 (0)