Skip to content

Commit

Permalink
Implement PointCloud::nb_partitions()
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Sep 19, 2023
1 parent b87aa4a commit 1633483
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/atlas/functionspace/PointCloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ PointCloud::PointCloud(const Grid& grid, const grid::Partitioner& _partitioner,
partitioner = grid::Partitioner("equal_regions");
}

nb_partitions_ = partitioner.nb_partitions();
auto distribution = partitioner.partition(grid);
auto size_owned = distribution.nb_pts()[part];
size_owned_ = size_owned;
Expand Down
4 changes: 3 additions & 1 deletion src/atlas/functionspace/PointCloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class PointCloud : public functionspace::FunctionSpaceImpl {
Field remote_index() const override { return remote_index_; }
Field global_index() const override { return global_index_; }
Field partition() const override { return partition_; }
virtual idx_t size() const override { return lonlat_.shape(0); }
idx_t size() const override { return lonlat_.shape(0); }
idx_t nb_partitions() const override { return nb_partitions_; }

using FunctionSpaceImpl::createField;
Field createField(const eckit::Configuration&) const override;
Expand Down Expand Up @@ -165,6 +166,7 @@ class PointCloud : public functionspace::FunctionSpaceImpl {
idx_t max_glb_idx_{0};
std::unique_ptr<parallel::HaloExchange> halo_exchange_;
idx_t levels_{0};
idx_t nb_partitions_{1};

void setupHaloExchange();

Expand Down

0 comments on commit 1633483

Please sign in to comment.