-
Notifications
You must be signed in to change notification settings - Fork 38
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
Update algorithm for core counts for MPAS partition files #563
Update algorithm for core counts for MPAS partition files #563
Conversation
I will test this tomorrow in conjunction with #561. |
80e01cb
to
3961f78
Compare
@mark-petersen, would you be up for reviewing this algorithm? I can point you to the partition files it produces:
(The second is still running so files aren't there quite yet). I want to put files in a subdirectory because there are ~400 of them for a given mesh. I'll describe the algorithm in words, pointing at the code. |
compass/ocean/tests/global_ocean/files_for_e3sm/graph_partition.py
Outdated
Show resolved
Hide resolved
factors = _prime_factors(candidate) | ||
twos = np.count_nonzero(factors == 2) | ||
fives = np.count_nonzero(factors == 5) | ||
gt_five = np.count_nonzero(factors > 5) | ||
big_factor = factors.max() | ||
if twos > 0 and fives <= twos and gt_five <= 1 and big_factor <= 7: | ||
cores.append(candidate) |
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.
The core counts are allowed in based on their prime factors. Most require:
- at least one power of 2
- powers of 10 but not of 5 (the number of 5 factors has to be less than or equal to the number of 2s)
- There can only be one prime factor bigger than 5
- That one big prime factor can't be bigger than 7 (I had allowed that to go up to 23 in a previous test, but I think that produces a bunch of useless partitions). I realize the current verison is kind of ridiculous but we might want to back off and allow powers of 11, 13, etc. in the future.
In addition(see below) there is a small list of other allowed sizes:
- small multiples of 3
- divisors of the ne30 mesh size at @amametjanov's request.
3961f78
to
5b0519a
Compare
@@ -1,7 +1,7 @@ | |||
import numpy as np | |||
|
|||
|
|||
def get_core_list(ncells, max_cells_per_core=6000, min_cells_per_core=100): | |||
def get_core_list(ncells, max_cells_per_core=30000, min_cells_per_core=2): |
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.
It seems like there are situations where folks really want to push the limits of how many or how few cells you can get away with. I'm including some partitions that accommodate these needs. We can back off, but it's at the risk that E3SM developers generate their own partitions (which is a little riskier with the new sea ice approach).
5b0519a
to
342c056
Compare
The old algorithm wasn't generating the breadth of parition sizes that the E3SM team needs. The updated algorithm seems likely to generate nearly all of the partition sizes that could conceivable be useful for a given mesh.
It takes too long even on the QU240 mesh to be feasible for PR testing anymore.
342c056
to
ecae3d9
Compare
Generating this file is too slow for large meshes and large numbers of processor counts.
c6ba983
to
1931c31
Compare
This merge points to new partition files for each of the following 4 MPAS-Ocean meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Ocean meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
TestingI have used this approach to create partition files for 6 commonly used meshes:
See: |
Can't build docs locally until I fix #567 |
@mark-petersen, this is ready for you to review when you can. |
593ad79
to
dca42b8
Compare
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.
@xylar, if you are happy with the partition files that this PR creates, I'm happy to approve it. The algorithm looks reasonable. The proof is in the list of files you created!
Thanks very much @mark-petersen! |
This merge points to new partition files for each of the following 4 MPAS-Ocean meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
This merge points to new partition files for each of the following 4 MPAS-Seaice meshes. Each mesh has about 400 files that are expected to support nearly any conceivable core count. Meshes with updated partitions: * EC30to60E2r2 * ECwISC30to60E2r1 * SOwISC12to60E2r4 * WC14to60E2r3 The partition files are better load-balanced, since each core owns cells in both polar and equatorial regions. They were created with the tools described in: http://mpas-dev.github.io/MPAS-Tools/stable/seaice/partition.html See MPAS-Dev/compass#563 for more details on how the core counts were determined.
The old algorithm wasn't generating the breadth of partition sizes that the E3SM team needs. The updated algorithm seems likely to generate nearly all of the partition sizes that could conceivably be useful for a given mesh.
Checklist
Testing
in this PR) any testing that was used to verify the changes