Skip to content
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

Global interpolation matrix --> MPI-distributed interpolation matrices #258

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

sbrdar
Copy link
Collaborator

@sbrdar sbrdar commented Feb 13, 2025

  1. add method 'distribute_global_matrix (src_fs, tgt_fs, global_matrix, mpi_root)' to return local interpolation matrices
  2. make sure that interpolation method in Atlas which take cache matrix as an argument actually use that cache
  3. extend test_interpolation_global_matrix to: 1) create a global matrix from a parallel interpolator (was there before); 2) distribute the global matrix to task-local matrices (new); 3) compare the remapped field gathered in a global field on the single task with the global-matrix remapped global field.
  4. extend sandbox/atlas-global-matrix to be able to read from the disc and distribute matrix to the parallel interpolator

@sbrdar sbrdar requested a review from wdeconinck February 13, 2025 17:34
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 78.22581% with 81 lines in your changes missing coverage. Please review.

Project coverage is 80.39%. Comparing base (e351a31) to head (3b571d9).
Report is 54 commits behind head on develop.

Files with missing lines Patch % Lines
...tured/ConservativeSphericalPolygonInterpolation.cc 45.71% 19 Missing ⚠️
...on/method/structured/StructuredInterpolation3D.tcc 0.00% 13 Missing ⚠️
...rc/atlas/interpolation/method/knn/GridBoxMethod.cc 0.00% 11 Missing ⚠️
src/atlas/linalg/sparse/SparseMatrixStorage.cc 69.23% 8 Missing ⚠️
.../interpolation/test_interpolation_global_matrix.cc 94.44% 6 Missing ⚠️
...atlas/interpolation/method/knn/NearestNeighbour.cc 60.00% 4 Missing ⚠️
...on/method/structured/StructuredInterpolation2D.tcc 69.23% 4 Missing ⚠️
...interpolation/method/unstructured/FiniteElement.cc 66.66% 4 Missing ⚠️
.../method/unstructured/UnstructuredBilinearLonLat.cc 69.23% 4 Missing ⚠️
src/atlas/interpolation/method/binning/Binning.cc 0.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #258      +/-   ##
===========================================
+ Coverage    79.82%   80.39%   +0.57%     
===========================================
  Files          815      850      +35     
  Lines        64522    68917    +4395     
===========================================
+ Hits         51502    55404    +3902     
- Misses       13020    13513     +493     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sbrdar and others added 23 commits February 18, 2025 11:26
…dle with creation of FunctionSpace from the conservative-spherical-polygon interpolator (not done)
…re that the interpolation setup from cache does use that cache (with Willem D.)
…sts for interpolations which do not accept a cached matrix
@wdeconinck wdeconinck force-pushed the feature/serialized-sparsematrix branch from 1b786cd to efc5b6c Compare February 18, 2025 10:26
@wdeconinck
Copy link
Member

wdeconinck commented Feb 18, 2025

Thanks @sbrdar , I have rebased this on latest develop, which now contains a much tougher ci that no longer permits warnings. Please fix the warnings before I review.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

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

Very nice work!
I have a few suggestions, see below.

setMatrix(cache);
source_ = source;
target_ = target;
buildPointSearchTree(source);
Copy link
Member

Choose a reason for hiding this comment

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

Building the PointSearchTree should not be needed when the cache contains a matrix.

On the other hand when there's no matrix in the cache this sets up nothing. That needs fixing.

if(interpolation::MatrixCache(cache)) { ... } 
else { 
  THIS SITUATION
}

do_setup(source, target);
return;
}
ATLAS_NOTIMPLEMENTED;
Copy link
Member

Choose a reason for hiding this comment

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

This needs also the handling of the "matrix_free" configuration option, meaning that when "matrix_free" is chosen we also need to ignore the matrix.

This if is not needed, and you can just call do_setup(source, target)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Now, if the method is not matrix free and there is a cache matrix, we initialise from the cache. In all other cases do_setup(source, target)

ATLAS_ASSERT(matrix().cols() == source.size());
return;
}
if (functionspace::NodeColumns(source) && functionspace::PointCloud(target)) {
Copy link
Member

Choose a reason for hiding this comment

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

This if is not needed, and you can just call do_setup(source, target)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants