-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Serialbox to Netcdf tool] Collapse all rank into 1 if rank have different sized data #82
[Serialbox to Netcdf tool] Collapse all rank into 1 if rank have different sized data #82
Conversation
…ollapse Clean up type infer and log work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
dataset = xr.Dataset(data_vars=data_vars) | ||
dataset.to_netcdf( | ||
os.path.join(output_path, f"{savepoint_name}.nc"), encoding=encoding | ||
) | ||
|
||
|
||
def get_data_collapse_all_ranks(total_ranks, n_savepoints, output_list, varname): | ||
if total_ranks <= 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<= 0
? Can we have negative total_ranks??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not but I did a bot of "defensive coding" here. If we pass -1 for any reason we don't crash
Description
We are developing a new capacity of serialbox to append scalars to a one dimension array. This can be used to save data within iterative solver. This means that the number of data point save can vary by rank, so we have developed a solution to collapse all ranks into one to fit with the Translate test system. E.g.:
How Has This Been Tested?
Locally
Checklist: