Enable auto IO LAYOUT (via FMS parallel IO)#235
Conversation
mnlevy1981
left a comment
There was a problem hiding this comment.
I have two runs going -- one using cesm3_0_alpha06c out of the box, and one with updates to FMS, MOM_interface, and MOM6 to use the new I/O features; I'll make sure they are bit-for-bit and also look at performance changes in the 2/3° grid with MARBL tracers turned on before approving / requesting changes. I did have a couple of comments based on reading through the diffs in this PR
| $OCN_GRID in ["tx2_3v2", "tx0.25v1"]: .true. | ||
| else: .false. |
There was a problem hiding this comment.
Can we use the description field in this file? Or just add comments? I'm assuming you only want to set auto_merge_nc = .true. for grids with a reasonable default for TARGET_IO_PES, but it would be nice to have a comment either confirming that or explaining why these are the only two grids that use auto_merge_nc out of the box
| if max_feasible_p == 0: # first iteration | ||
| p_up = int(np.ceil(npes / glob_ocn_frac)) | ||
| else: | ||
| p_up = max_feasible_p |
There was a problem hiding this comment.
The comment about this being the first iteration makes me wonder why we don't just initialize max_feasible_p = int(np.ceil(npes / glob_ocn_frac)) and then we can always set p_up = max_feasible_p; but then I see
if max_feasible_p == 0:
print("^^^^^^^^^^^^^^^ first feasible layout ^^^^^^^^^^^^^^^")
max_feasible_p = pAnd I'm not sure if that's changing max_feasible_p from int(np.ceil(npes / glob_ocn_frac)) or not (maybe p = p_up could result in an extreme aspect ratio and then the first time in this block is when p = p_up - 1?)
I guess I have two points in this comment:
- The way this loop works isn't completely clear, and maybe I should spend a few minutes walking through the steps in detail
- At first glance, it seems like we could start with a non-zero
max_feasible_pand skip a couple of if blocks in this code.
There was a problem hiding this comment.
For a number of divisions p to be feasible, it must (1) have a reasonable aspect ratio and (2) eliminate enough land blocks. The first p that meets these criteria is max_feasible_p (which is usually far less than p_up). Additionally, there is now a third criterion, the existence of a compatible IO_LAYOUT, but this only becomes relevant after identifying max_feasible_p (which is identified at the end of the first iteration of the outer loop).
I'm not sure why we'd set max_feasible_p to the initial upper bound p_up = int(np.ceil(npes / glob_ocn_frac)). But p_up instead can indeed be initialized as int(np.ceil(npes / glob_ocn_frac)) and later updated to max_feasible_p when it's found (at the end of the first iteration of the outer for loop). However, I opted for an explicit if block in the beginning of the inner for loop to make it clear that it has a varying iteration bound.
mnlevy1981
left a comment
There was a problem hiding this comment.
Details of my testing in ESCOMP/FMS#5 (review)
|
Also, based on my testing I think we want to keep the current layout (so it would be nice to bring in #233 ) |
There is an issue I've identified. I'll try to get it fixed and merge this PR within this week. |
This is one of three PRs to enable automated parallel IO in MOM6 within CESM by making use of the existing parallel IO implementation that comes with FMS. These series of PRs (1) enable FMS parallel IO, (2) make sure the IO PE Layout is compatible with auto-land block elimination (i.e., masking), and (3) that partitioned files are automatically merged after a run is completed.
Changes:
MOM_input, set a default value forTARGET_IO_PESto enable FMS parallel IO fortx2_3v2andtx0.25v1.input.nml, turn on auto merging of partitioned netcdf files by setting the newly added parameterauto_merge_nc.testing: aux_mom.derecho
status: b4b, except for masking in static files due to changing compute layout.
Performance: varies depending on the resolution, pe count and IO layout, from no enhancement or degradation to more than 50% enhancement.
This PR should be evaulated in conjunction with:
NCAR/MOM6#342
ESCOMP/FMS#5