Skip to content

JLD2Writer does not create per-rank files when filename contains .jld2 extensionΒ #5263

@ruoyan88

Description

@ruoyan88

Behavior

  • βœ… Works: filename = "output" β†’ creates output_rank0.jld2, output_rank1.jld2, etc.
  • ❌ Fails: filename = "output.jld2" β†’ hangs (all ranks attempt to write to same file)

Reproducer

using MPI, Oceananigans
MPI.Init()

arch = Distributed(GPU(); partition = Partition(2, 2))
grid = RectilinearGrid(arch, size=(64, 64, 16), extent=(1, 1, 1))
model = NonhydrostaticModel(; grid)
simulation = Simulation(model, Ξ”t=10, stop_iteration=100)

# This hangs:
simulation.output_writers[:out] = JLD2Writer(model, model.tracers,
    filename = "output.jld2",
    schedule = IterationInterval(10))

run!(simulation)

Test Results

Tested with filename = "output" (without extension):

  • Grid: 1440Γ—720Γ—30 (0.25Β° Arctic Ocean)
  • GPUs: 4Γ— RTX 4090
  • Partition: Partition(2, 2)
  • Output interval: 6 hours

Results:

  • βœ… All 4 ranks completed successfully
  • βœ… Created output_rank0.jld2 through output_rank3.jld2
  • βœ… Good I/O performance (~10ms write time after initialization)

Originally reported in ClimaOcean.jl: CliMA/ClimaOcean.jl#746
Credit to @glwagner for diagnosing the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions