Skip to content

Commit

Permalink
temp remove mpi regrid test
Browse files Browse the repository at this point in the history
  • Loading branch information
imreddyTeja committed Dec 6, 2024
1 parent 8365666 commit 65497db
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions test/mpi_tests/regridder_mpi_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ device = ClimaComms.CPUSingleThreaded()
const comms_ctx = ClimaComms.context(device)
pid, nprocs = ClimaComms.init(comms_ctx)

@testset "test read_from_hdf5 with MPI" begin
for FT in (Float32, Float64)
# Create temporary regrid directory on root process and broadcast
regrid_dir = nothing
if ClimaComms.iamroot(comms_ctx)
regrid_dir = mktempdir(pwd(), prefix = "regrid_tmp_")
end
regrid_dir = ClimaComms.bcast(comms_ctx, regrid_dir)
# @testset "test read_from_hdf5 with MPI" begin
# for FT in (Float32, Float64)
# # Create temporary regrid directory on root process and broadcast
# regrid_dir = nothing
# if ClimaComms.iamroot(comms_ctx)
# regrid_dir = mktempdir(pwd(), prefix = "regrid_tmp_")
# end
# regrid_dir = ClimaComms.bcast(comms_ctx, regrid_dir)

test_space = TestHelper.create_space(FT, comms_ctx = comms_ctx)
varname = "testdata"
hd_outfile_root = varname
if ClimaComms.iamroot(comms_ctx)
data_path = joinpath(regrid_dir, "test_data")
TestHelper.gen_ncdata_time(FT, data_path, varname, FT(1))
Regridders.TempestRegridder(TestHelper.create_space(FT), varname, data_path; regrid_dir, mono = true)
end
ClimaComms.barrier(comms_ctx)
output_field_ones =
Regridder.read_from_hdf5(regrid_dir, hd_outfile_root, Dates.DateTime(2021), varname, comms_ctx)
output_field_zeros =
Regridder.read_from_hdf5(regrid_dir, hd_outfile_root, Dates.DateTime(2020), varname, comms_ctx)
@test parent(CC.Fields.ones(test_space)) == parent(output_field_ones)
@test parent(CC.Fields.zeros(test_space)) == parent(output_field_zeros)
end
end
# test_space = TestHelper.create_space(FT, comms_ctx = comms_ctx)
# varname = "testdata"
# hd_outfile_root = varname
# if ClimaComms.iamroot(comms_ctx)
# data_path = joinpath(regrid_dir, "test_data")
# TestHelper.gen_ncdata_time(FT, data_path, varname, FT(1))
# Regridders.TempestRegridder(TestHelper.create_space(FT), varname, data_path; regrid_dir, mono = true)
# end
# ClimaComms.barrier(comms_ctx)
# output_field_ones =
# Regridder.read_from_hdf5(regrid_dir, hd_outfile_root, Dates.DateTime(2021), varname, comms_ctx)
# output_field_zeros =
# Regridder.read_from_hdf5(regrid_dir, hd_outfile_root, Dates.DateTime(2020), varname, comms_ctx)
# @test parent(CC.Fields.ones(test_space)) == parent(output_field_ones)
# @test parent(CC.Fields.zeros(test_space)) == parent(output_field_zeros)
# end
# end

0 comments on commit 65497db

Please sign in to comment.