-
Notifications
You must be signed in to change notification settings - Fork 203
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
Remove global allowscalar
from testing suite attempt 2
#4039
base: main
Are you sure you want to change the base?
Conversation
I'm so much in favor! I did try to do it one other time long ago and gave up... :( I'll help out! |
…ceananigans.jl into ss/remove-allowscalar-from-tests
So the output writer was failing with allow scalar operations and I added a Is this bad idea? |
I think so, this would defeat the purpose of this PR because it would not allow to catch scalar indexing issues with fields |
OK. But we need to do something because fetch_output was hitting a wall |
What do we do with this: https://buildkite.com/clima/oceananigans/builds/20198#019476ab-1f43-478a-a915-a760bb94157e/31-1301 ? |
looks like a bug in copyto!(dst::Array{}, scr::Field{}) |
…ceananigans.jl into ss/remove-allowscalar-from-tests
The problem seems to arise when trying to write down a function fetch_output(field::AbstractField, model)
compute_at!(field, time(model))
return parent(field)
end that returns the same function convert_output(output::AbstractArray, writer)
if architecture(output) isa GPU
output_array = writer.array_type(undef, size(output)...)
copyto!(output_array, output)
else
output_array = convert(writer.array_type, output)
end
return output_array
end I have added a method that converts the function field to CPU before writing it down. |
Because it does not allow us to catch problems where kernels erroneously run on the CPU (for example #4036), see CliMA/ClimaOcean.jl#318 (comment)
Probably will require a bit of fiddling to add
allowscalar
granularly in testscloses #3039