Skip to content

Commit

Permalink
Allow reading walltime variables
Browse files Browse the repository at this point in the history
- The variables are slightly different in each processor
- This causes issues with xarray concatenation.
- Read proc 0 variables and discard the rest
- (Wtime stats should be the nearly the same for all procs)
- Also saves other variables which are part of
_BOUT_PER_PROC_VARIABLES
  • Loading branch information
mikekryjak committed May 23, 2023
1 parent 27bfab6 commit f19dc73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xbout/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,11 @@ def _trim(ds, *, guards, keep_boundaries, nxpe, nype, is_restart):
):
trimmed_ds = trimmed_ds.drop_vars(name)

to_drop = _BOUT_PER_PROC_VARIABLES
if ds["MYPE"] == 0:
# Keep per-process variables from the root process
to_drop = None
else:
to_drop = _BOUT_PER_PROC_VARIABLES

return trimmed_ds.drop_vars(to_drop, errors="ignore")

Expand Down

0 comments on commit f19dc73

Please sign in to comment.