Skip to content

re-order elements and vertices#4234

Open
weiyuan-jiang wants to merge 16 commits intorelease/MAPL-v3from
feature/wjiang/task2_reorder
Open

re-order elements and vertices#4234
weiyuan-jiang wants to merge 16 commits intorelease/MAPL-v3from
feature/wjiang/task2_reorder

Conversation

@weiyuan-jiang
Copy link
Contributor

Types of change(s)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)
  • Refactor (no functional changes, no api changes)

Checklist

  • Tested this change with a run of GEOSgcm
  • Ran the Unit Tests (make tests)

Description

for discussion

Related Issue

@weiyuan-jiang weiyuan-jiang requested a review from a team as a code owner December 9, 2025 18:09
@weiyuan-jiang weiyuan-jiang added the 🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs label Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

This PR is being prevented from merging because you have added one of our blocking labels: 🚫 Contingent - DNA. You'll need to remove it before this PR can be merged.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

This PR is being prevented from merging because you have not added one of our required labels: 0 diff, 0 diff trivial, 😲 Non 0 Diff, 🔧 Github Actions. Please add one so that the PR can be merged.

1 similar comment
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

This PR is being prevented from merging because you have not added one of our required labels: 0 diff, 0 diff trivial, 😲 Non 0 Diff, 🔧 Github Actions. Please add one so that the PR can be merged.

@mathomp4
Copy link
Member

mathomp4 commented Dec 9, 2025

Huh. Lots of CI failures. ninja seems unhappy with:

ninja: build stopped: multiple rules generate mesh2/sf_direction.mod.

As for ifx, not sure. Seems like our spurious random failure.

Also from GNU:

Error copying Fortran module "mesh2/sf_direction.mod".  Tried "mesh2/SF_DIRECTION.mod" and "mesh2/sf_direction.mod".
make[2]: *** [mesh2/CMakeFiles/to_mesh2.x.dir/depend.make:7: mesh2/CMakeFiles/to_mesh2.x.dir/sf_direction.mod.stamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:9260: mesh2/CMakeFiles/to_mesh2.x.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 89%] Building Fortran object mesh2/CMakeFiles/xgrid.x.dir/Direction.F90.o
Error copying Fortran module "mesh2/sf_direction.mod".  Tried "mesh2/SF_DIRECTION.mod" and "mesh2/sf_direction.mod".
make[2]: *** [mesh2/CMakeFiles/xgrid2.x.dir/depend.make:7: mesh2/CMakeFiles/xgrid2.x.dir/sf_direction.mod.stamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:9356: mesh2/CMakeFiles/xgrid2.x.dir/all] Error 2

@weiyuan-jiang
Copy link
Contributor Author

There are a few make_esmf_mesh subroutines. My tests show only the one works. @tclune, We should clean those up

@tclune
Copy link
Collaborator

tclune commented Dec 16, 2025

There are a few make_esmf_mesh subroutines. My tests show only the one works. @tclune, We should clean those up

Please do. The extra copies were all just attempts to work around an unknown issue.

@weiyuan-jiang
Copy link
Contributor Author

Notes:
With the latest update, time mpirun -np 6 ./xgrid2.x
multi_connections: 49 s
ordered multi_connections: 38 s

tri_conn : 83 S
ordered tri_conn 75 s

quad_conn gets error when creating handler from xgrid to latlon grid:

pe=00002 FAIL at line=00085 xgrid2.F90 <status=513>

@mathomp4
Copy link
Member

Notes: With the latest update, time mpirun -np 6 ./xgrid2.x multi_connections: 49 s ordered multi_connections: 38 s

tri_conn : 83 S ordered tri_conn 75 s

quad_conn gets error when creating handler from xgrid to latlon grid:

pe=00002 FAIL at line=00085 xgrid2.F90 <status=513>

@weiyuan-jiang Just for my own benefit, are these good? Bad? That is, should "ordered tri_conn" be the best? quad_conn?

@weiyuan-jiang
Copy link
Contributor Author

Notes: With the latest update, time mpirun -np 6 ./xgrid2.x multi_connections: 49 s ordered multi_connections: 38 s
tri_conn : 83 S ordered tri_conn 75 s
quad_conn gets error when creating handler from xgrid to latlon grid:
pe=00002 FAIL at line=00085 xgrid2.F90 <status=513>

@weiyuan-jiang Just for my own benefit, are these good? Bad? That is, should "ordered tri_conn" be the best? quad_conn?

After Bob made the change, the tri and quad are not necessary any more. Every thing will be the original version except we order the elements and vertices.

@weiyuan-jiang
Copy link
Contributor Author

weiyuan-jiang commented Jan 23, 2026

For the record, here is the summary of xgrid.F90 print out ( mesh min resolution C1440, destination C720)

random (s) 96 pe Ordered (s) 96 pe ordered 216 pe ordered 864 pe
Creating xgrid (mesh, agrid) 6.3 4.7 2.15 0.59
Creating handle(Mesh 2 xgrid 6.0 2.1 1.4 1.14
Mesh 2 xgrid( regrid) 0.001 0.008 0.0006 0.0006
Creating handle(xgrid 2 agrid) 6.6 2.4 1.67 0.78
xgrid 2 mesh(regrid) 0.002 0.0009 0.0005 0.00016
Creating Handle(mesh 2 agrid) 7.3 3.67 1.97 1.4
Mesh 2 agrid(regrid) 0.002 0.0016 0.0007 0.002

@tclune
Copy link
Collaborator

tclune commented Jan 23, 2026

@weiyuan-jiang Please use triple back-ticks and spacing to make the table readable here.

@mathomp4
Copy link
Member

@weiyuan-jiang Please use triple back-ticks and spacing to make the table readable here.

I converted it into a Github Markdown Table. I forget those are available!

@weiyuan-jiang
Copy link
Contributor Author

@weiyuan-jiang Please use triple back-ticks and spacing to make the table readable here.

I converted it into a Github Markdown Table. I forget those are available!

That is nicer !

@weiyuan-jiang
Copy link
Contributor Author

weiyuan-jiang commented Jan 29, 2026

Test for mesh minresolution c2880, destination c1440)

96(r) 96 216 864 2400 5400
Creating xgrid (mesh, agrid) 31.3 22.5 10. 2.7 1.47 1.55
Creating handle(Mesh 2 xgrid) 34.4 10.7 7.7 7.0 7.1 12.9
Mesh 2 xgrid(regrid) 0.006 0.0037 0.0015 0.0008 0.003 0.0037
Creating handle(xgrid 2 agrid) 11.6 11.6 8.6 7.3 3.16 2.4
xgrid 2 agrid(regrid) 0.0037 0.0037 0.0018 0.0006 0.00037 0.00025
Creating Handle(mesh 2 agrid) 44.0 19.1 11.2 7.6 8.26 15.4
Mesh 2 agrid(regrid) 0.004 0.0024 0.0014 0.002 0.0021 0.0027

This commit implements MPI-parallel domain decomposition for LocStream
geometry types in MAPL, enabling efficient distributed processing of
location-based data (e.g., station observations, satellite swaths).

Key changes:

- Added LocStreamDecomposition class to manage 1D point distribution
  across MPI processes using mapl_GetPartition for even load balancing

- Integrated decomposition into LocStreamGeomSpec to store decomposition
  metadata alongside geometry specifications

- Updated LocStreamGeomFactory to apply decompositions when creating
  distributed LocStreams, extracting local coordinate subsets (i_0:i_1)
  based on each PE's assigned point range

- Comprehensive test suite with 6 tests covering:
  * Decomposition constructors and equality
  * Local index calculation across multiple PE counts
  * Actual LocStream creation with proper distribution on 1, 2, and 4 PETs
  * Verification of coordinate value cor  * Verification of coordinate value cor  * Verification of coordinate value cor  * Verificosi  * Verification of coordinate value cor  * Verification of coordinaubsystem.

Tested with NAG 7.2.41 compiler - all tests passing.
tclune
tclune previously approved these changes Feb 17, 2026
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we will ned to find a proper home and really clean this up.

@weiyuan-jiang weiyuan-jiang changed the base branch from feature/mesh-take-2 to release/MAPL-v3 March 3, 2026 17:23
@weiyuan-jiang weiyuan-jiang dismissed tclune’s stale review March 3, 2026 17:23

The base branch was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants