Skip to content

Commit

Permalink
fixup vector update
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Dec 11, 2024
1 parent 05b2067 commit 056663e
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions include/OGL/DevicePersistent/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,30 @@ struct VectorInitFunctor {
void update(std::shared_ptr<gko::experimental::distributed::Vector<T>>
persistent_vector) const
{
auto re_init_vec = init();
persistent_vector.swap(re_init_vec);
// auto re_init_vec = init();
// persistent_vector.swap(re_init_vec);

auto ref_exec = exec_.get_ref_exec();
auto exec = exec_.get_device_exec();
auto comm = exec_.get_communicator();
auto repartitioner = dist_matrix_->get_repartitioner();
auto host_size = repartitioner->get_orig_size();
auto repart_size = repartitioner->get_repart_size();
word msg{"updating array " + name_ + " of host size " +
std::to_string(host_size) + " repartitioned size " +
std::to_string(repart_size)};
LOG_1(verbose_, msg)

//auto repartitioner = dist_matrix_->get_repartitioner();
//auto host_size = repartitioner->get_orig_size();
//auto repart_size = repartitioner->get_repart_size();
//word msg{"updating array " + name_ + " of host size " +
// std::to_string(host_size) + " repartitioned size " +
// std::to_string(repart_size)};
//LOG_1(verbose_, msg)

//auto ref_exec = exec_.get_ref_exec();
//auto host_view = gko::array<T>::const_view(ref_exec, host_size, other_);
auto host_view = gko::array<T>::const_view(ref_exec, host_size, other_);

//// TODO store
//auto comm_pattern = compute_gather_to_owner_counts(
// exec_, repartitioner->get_ranks_per_gpu(), host_size);
//bool host_buffer = exec_.get_gko_force_host_buffer();
//// TODO store
auto comm_pattern = compute_gather_to_owner_counts(
exec_, repartitioner->get_ranks_per_gpu(), host_size);
bool host_buffer = exec_.get_gko_force_host_buffer();

//communicate_values(exec_, comm_pattern, host_view.get_const_data(),
// persistent_vector->get_local_values());
communicate_values(ref_exec, exec, comm, comm_pattern,
host_view.get_const_data(),
persistent_vector->get_local_values(), host_buffer);
}

std::shared_ptr<gko::experimental::distributed::Vector<T>> init() const
Expand Down

0 comments on commit 056663e

Please sign in to comment.