Skip to content
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

Fix length of t dimension for timing variables #295

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions moment_kinetics/src/file_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2735,7 +2735,10 @@ function write_timing_data(io_moments, t_idx, dfns=false)
# If we got the length of `time:$this_name`, the variable might have
# the wrong length (e.g. if it has only just been created and has
# length 1).
t_idx = length(io_group["time:" * first(keys(timer_names_all_ranks))])
length_check_var = io_group["time:" * first(keys(timer_names_all_ranks))]
this_t_idx = size(length_check_var, ndims(length_check_var))
else
this_t_idx = t_idx
end
if parallel_io
timer_coord = (local_io_range=1:block_size[],
Expand All @@ -2748,12 +2751,12 @@ function write_timing_data(io_moments, t_idx, dfns=false)
io_time = io_group["time:" * this_name]
io_ncalls = io_group["ncalls:" * this_name]
io_allocs = io_group["allocs:" * this_name]
@views append_to_dynamic_var(io_time, gathered_times_data[counter,:], t_idx,
parallel_io, timer_coord)
@views append_to_dynamic_var(io_time, gathered_times_data[counter,:],
this_t_idx, parallel_io, timer_coord)
@views append_to_dynamic_var(io_ncalls, gathered_ncalls_data[counter,:],
t_idx, parallel_io, timer_coord)
this_t_idx, parallel_io, timer_coord)
@views append_to_dynamic_var(io_allocs, gathered_allocs_data[counter,:],
t_idx, parallel_io, timer_coord)
this_t_idx, parallel_io, timer_coord)
counter += 1
for (sub_name, sub_dict) ∈ pairs(names_dict)
write_level(sub_dict, this_name * ";" * sub_name)
Expand Down