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

upgrade the halo exchange procedure for the function space 'PointCloud' #120

Merged
merged 16 commits into from
May 4, 2023

Conversation

mo-lormi
Copy link
Contributor

@mo-lormi mo-lormi commented Mar 28, 2023

Description


This PR is intended to upgrade the procedure for the halo exchange for the function space PointCloud, in particular to:

  • implement a new procedure to evaluate the fields partition and remote_index to be used for the halo exchange
  • add new tests to the test battery


Acceptance Criteria (Definition of Done)

All the tests pass.


@FussyDuck
Copy link

FussyDuck commented Mar 28, 2023

CLA assistant check
All committers have signed the CLA.

@mo-lormi
Copy link
Contributor Author

mo-lormi commented Mar 29, 2023

notes

  • The procedure is valid under the assumption that the spatial locations (Lat/Lon) are unique in a given 2D domain. In particular, the procedure relies on the fact that the locations of the 'own points' are unique within each partition.

  • The procedure can process data associated with heterogeneous partitions, i.e. partitions containing a different number of spatial locations.


@odlomax
Copy link
Contributor

odlomax commented Apr 3, 2023

Closes #121

@mo-lormi mo-lormi marked this pull request as ready for review April 6, 2023 09:03
@wdeconinck wdeconinck self-assigned this Apr 6, 2023
@wdeconinck
Copy link
Member

Please @mo-lormi sign the CLA when you can.

@MarekWlasak
Copy link
Contributor

If we ever get to use this for observation we will have cases where the longitude and latitude points are non unique. (We can have multiple observations at the same longitude/latitude) . It might be worth having a chat about this at the Atlas code sprint that is happening next week).

array::make_view<idx_t, 1>(remote_index_).data(),
REMOTE_IDX_BASE,
ghost_.size());
ghost_(flds["ghost"]), remote_index_(flds["remote_index"]), partition_(flds["partition"]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally would have kept the old functionality for this constructor to allow for special cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MarekWlasak please note that the constructor PointCloud(const FieldSet & flds) that uses four fields for the intialization has not been modified -- see lines 422-429.
The introduction of the function setupHaloExchange() and the check here allow to avoid redundant code by sharing the procedure to set up the halo exchange across constructors with different signature.

@mo-lormi
Copy link
Contributor Author

Please @mo-lormi sign the CLA when you can.

... done

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 99.51% and project coverage change: -0.55 ⚠️

Comparison is base (eaab18a) 77.54% compared to head (13a3227) 76.99%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #120      +/-   ##
===========================================
- Coverage    77.54%   76.99%   -0.55%     
===========================================
  Files          806      801       -5     
  Lines        57679    50544    -7135     
===========================================
- Hits         44725    38916    -5809     
+ Misses       12954    11628    -1326     
Impacted Files Coverage Δ
src/atlas/util/PolygonLocator.h 68.25% <ø> (-3.37%) ⬇️
src/tests/functionspace/test_pointcloud.cc 100.00% <ø> (ø)
src/atlas/functionspace/PointCloud.cc 83.65% <98.63%> (+5.34%) ⬆️
src/atlas/functionspace/PointCloud.h 87.50% <100.00%> (-5.61%) ⬇️
.../functionspace/test_pointcloud_haloexchange_2PE.cc 100.00% <100.00%> (ø)
.../functionspace/test_pointcloud_haloexchange_3PE.cc 100.00% <100.00%> (ø)

... and 567 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Hi @mo-lormi , Very good improvement! Just a few cosmetic changes requested.

PointCloud(const FieldSet&); // assuming lonlat ghost ridx and partition present.

PointCloud(const Field&);
PointCloud(const Field&, const Field&);
Copy link
Member

Choose a reason for hiding this comment

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

It is good to keep the arguments named in above 2 lines to indicate what is expected without going into the ".cc" file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... done

*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation
* nor does it submit to any jurisdiction.
Copy link
Member

Choose a reason for hiding this comment

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

This comment cannot be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... done

*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation
* nor does it submit to any jurisdiction.
Copy link
Member

Choose a reason for hiding this comment

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

this comment cannot be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... done


const eckit::mpi::Comm& comm = atlas::mpi::comm();
std::size_t mpi_rank = comm.rank();
const std::size_t no_mpi_ranks = comm.size();
Copy link
Member

Choose a reason for hiding this comment

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

Cosmetic change: Please use "mpi_size" as name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, these lines were not used. I removed them.

void PointCloud::setupHaloExchange(){
const eckit::mpi::Comm& comm = atlas::mpi::comm();
std::size_t mpi_rank = comm.rank();
const std::size_t no_mpi_ranks = comm.size();
Copy link
Member

Choose a reason for hiding this comment

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

Cosmetic change: please use mpi_size as variable name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... done

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.

Thanks @mo-lormi all good now, ready to merge.

@mo-lormi
Copy link
Contributor Author

mo-lormi commented May 3, 2023

Thanks @mo-lormi all good now, ready to merge.

Thanks ...

@wdeconinck wdeconinck merged commit 565c84d into ecmwf:develop May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants