Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace LazyBroadcast with custom (uninstantiate) version
Browse files Browse the repository at this point in the history
charleskawczynski committed Jan 21, 2025
1 parent adcf4d4 commit 5151b57
Showing 31 changed files with 105 additions and 92 deletions.
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_utils.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# import CUDA
import ClimaComms
using BenchmarkTools, Dates
using LazyBroadcast: @lazy_broadcast
using ClimaCore: @lazy

"""
caller_name(@__FILE__)
2 changes: 1 addition & 1 deletion benchmarks/scripts/index_swapping.jl
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ end;
function custom_kernel_bc!(X, Y, us::UniversalSizesStatic; swap=0, printtb=false, nreps = 1, print_info = true, bm=nothing, n_trials=30)
(; x1, x2, x3) = X
(; y1) = Y
bc = @lazy_broadcast @. foo(x1, x2, x3)
bc = @lazy @. foo(x1, x2, x3)
@assert !(y1 isa Array)
f = if swap==0
custom_kernel_knl_bc_0swap!
2 changes: 1 addition & 1 deletion benchmarks/scripts/indexing_and_static_ndranges.jl
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ end;
function custom_kernel_bc!(X, Y, us::AbstractUniversalSizes; printtb=false, use_pw=true, nreps = 1, bm=nothing, n_trials = 30)
(; x1, x2, x3) = X
(; y1) = Y
bc_base = @lazy_broadcast @. myadd(x1, x2, x3)
bc_base = @lazy @. myadd(x1, x2, x3)
bc = use_pw ? to_pointwise_bc(bc_base) : bc_base
e = Inf
if y1 isa Array
3 changes: 3 additions & 0 deletions src/ClimaCore.jl
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ using PkgVersion
const VERSION = PkgVersion.@Version
import ClimaComms

# Temporary helpers to work around https://github.com/CliMA/ClimaCore.jl/issues/2146
include("lazy_broadcast.jl")

include("DebugOnly/DebugOnly.jl")
include("interface.jl")
include("devices.jl")
20 changes: 20 additions & 0 deletions src/lazy_broadcast.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Temporary helpers to work around https://github.com/CliMA/ClimaCore.jl/issues/2146
using Base.Broadcast: materialize, instantiate
import Base.Broadcast: broadcasted
function _lazy_broadcast end
struct LazyBroadcasted{T}
value::T
end
Base.Broadcast.broadcasted(::typeof(_lazy_broadcast), x) = LazyBroadcasted(x)
# Cannot return instantiated object here, due to https://github.com/CliMA/ClimaCore.jl/issues/2146
Base.materialize(x::LazyBroadcasted) = x.value
macro _lazy_broadcast(expr)
return quote
_lazy_broadcast.($(esc(expr)))
end
end
macro lazy(expr)
return quote
_lazy_broadcast.($(esc(expr)))
end
end
8 changes: 4 additions & 4 deletions test/DataLayouts/unit_has_uniform_datalayouts.jl
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ using Test
using ClimaCore.DataLayouts
import ClimaCore.Geometry
import ClimaComms
import LazyBroadcast: @lazy_broadcast
import ClimaCore: @lazy
using StaticArrays
import Random
Random.seed!(1234)
@@ -30,9 +30,9 @@ Random.seed!(1234)
data_VIJFH = VIJFH{S}(ArrayType{FT}, zeros; Nv, Nij, Nh)
data_VIFH = VIFH{S}(ArrayType{FT}, zeros; Nv, Ni, Nh)

bc = @lazy_broadcast @. data_VIFH + data_VIFH
bc = @lazy @. data_VIFH + data_VIFH
@test DataLayouts.has_uniform_datalayouts(bc)
bc = @lazy_broadcast @. data_IJFH + data_VF
bc = @lazy @. data_IJFH + data_VF
@test !DataLayouts.has_uniform_datalayouts(bc)

data_VIJFHᶜ = VIJFH{S}(ArrayType{FT}, zeros; Nv, Nij, Nh)
@@ -41,6 +41,6 @@ Random.seed!(1234)
# This is not a valid broadcast expression,
# but these two datalayouts can exist in a
# valid broadcast expression (e.g., interpolation).
bc = @lazy_broadcast @. data_VIJFHᶜ + data_VIJFHᶠ
bc = @lazy @. data_VIJFHᶜ + data_VIJFHᶠ
@test DataLayouts.has_uniform_datalayouts(bc)
end
2 changes: 1 addition & 1 deletion test/DataLayouts/unit_linear_indexing.jl
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ using ClimaComms
ClimaComms.@import_required_backends
import ClimaCore: Domains, Meshes, Topologies, Spaces, Fields, Operators
import ClimaCore.DataLayouts: get_struct
using LazyBroadcast: @lazy_broadcast
using ClimaCore: @lazy

Random.seed!(1234)

10 changes: 5 additions & 5 deletions test/DataLayouts/unit_non_extruded_broadcast.jl
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ using Revise; include(joinpath("test", "DataLayouts", "unit_non_extruded_broadca
using Test
using ClimaComms
import Base.Broadcast: broadcasted, instantiate
using LazyBroadcast: @lazy_broadcast
using ClimaCore: @lazy
using ClimaCore.DataLayouts
using ClimaCore.Geometry
using ClimaCore: Geometry, Domains, Topologies, Meshes, Spaces, Fields

@testset "unit_non_extruded_broadcast" begin
a = [1, 2, 3]
b = [10, 20, 30]
bc = @lazy_broadcast @. a + b
bc = @lazy @. a + b
bc = instantiate(bc)
@test !DataLayouts.isascalar(bc)
bc = DataLayouts.to_non_extruded_broadcasted(bc)
@@ -32,7 +32,7 @@ end
data = DataF{S}(ArrayType{FT}, zeros)
data[] = 5.0

bc = @lazy_broadcast @. data + data
bc = @lazy @. data + data
bc = instantiate(bc)
@test !DataLayouts.isascalar(bc)
bc = DataLayouts.to_non_extruded_broadcasted(bc)
@@ -50,7 +50,7 @@ foo(a, b, c) = a
data = DataF{S}(ArrayType{FT}, zeros)
data_empty = similar(data, typeof(()))

bc = @lazy_broadcast @. foo(data_empty, data_empty, ())
bc = @lazy @. foo(data_empty, data_empty, ())
bc = instantiate(bc)
@test !DataLayouts.isascalar(bc)
bc = DataLayouts.to_non_extruded_broadcasted(bc)
@@ -86,7 +86,7 @@ end

@testset "Conceptual test (to compare against Base)" begin
foo(a, b) = a
bc = @lazy_broadcast @. foo((), ())
bc = @lazy @. foo((), ())
bc = instantiate(bc)
@test_throws BoundsError bc[]
end
2 changes: 1 addition & 1 deletion test/MatrixFields/matrix_field_test_utils.jl
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ using JET
import Dates
import Random: seed!
import Base.Broadcast: materialize, materialize!
import LazyBroadcast: @lazy_broadcast
import ClimaCore: @lazy
import BenchmarkTools as BT

import ClimaComms
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ end
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "matrix of covectors times matrix of vectors" begin

bc = @lazy_broadcast @. ᶜᶠmat_AC1 ᶠᶜmat_C12
bc = @lazy @. ᶜᶠmat_AC1 ᶠᶜmat_C12
result = materialize(bc)

ref_set_result! =
Original file line number Diff line number Diff line change
@@ -13,8 +13,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
of numbers times matrix of covectors times matrix of \
vectors" begin

bc =
@lazy_broadcast @. ᶜᶠmat_AC1 ᶠᶜmat_C12 ᶜᶠmat ᶠᶜmat_AC1 ᶜᶠmat_C12
bc = @lazy @. ᶜᶠmat_AC1 ᶠᶜmat_C12 ᶜᶠmat ᶠᶜmat_AC1 ᶜᶠmat_C12
result = materialize(bc)

ref_set_result! =
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
and covectors times matrix of numbers and vectors times \
vector of numbers" begin

bc = @lazy_broadcast @. ᶜᶠmat_AC1_num ᶠᶜmat_C12_AC1 ᶜᶠmat_num_C12 ᶠvec
bc = @lazy @. ᶜᶠmat_AC1_num ᶠᶜmat_C12_AC1 ᶜᶠmat_num_C12 ᶠvec
result = materialize(bc)

ref_set_result! =
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
times matrix of numbers times matrix of numbers times \
vector of nested values" begin

bc = @lazy_broadcast @. ᶜᶠmat_NT ᶠᶜmat ᶜᶠmat ᶠᶜmat_NT ᶜvec_NT
bc = @lazy @. ᶜᶠmat_NT ᶠᶜmat ᶜᶠmat ᶠᶜmat_NT ᶜvec_NT
result = materialize(bc)

ref_set_result! =
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ end
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "matrix of vectors divided by scalar" begin

bc = @lazy_broadcast @. ᶜᶠmat_C12 / 2
bc = @lazy @. ᶜᶠmat_C12 / 2
result = materialize(bc)

ref_set_result! =
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times vector" begin
bc = @lazy_broadcast @. ᶜᶜmat ᶜvec
bc = @lazy @. ᶜᶜmat ᶜvec
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜvec)
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times bi-diagonal matrix times \
tri-diagonal matrix times quad-diagonal matrix times \
vector, but with forced right-associativity" begin
bc = @lazy_broadcast @. ᶜᶜmat (ᶜᶠmat (ᶠᶠmat (ᶠᶜmat ᶜvec)))
bc = @lazy @. ᶜᶜmat (ᶜᶠmat (ᶠᶠmat (ᶠᶜmat ᶜvec)))
if using_cuda
@test_throws invalid_ir_error materialize(bc)
@warn "cuda is broken for this test, exiting."
Original file line number Diff line number Diff line change
@@ -8,8 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "linear combination of matrix products and LinearAlgebra.I" begin
bc =
@lazy_broadcast @. 2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,)
bc = @lazy @. 2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,)
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -9,8 +9,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "another linear combination of matrix products and \
LinearAlgebra.I" begin
bc = @lazy_broadcast @. ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat +
(4I,)
bc = @lazy @. ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat + (4I,)
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -8,9 +8,8 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "matrix times linear combination" begin
bc = @lazy_broadcast @. ᶜᶠmat (
2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,)
)
bc =
@lazy @. ᶜᶠmat (2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,))
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -8,9 +8,8 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "linear combination times another linear combination" begin
bc = @lazy_broadcast @. (
2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,)
) (ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat + (4I,))
bc = @lazy @. (2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,))
(ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat + (4I,))
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -9,9 +9,11 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "matrix times matrix times linear combination times matrix \
times another linear combination times matrix" begin
bc = @lazy_broadcast @. ᶠᶜmat ᶜᶠmat (
2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,)
) ᶠᶠmat (ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat + (4I,)) ᶠᶠmat
bc = @lazy @. ᶠᶜmat ᶜᶠmat
(2 * ᶠᶜmat ᶜᶜmat ᶜᶠmat + ᶠᶠmat ᶠᶠmat / 3 - (4I,))
ᶠᶠmat
(ᶠᶜmat ᶜᶜmat ᶜᶠmat * 2 - (ᶠᶠmat / 3) ᶠᶠmat + (4I,))
ᶠᶠmat
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "matrix constructions and multiplications" begin
bc = @lazy_broadcast @. BidiagonalMatrixRow(ᶜᶠmat ᶠvec, ᶜᶜmat ᶜvec)
TridiagonalMatrixRow(ᶠvec, ᶠᶜmat ᶜvec, 1) ᶠᶠmat
DiagonalMatrixRow(DiagonalMatrixRow(ᶠvec) ᶠvec)
bc = @lazy @. BidiagonalMatrixRow(ᶜᶠmat ᶠvec, ᶜᶜmat ᶜvec)
TridiagonalMatrixRow(ᶠvec, ᶠᶜmat ᶜvec, 1) ᶠᶠmat
DiagonalMatrixRow(DiagonalMatrixRow(ᶠvec) ᶠvec)
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat, ᶜvec, ᶠvec)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "tri-diagonal matrix times vector" begin
bc = @lazy_broadcast @. ᶠᶠmat ᶠvec
bc = @lazy @. ᶠᶠmat ᶠvec
result = materialize(bc)

input_fields = (ᶠᶠmat, ᶠvec)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "quad-diagonal matrix times vector" begin
bc = @lazy_broadcast @. ᶠᶜmat ᶜvec
bc = @lazy @. ᶠᶜmat ᶜvec
result = materialize(bc)

input_fields = (ᶠᶜmat, ᶜvec)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times bi-diagonal matrix" begin
bc = @lazy_broadcast @. ᶜᶜmat ᶜᶠmat
bc = @lazy @. ᶜᶜmat ᶜᶠmat
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "tri-diagonal matrix times tri-diagonal matrix" begin
bc = @lazy_broadcast @. ᶠᶠmat ᶠᶠmat
bc = @lazy @. ᶠᶠmat ᶠᶠmat
result = materialize(bc)

input_fields = (ᶠᶠmat,)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
#! format: on
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "quad-diagonal matrix times diagonal matrix" begin
bc = @lazy_broadcast @. ᶠᶜmat ᶜᶜmat
bc = @lazy @. ᶠᶜmat ᶜᶜmat
result = materialize(bc)

input_fields = (ᶠᶜmat, ᶜᶜmat)
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ include(joinpath(pkgdir(ClimaCore),"test","MatrixFields","matrix_fields_broadcas
test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times bi-diagonal matrix times \
tri-diagonal matrix times quad-diagonal matrix" begin
bc = @lazy_broadcast @. ᶜᶜmat ᶜᶠmat ᶠᶠmat ᶠᶜmat
bc = @lazy @. ᶜᶜmat ᶜᶠmat ᶠᶠmat ᶠᶜmat
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat)
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times bi-diagonal matrix times \
tri-diagonal matrix times quad-diagonal matrix, but with \
forced right-associativity" begin
bc = @lazy_broadcast @. ᶜᶜmat (ᶜᶠmat (ᶠᶠmat ᶠᶜmat))
bc = @lazy @. ᶜᶜmat (ᶜᶠmat (ᶠᶠmat ᶠᶜmat))
if using_cuda
@test_throws invalid_ir_error materialize(bc)
@warn "cuda is broken for this test, exiting."
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ test_opt = get(ENV, "BUILDKITE", "") == "true"
@testset "diagonal matrix times bi-diagonal matrix times \
tri-diagonal matrix times quad-diagonal matrix times \
vector" begin
bc = @lazy_broadcast @. ᶜᶜmat ᶜᶠmat ᶠᶠmat ᶠᶜmat ᶜvec
bc = @lazy @. ᶜᶜmat ᶜᶠmat ᶠᶠmat ᶠᶜmat ᶜvec
result = materialize(bc)

input_fields = (ᶜᶜmat, ᶜᶠmat, ᶠᶠmat, ᶠᶜmat, ᶜvec)
85 changes: 39 additions & 46 deletions test/MatrixFields/operator_matrices.jl
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ using Revise; include(joinpath("test", "MatrixFields", "operator_matrices.jl"))
import LinearAlgebra: I

import ClimaCore.RecursiveApply: rzero
import ClimaCore
import ClimaCore.Operators:
SetValue,
SetGradient,
@@ -40,17 +41,16 @@ import ClimaCore.Operators:

include("matrix_field_test_utils.jl")

apply_op_matrix(::Nothing, op_matrix, arg) =
@lazy_broadcast @. op_matrix() arg
apply_op_matrix(::Nothing, op_matrix, arg) = @lazy @. op_matrix() arg
apply_op_matrix(boundary_op, op_matrix, arg) =
@lazy_broadcast @. boundary_op(op_matrix() arg)
@lazy @. boundary_op(op_matrix() arg)
apply_op_matrix(::Nothing, op_matrix, arg1, arg2) =
@lazy_broadcast @. op_matrix(arg1) arg2
@lazy @. op_matrix(arg1) arg2
apply_op_matrix(boundary_op, op_matrix, arg1, arg2) =
@lazy_broadcast @. boundary_op(op_matrix(arg1) arg2)
@lazy @. boundary_op(op_matrix(arg1) arg2)

apply_op(::Nothing, op, args...) = @lazy_broadcast @. op(args...)
apply_op(boundary_op, op, args...) = @lazy_broadcast @. boundary_op(op(args...))
apply_op(::Nothing, op, args...) = @lazy @. op(args...)
apply_op(boundary_op, op, args...) = @lazy @. boundary_op(op(args...))

function test_op_matrix(
::Type{Op},
@@ -241,7 +241,7 @@ end
test_field_broadcast(;
test_name = "product of two lazy operator matrices",
get_result,
set_result = @lazy(@. result = ᶜlbias_matrix() ᶠinterp_matrix()),
set_result = @lazy(@. ᶜlbias_matrix() ᶠinterp_matrix()),
)
end

@@ -253,10 +253,9 @@ end
ᶠinterp_matrix()
),
set_result = @lazy(
@. result =
ᶜflux_correct_matrix(ᶠuvw) ᶜadvect_matrix(ᶠuvw)
ᶜwinterp_matrix(ᶠscalar) ᶠrbias_matrix() ᶜlbias_matrix()
ᶠinterp_matrix()
@. ᶜflux_correct_matrix(ᶠuvw) ᶜadvect_matrix(ᶠuvw)
ᶜwinterp_matrix(ᶠscalar) ᶠrbias_matrix() ᶜlbias_matrix()
ᶠinterp_matrix()
),
)

@@ -269,13 +268,12 @@ end
ᶠinterp_matrix() ᶜnested
),
set_result = @lazy(
@. result =
ᶜflux_correct_matrix(ᶠuvw) ᶜadvect_matrix(ᶠuvw)
ᶜwinterp_matrix(ᶠscalar) ᶠrbias_matrix() ᶜlbias_matrix()
ᶠinterp_matrix() ᶜnested
@. ᶜflux_correct_matrix(ᶠuvw) ᶜadvect_matrix(ᶠuvw)
ᶜwinterp_matrix(ᶠscalar) ᶠrbias_matrix() ᶜlbias_matrix()
ᶠinterp_matrix() ᶜnested
),
ref_set_result = @lazy(
@. result = ᶜflux_correct(
@. ᶜflux_correct(
ᶠuvw,
ᶜadvect(
ᶠuvw,
@@ -299,18 +297,17 @@ end
)
),
set_result = @lazy(
@. result =
ᶜflux_correct_matrix(ᶠuvw) (
ᶜadvect_matrix(ᶠuvw) (
ᶜwinterp_matrix(ᶠscalar) (
ᶠrbias_matrix()
(ᶜlbias_matrix() (ᶠinterp_matrix() ᶜnested))
)
@. ᶜflux_correct_matrix(ᶠuvw) (
ᶜadvect_matrix(ᶠuvw) (
ᶜwinterp_matrix(ᶠscalar) (
ᶠrbias_matrix()
(ᶜlbias_matrix() (ᶠinterp_matrix() ᶜnested))
)
)
)
),
ref_set_result = @lazy(
@. result = ᶜflux_correct(
@. ᶜflux_correct(
ᶠuvw,
ᶜadvect(
ᶠuvw,
@@ -358,16 +355,14 @@ end
)
),
set_result = @lazy(
@. result =
ᶠupwind_matrix(ᶠuvw) (
ᶜdiv_matrix() DiagonalMatrixRow(ᶠscalar)
ᶠgrad_matrix() (
(c12_b',) * ᶜwinterp_matrix(ᶠscalar) ᶠcurl_matrix() *
(c12_a,) +
(DiagonalMatrixRow(ᶜdiv(ᶠuvw)) - ᶜadvect_matrix(ᶠuvw)) /
5
) - (2I,)
)
@. ᶠupwind_matrix(ᶠuvw) (
ᶜdiv_matrix() DiagonalMatrixRow(ᶠscalar) ᶠgrad_matrix()
(
(c12_b',) * ᶜwinterp_matrix(ᶠscalar) ᶠcurl_matrix() *
(c12_a,) +
(DiagonalMatrixRow(ᶜdiv(ᶠuvw)) - ᶜadvect_matrix(ᶠuvw)) / 5
) - (2I,)
)
),
)

@@ -390,18 +385,16 @@ end
) ᶜscalar
),
set_result = @lazy(
@. result =
ᶠupwind_matrix(ᶠuvw) (
ᶜdiv_matrix() DiagonalMatrixRow(ᶠscalar)
ᶠgrad_matrix() (
(c12_b',) * ᶜwinterp_matrix(ᶠscalar) ᶠcurl_matrix() *
(c12_a,) +
(DiagonalMatrixRow(ᶜdiv(ᶠuvw)) - ᶜadvect_matrix(ᶠuvw)) /
5
) - (2I,)
) ᶜscalar
@. ᶠupwind_matrix(ᶠuvw) (
ᶜdiv_matrix() DiagonalMatrixRow(ᶠscalar) ᶠgrad_matrix()
(
(c12_b',) * ᶜwinterp_matrix(ᶠscalar) ᶠcurl_matrix() *
(c12_a,) +
(DiagonalMatrixRow(ᶜdiv(ᶠuvw)) - ᶜadvect_matrix(ᶠuvw)) / 5
) - (2I,)
) ᶜscalar
),
# ref_set_result = @lazy(@. result = ᶠupwind(
# ref_set_result = @lazy(@. ᶠupwind(
# ᶠuvw,
# ᶜdiv(
# ᶠscalar * ᶠgrad(

0 comments on commit 5151b57

Please sign in to comment.