Skip to content

Commit

Permalink
Add support for ClimaComms < 0.6 in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Jun 28, 2024
1 parent c3b259c commit db92f6e
Show file tree
Hide file tree
Showing 87 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion examples/bickleyjet/bickleyjet_cg_invariant_hypervisc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ClimaCore:
using OrdinaryDiffEq: ODEProblem, solve, SSPRK33

using Logging
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
const context = ClimaComms.context()
usempi = context isa ClimaComms.MPICommsContext
if usempi
Expand Down
2 changes: 1 addition & 1 deletion examples/column/advect.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
Fields,
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/advect_diffusion.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
Fields,
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/bb_fct_advection.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Test
using LinearAlgebra
using OrdinaryDiffEq: ODEProblem, solve
Expand Down
2 changes: 1 addition & 1 deletion examples/column/ekman.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra
import ClimaCore:
Fields,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/fct_advection.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Test
using LinearAlgebra
using OrdinaryDiffEq: ODEProblem, solve, SSPRK33
Expand Down
2 changes: 1 addition & 1 deletion examples/column/heat.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
Fields,
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/hydrostatic.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
Fields,
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/hydrostatic_discrete.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
Fields,
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/hydrostatic_ekman.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra

import ClimaCore:
Expand Down
2 changes: 1 addition & 1 deletion examples/column/step.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra
import ClimaCore:
Fields,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/wave.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore.Geometry, LinearAlgebra
import ClimaCore:
Fields,
Expand Down
2 changes: 1 addition & 1 deletion examples/column/zalesak_fct_advection.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Test
using LinearAlgebra
using OrdinaryDiffEq: ODEProblem, solve
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/box/bubble_3d_invariant_rhoe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Test
using Adapt
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
FloatType = eval(Meta.parse(get(ARGS, 1, "Float64")))
using StaticArrays, IntervalSets, LinearAlgebra, OrdinaryDiffEq
using DocStringExtensions
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/box/bubble_3d_invariant_rhotheta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using ClimaComms
using LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/box/bubble_3d_rhotheta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using ClimaComms
using LinearAlgebra, StaticArrays

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/box/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARGS = ["cosine_bells"];
using Revise; include(joinpath("examples", "hybrid", "box", "limiters_advection.jl"))
=#
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra
using SciMLBase

Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ postprocessing(sol, output_dir) = nothing

import ClimaTimeSteppers as CTS
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import SciMLBase
const comms_ctx = ClimaComms.context()
is_distributed = comms_ctx isa ClimaComms.MPICommsContext
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/hybrid3dcs_dss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using JLD2
include("../nvtx.jl")

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
Domains,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/bubble_2d_invariant_rhoe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Test
using StaticArrays, IntervalSets, LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/density_current_2d_flux_form.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using LinearAlgebra, StaticArrays

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/density_current_2dinvariant_rhoe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Test
using StaticArrays, IntervalSets, LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/inertial_gravity_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Printf
using ProgressLogging
using ClimaCorePlots, Plots
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

# Reference paper: https://rmets.onlinelibrary.wiley.com/doi/pdf/10.1002/qj.2105

Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/isothermal_channel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using StaticArrays, IntervalSets, LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/topo_agnesi_nh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using StaticArrays, IntervalSets, LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import ClimaCore:
ClimaCore,
slab,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/topo_schar_nh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using StaticArrays, IntervalSets, LinearAlgebra

import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

import ClimaCore:
ClimaCore,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/baroclinic_wave_utilities.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

# Constants required by "staggered_nonhydrostatic_model.jl"
# const FT = ? # specified in each test file
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/deformation_flow.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using OrdinaryDiffEq
using Test
using Statistics: mean
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/hadley_circulation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Test
using LinearAlgebra

Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/nonhydrostatic_gravity_wave.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Test
using LinearAlgebra

Expand Down
2 changes: 1 addition & 1 deletion examples/sphere/shallow_water.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra
using Colors
using DocStringExtensions
Expand Down
2 changes: 1 addition & 1 deletion lib/ClimaCoreTempestRemap/test/netcdf.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ClimaCore
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using ClimaCore:
Geometry,
Meshes,
Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Revise; include(joinpath("test", "DataLayouts", "cuda.jl"))
using Test
using ClimaComms
using CUDA
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using ClimaCore.DataLayouts

function knl_copy!(dst, src)
Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/opt_similar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using ClimaCore.DataLayouts
using ClimaCore: DataLayouts, Geometry
import ClimaComms
using StaticArrays: SMatrix
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using JET

function test_similar!(data)
Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/unit_copyto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using ClimaCore.DataLayouts
import ClimaCore.Geometry
import ClimaComms
using StaticArrays
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
import Random
Random.seed!(1234)

Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/unit_fill.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Revise; include(joinpath("test", "DataLayouts", "unit_fill.jl"))
using Test
using ClimaCore.DataLayouts
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

function test_fill!(data, vals::Tuple{<:Any, <:Any})
fill!(data, vals)
Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/unit_mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using ClimaCore.DataLayouts
using ClimaCore
import ClimaComms
import Random
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

device = ClimaComms.device()
context = ClimaComms.context(device)
Expand Down
2 changes: 1 addition & 1 deletion test/DataLayouts/unit_ndims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Revise; include(joinpath("test", "DataLayouts", "unit_ndims.jl"))
using Test
using ClimaCore.DataLayouts
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

@testset "Base.ndims" begin
device = ClimaComms.device()
Expand Down
2 changes: 1 addition & 1 deletion test/Fields/convergence_field_integrals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Test
using JET

using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using OrderedCollections
using StaticArrays, IntervalSets
import ClimaCore
Expand Down
2 changes: 1 addition & 1 deletion test/Fields/reduction_cuda.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Statistics
using LinearAlgebra

Expand Down
2 changes: 1 addition & 1 deletion test/Fields/reduction_cuda_distributed.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using Statistics
using LinearAlgebra
using Logging
Expand Down
2 changes: 1 addition & 1 deletion test/Fields/unit_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Test
using JET

using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using OrderedCollections
using StaticArrays, IntervalSets
import ClimaCore
Expand Down
2 changes: 1 addition & 1 deletion test/Fields/utils_field_multi_broadcast_fusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using JET
using BenchmarkTools

using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using OrderedCollections
using StaticArrays, IntervalSets
import ClimaCore
Expand Down
2 changes: 1 addition & 1 deletion test/InputOutput/hybrid3dcubedsphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using ClimaCore:
InputOutput

using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
const comms_ctx = ClimaComms.context(ClimaComms.CPUSingleThreaded())
pid, nprocs = ClimaComms.init(comms_ctx)
filename = ClimaComms.bcast(comms_ctx, tempname(pwd()))
Expand Down
2 changes: 1 addition & 1 deletion test/InputOutput/spectralelement2d.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using LinearAlgebra
import ClimaCore
import ClimaCore:
Expand Down
2 changes: 1 addition & 1 deletion test/Limiters/distributed/dlimiter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using ClimaCore: slab
using Test

using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
const context = ClimaComms.MPICommsContext()
ClimaComms.init(context)

Expand Down
2 changes: 1 addition & 1 deletion test/Limiters/limiter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ julia --project=test
using Revise; include(joinpath("test", "Limiters", "limiter.jl"))
=#
using ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends
using ClimaCore:
DataLayouts,
Fields,
Expand Down
2 changes: 1 addition & 1 deletion test/MatrixFields/field2arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using JET

import ClimaCore: Geometry, Domains, Meshes, Spaces, Fields, MatrixFields
import ClimaComms
ClimaComms.@import_required_backends
@static pkgversion(ClimaComms) >= v"0.6" && ClimaComms.@import_required_backends

@testset "field2arrays Unit Tests" begin
FT = Float64
Expand Down
Loading

0 comments on commit db92f6e

Please sign in to comment.