-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Picking up a simulation fails with VerticallyStretchedGrid
s
#2018
Comments
Apparently "identical" julia> grid1 = VerticallyStretchedRectilinearGrid(size=(2, 2, 2),
x=(0, 1), y=(0, 1), z_faces=k -> k,
halo=(3,3,3),
)
VerticallyStretchedRectilinearGrid{Float64, Periodic, Periodic, Bounded}
domain: x ∈ [0.0, 1.0], y ∈ [0.0, 1.0], z ∈ [1.0, 3.0]
topology: (Periodic, Periodic, Bounded)
size (Nx, Ny, Nz): (2, 2, 2)
halo (Hx, Hy, Hz): (3, 3, 3)
grid spacing (Δx, Δy, Δz): (0.5, 0.5, [min=1.0, max=1.0])
julia> grid2 = VerticallyStretchedRectilinearGrid(size=(2, 2, 2),
x=(0, 1), y=(0, 1), z_faces=k -> k,
halo=(3,3,3),
)
VerticallyStretchedRectilinearGrid{Float64, Periodic, Periodic, Bounded}
domain: x ∈ [0.0, 1.0], y ∈ [0.0, 1.0], z ∈ [1.0, 3.0]
topology: (Periodic, Periodic, Bounded)
size (Nx, Ny, Nz): (2, 2, 2)
halo (Hx, Hy, Hz): (3, 3, 3)
grid spacing (Δx, Δy, Δz): (0.5, 0.5, [min=1.0, max=1.0])
julia> grid1 == grid2
false I don't know why this happens. In fact even using julia> grid1 = VerticallyStretchedRectilinearGrid(size=(2, 2, 2),
x=(0, 1), y=(0, 1), z_faces=k -> k,
halo=(3,3,3),
)
VerticallyStretchedRectilinearGrid{Float64, Periodic, Periodic, Bounded}
domain: x ∈ [0.0, 1.0], y ∈ [0.0, 1.0], z ∈ [1.0, 3.0]
topology: (Periodic, Periodic, Bounded)
size (Nx, Ny, Nz): (2, 2, 2)
halo (Hx, Hy, Hz): (3, 3, 3)
grid spacing (Δx, Δy, Δz): (0.5, 0.5, [min=1.0, max=1.0])
julia> grid2 = deepcopy(grid1)
VerticallyStretchedRectilinearGrid{Float64, Periodic, Periodic, Bounded}
domain: x ∈ [0.0, 1.0], y ∈ [0.0, 1.0], z ∈ [1.0, 3.0]
topology: (Periodic, Periodic, Bounded)
size (Nx, Ny, Nz): (2, 2, 2)
halo (Hx, Hy, Hz): (3, 3, 3)
grid spacing (Δx, Δy, Δz): (0.5, 0.5, [min=1.0, max=1.0])
julia> grid1 == grid2
false
|
This apparently has to do with the fact that julia> grid1.zᵃᵃᶜ === grid2.zᵃᵃᶜ
false
julia> grid1.zᵃᵃᶠ === grid2.zᵃᵃᶠ
false
I don't think this is a due to the grid design as this appears to be standard Julia behavior for arrays: julia> zeros(3) == zeros(3)
true
julia> zeros(3) === zeros(3)
false
which seems pretty counter-intuitive to me and apparently there's some discussion about this behavior in julia already: JuliaLang/julia#4648 |
|
I think there are probably a few other things to fix here, because we can't "restore" a grid with a GPU architecture. Fixing this fully really requires finishing #1998 first, and overhauling the checkpointing infrastructure to match so that the checkpointer is "architecture aware". We should also add tests for checkpointing with other grid types. |
Oh yeah I know about |
That's because |
No idea! Like I said, it's not very intuitive behavior to me. You probably understand this way better. |
Base has or just So unless there's a special definition for
So basically for any type at all, we'll get Also based on the above I think strictly speaking a vertically-stretched and rectilinear grid should be identical if the vertically stretched grid is regularly spaced. This would be a pain to implement though --- its really a problem with our grids. We should only have one |
I'm finding that simulations with
VerticallyStretchedGrid
s don't get picked up and instead throw an error saying that the grid doesn't match. Here's a MWE:This fails with:
The same code works if
grid
is regular rectilinear.Not very familiar with jld2, but I'm guessing this has to do with the fact that
VerticallyStretchedGrid
has an array associated with it that has to be serialized?The text was updated successfully, but these errors were encountered: