-
Notifications
You must be signed in to change notification settings - Fork 238
Output extraction via Dict
generator in JLD2OutputWriter
fails when outputting fields directly
#562
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
Comments
This is not an issue with We have never tried to output fields directly --- instead, we output I am surprised that this fails though. I would have though it possible to output fields. Perhaps there is something we can fix there. Again, though, this is not an issue with using |
By the way, there is an abstraction called using Oceananigans, Oceananigans.OutputWriters
grid = RegularCartesianGrid(size=(16, 16, 16), length=(1, 1, 1))
model = Model(grid=grid)
outputs = FieldOutputs((u=model.velocities.u, T=model.tracers.T))
model.output_writers[:jld2] = JLD2OutputWriter(model, outputs; frequency=1, prefix="test", verbose=true)
time_step!(model; Δt=1, Nt=1) The |
It's confusing why this fails, but the offending line is here: I don't understand why The stack trace is obscure because, I think, the error appears inside the generator in the line I've posted, and also because the function that's being called is anonymous. I think. We could try rewriting the offending line to create an empty |
If the docs actually recommend outputting fields themselves, we should obviously change that. We can perhaps add a note about why we cannot output fields (once we figure it out) --- or fix it so that we can output fields. I actually think it could be useful to output fields when we have a more powerful field abstraction system in the future, especially if it can do MPI operations, etc, which are useful in post processing. It'd be convenient to be able to load fields directly to memory rather than having to reconstruct them from their data and some grid. |
Is this still an issue? As discussed above, the problem is that we cannot save fields directly. We can only save arrays. The code pasted in this issue attempts to output the fields directly, rather than outputting their underlying data (which, it should be noted, also requires transferring the data from GPU to CPU). Also, this issue is not related to the use of |
Ah sorry yes it was a misuse of the I still think we should make the interfaces to |
Well. Reading the error message very closely, it looks like the failure occurs when the generator --- for some reason --- attempt to assign an Oceananigans Field at I'm not sure this is super important because we can never output fields directly on the GPU anyways. As stated above, however, it would be nice to fix this issue so that we can output fields directly for other purposes. I've changed the title to accurately reflect the error / bug. If this is investigated earlier it may be worthwhile raising this issue on the julia github. Something funny is happening here. |
How is this issue related to dissimilarities between the |
JLD2OutputWriter
to work with named tuples.Dict
generator in JLD2OutputWriter
fails when outputting fields directly
Ah I was trying to use the I agree it may not make sense to pass fields directly as this won't work on the GPU. Perhaps |
I'm following the documentation so either we have a bug or the documentation needs to be clearer on how to use
JLD2OutputWriter
with named tuples.produces
The text was updated successfully, but these errors were encountered: