diff --git a/src/BoundaryConditions/fill_halo_regions.jl b/src/BoundaryConditions/fill_halo_regions.jl index fa380e7029..7ac3e79ea5 100644 --- a/src/BoundaryConditions/fill_halo_regions.jl +++ b/src/BoundaryConditions/fill_halo_regions.jl @@ -64,7 +64,9 @@ function fill_halo_regions!(c::MaybeTupledData, boundary_conditions, indices, lo return nothing end -function fill_halo_event!(c, fill_halos!, bcs, indices, loc, arch, grid, args...; kwargs...) +function fill_halo_event!(c, fill_halos!, bcs, indices, loc, arch, grid, args...; + async = false, # This kwargs is specific to DistributedGrids, here is does nothing + kwargs...) # Calculate size and offset of the fill_halo kernel # We assume that the kernel size is the same for west and east boundaries, @@ -295,27 +297,27 @@ end ##### Kernel launchers for single-sided fill_halos ##### -fill_west_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_west_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_west_halo!, c, bc, loc, grid, Tuple(args); kwargs...) -fill_east_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_east_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_east_halo!, c, bc, loc, grid, Tuple(args); kwargs...) -fill_south_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_south_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_south_halo!, c, bc, loc, grid, Tuple(args); kwargs...) -fill_north_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_north_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_north_halo!, c, bc, loc, grid, Tuple(args); kwargs...) -fill_bottom_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_bottom_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_bottom_halo!, c, bc, loc, grid, Tuple(args); kwargs...) -fill_top_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = +fill_top_halo!(c, bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) = launch!(arch, grid, KernelParameters(size, offset), _fill_only_top_halo!, c, bc, loc, grid, Tuple(args); kwargs...) @@ -323,17 +325,17 @@ fill_top_halo!(c, bc, size, offset, loc, arch, grid, args...; kwargs...) = ##### Kernel launchers for double-sided fill_halos ##### -function fill_west_and_east_halo!(c, west_bc, east_bc, size, offset, loc, arch, grid, args...; kwargs...) +function fill_west_and_east_halo!(c, west_bc, east_bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) return launch!(arch, grid, KernelParameters(size, offset), _fill_west_and_east_halo!, c, west_bc, east_bc, loc, grid, Tuple(args); kwargs...) end -function fill_south_and_north_halo!(c, south_bc, north_bc, size, offset, loc, arch, grid, args...; kwargs...) +function fill_south_and_north_halo!(c, south_bc, north_bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) return launch!(arch, grid, KernelParameters(size, offset), _fill_south_and_north_halo!, c, south_bc, north_bc, loc, grid, Tuple(args); kwargs...) end -function fill_bottom_and_top_halo!(c, bottom_bc, top_bc, size, offset, loc, arch, grid, args...; kwargs...) +function fill_bottom_and_top_halo!(c, bottom_bc, top_bc, size, offset, loc, arch, grid, args...; only_local_halos = false, kwargs...) return launch!(arch, grid, KernelParameters(size, offset), _fill_bottom_and_top_halo!, c, bottom_bc, top_bc, loc, grid, Tuple(args); kwargs...) end diff --git a/src/BoundaryConditions/fill_halo_regions_periodic.jl b/src/BoundaryConditions/fill_halo_regions_periodic.jl index 890b9c2fba..edd97528fa 100644 --- a/src/BoundaryConditions/fill_halo_regions_periodic.jl +++ b/src/BoundaryConditions/fill_halo_regions_periodic.jl @@ -15,19 +15,19 @@ end @inline fix_halo_offsets(o, co) = co > 0 ? o - co : o # Windowed fields have only positive offsets to correct -function fill_west_and_east_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; kw...) +function fill_west_and_east_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; only_local_halos = false, kw...) c_parent, yz_size, offset = parent_size_and_offset(c, 2, 3, size, offset) launch!(arch, grid, KernelParameters(yz_size, offset), fill_periodic_west_and_east_halo!, c_parent, Val(grid.Hx), grid.Nx; kw...) return nothing end -function fill_south_and_north_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; kw...) +function fill_south_and_north_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; only_local_halos = false, kw...) c_parent, xz_size, offset = parent_size_and_offset(c, 1, 3, size, offset) launch!(arch, grid, KernelParameters(xz_size, offset), fill_periodic_south_and_north_halo!, c_parent, Val(grid.Hy), grid.Ny; kw...) return nothing end -function fill_bottom_and_top_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; kw...) +function fill_bottom_and_top_halo!(c, ::PBCT, ::PBCT, size, offset, loc, arch, grid, args...; only_local_halos = false, kw...) c_parent, xy_size, offset = parent_size_and_offset(c, 1, 2, size, offset) launch!(arch, grid, KernelParameters(xy_size, offset), fill_periodic_bottom_and_top_halo!, c_parent, Val(grid.Hz), grid.Nz; kw...) return nothing diff --git a/src/Utils/kernel_launching.jl b/src/Utils/kernel_launching.jl index 3625ae7632..097ce8fe00 100644 --- a/src/Utils/kernel_launching.jl +++ b/src/Utils/kernel_launching.jl @@ -272,10 +272,7 @@ end @inline function _launch!(arch, grid, workspec, kernel!, first_kernel_arg, other_kernel_args...; exclude_periphery = false, reduced_dimensions = (), - active_cells_map = nothing, - # TODO: these two kwargs do nothing: - only_local_halos = false, - async = false) + active_cells_map = nothing) location = Oceananigans.location(first_kernel_arg)