@@ -99,4 +99,22 @@ Adapt.adapt_structure(to, H::Dagger.HaloArray) =
9999 HaloArray (Adapt. adapt (to, H. center),
100100 Adapt. adapt .(Ref (to), H. edges),
101101 Adapt. adapt .(Ref (to), H. corners),
102- H. halo_width)
102+ H. halo_width)
103+
104+ function aliasing (A:: HaloArray )
105+ return CombinedAliasing ([aliasing (A. center), aliasing (A. edges), aliasing (A. corners)])
106+ end
107+ memory_space (A:: HaloArray ) = memory_space (A. center)
108+ function move_rewrap (cache:: AliasedObjectCache , from_proc:: Processor , to_proc:: Processor , from_space:: MemorySpace , to_space:: MemorySpace , A:: HaloArray )
109+ center_chunk = rewrap_aliased_object! (cache, from_proc, to_proc, from_space, to_space, A. center)
110+ edge_chunks = ntuple (i-> rewrap_aliased_object! (cache, from_proc, to_proc, from_space, to_space, A. edges[i]), length (A. edges))
111+ corner_chunks = ntuple (i-> rewrap_aliased_object! (cache, from_proc, to_proc, from_space, to_space, A. corners[i]), length (A. corners))
112+ halo_width = A. halo_width
113+ to_w = root_worker_id (to_proc)
114+ return remotecall_fetch (to_w, from_proc, to_proc, from_space, to_space, center_chunk, edge_chunks, corner_chunks, halo_width) do from_proc, to_proc, from_space, to_space, center_chunk, edge_chunks, corner_chunks, halo_width
115+ center_new = move (from_proc, to_proc, center_chunk)
116+ edges_new = ntuple (i-> move (from_proc, to_proc, edge_chunks[i]), length (edge_chunks))
117+ corners_new = ntuple (i-> move (from_proc, to_proc, corner_chunks[i]), length (corner_chunks))
118+ return tochunk (HaloArray (center_new, edges_new, corners_new, halo_width), to_proc)
119+ end
120+ end
0 commit comments