Skip to content

Commit

Permalink
Merge branch 'broadcast_dist_method_dbg' of cee-gitlab.sandia.gov:etp…
Browse files Browse the repository at this point in the history
…hipp/genten into broadcast_dist_method_dbg
  • Loading branch information
etphipp committed Jun 14, 2024
2 parents 168a587 + 9523cdb commit bbb92cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Genten_DistTensorContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,15 @@ bool weightsAreSame(const KtensorT<ExecSpace>&) {
#else
template <typename ExecSpace>
bool weightsAreSame(const KtensorT<ExecSpace> &u) {
const ttb_indx wspan = u.weights().values().span();
auto w = u.weights();
const ttb_indx wspan = w.values().span();
if (!isValueSame(wspan)) {
return false;
}
auto w_h = create_mirror_view(w);
deep_copy(w_h, w);
for (std::size_t i = 0; i < wspan; ++i) {
if (!isValueSame(u.weights(i))) {
if (!isValueSame(w_h[i])) {
return false;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/Genten_Pmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ class ProcessorMap {
static_assert(std::is_arithmetic<scalar_type2>::value,
"subGridAllReduce requires something like a double, or int");

MPI_Reduce(send.data(), recv.data(), send.span(),
scalar_type2* recv_data = nullptr;
if (sub_grid_rank_[i] == root)
recv_data = recv.data();
MPI_Reduce(send.data(), recv_data, send.span(),
DistContext::toMpiType<scalar_type1>(),
convertOp(op), root, sub_maps_[i]);
}
Expand Down

0 comments on commit bbb92cf

Please sign in to comment.