Skip to content

Commit

Permalink
review update
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Olenik <gregor.olenik@web.de>
Co-authored-by: Pratik Nayak <pratikvn@protonmail.com>
  • Loading branch information
3 people committed May 5, 2024
1 parent af9b637 commit abeee26
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
1 change: 0 additions & 1 deletion core/multigrid/pgm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ void communicate(
exec->copy_from(exec->get_master(), total_recv_size, recv_ptr,
non_local_agg.get_data());
}
return;
}
#endif

Expand Down
42 changes: 28 additions & 14 deletions include/ginkgo/core/distributed/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,22 @@ class Vector;
template <typename IndexType>
class MatrixBase {
public:
virtual std::vector<comm_index_type> get_recv_sizes() const = 0;
virtual std::vector<comm_index_type> get_send_sizes() const = 0;
virtual std::vector<comm_index_type> get_recv_offsets() const = 0;
virtual std::vector<comm_index_type> get_send_offsets() const = 0;
virtual const std::vector<comm_index_type>& get_recv_sizes() const = 0;

virtual const std::vector<comm_index_type>& get_send_sizes() const = 0;

virtual const std::vector<comm_index_type>& get_recv_offsets() const = 0;

virtual const std::vector<comm_index_type>& get_send_offsets() const = 0;

virtual std::shared_ptr<const LinOp> get_non_local_matrix() const = 0;

virtual std::shared_ptr<const LinOp> get_local_matrix() const = 0;
virtual array<IndexType> get_gather_idxs() const = 0;
virtual array<IndexType> get_recv_gather_idxs() const = 0;

virtual const array<IndexType>& get_gather_idxs() const = 0;

virtual const array<IndexType>& get_recv_gather_idxs() const = 0;

// TODO: use type tag?
virtual bool is_using_index(size_t index_size) const = 0;
};
Expand Down Expand Up @@ -409,27 +417,32 @@ class Matrix
*/
Matrix& operator=(Matrix&& other);

std::vector<comm_index_type> get_recv_sizes() const override
const std::vector<comm_index_type>& get_recv_sizes() const override
{
return recv_sizes_;
};
std::vector<comm_index_type> get_send_sizes() const override

const std::vector<comm_index_type>& get_send_sizes() const override
{
return send_sizes_;
};
std::vector<comm_index_type> get_recv_offsets() const override

const std::vector<comm_index_type>& get_recv_offsets() const override
{
return recv_offsets_;
};
std::vector<comm_index_type> get_send_offsets() const override

const std::vector<comm_index_type>& get_send_offsets() const override
{
return send_offsets_;
}
array<local_index_type> get_gather_idxs() const override

const array<local_index_type>& get_gather_idxs() const override
{
return gather_idxs_;
}
array<local_index_type> get_recv_gather_idxs() const override

const array<local_index_type>& get_recv_gather_idxs() const override
{
return recv_gather_idxs_;
}
Expand Down Expand Up @@ -587,7 +600,8 @@ class Matrix

/**
* Creates distributed matrix with existent local and non-local LinOp and
* the corresponding mapping.
* the corresponding mapping to collect the non-local data from the other
* ranks.
*
* @note It use the input to build up the distributed matrix
*
Expand All @@ -596,7 +610,7 @@ class Matrix
* @param size the global size
* @param local_linop the local linop
* @param non_local_linop the non-local linop
* @param recv_sizes the size of non-local recevier
* @param recv_sizes the size of non-local receiver
* @param recv_offset the offset of non-local receiver
* @param recv_gather_idxs the gathering index of non-local receiver
*
Expand Down
2 changes: 1 addition & 1 deletion test/mpi/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ TYPED_TEST(MatrixCreation, BuildOnlyLocal)
}


TYPED_TEST(MatrixCreation, BuildFromExistedData)
TYPED_TEST(MatrixCreation, BuildFromExistingData)
{
using value_type = typename TestFixture::value_type;
using csr = typename TestFixture::local_matrix_type;
Expand Down

0 comments on commit abeee26

Please sign in to comment.