Skip to content

Commit

Permalink
#2174: remove CMAKE_POSITION_INDEPENDENT_CODE and create gatherTVGlob…
Browse files Browse the repository at this point in the history
…al function
  • Loading branch information
cwschilly authored and cz4rs committed Sep 20, 2024
1 parent 12d185a commit ecc556b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 0 additions & 2 deletions lib/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ endfunction()
add_headers(FMT_HEADERS core.h format.h format-inl.h ostream.h)
set(FMT_SOURCES src/format.cc)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS})
add_library(fmt::fmt ALIAS fmt)
set_target_properties(fmt PROPERTIES OUTPUT_NAME fmt-vt)
Expand Down
28 changes: 16 additions & 12 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,21 @@ static void collectTVData(GatherTVInfo& gather) {
);
pr.parseAndRender(gather.phase, std::move(info));
}

void gatherTVGlobal(PhaseType phase, objgroup::proxy::Proxy<LBManager> &proxy) {
vt::runInEpochCollective([&]{
auto phase_work = theNodeLBData()->getLBData()->toTV(phase);
auto object_info = theNodeLBData()->getLBData()->getObjInfo(phase);
std::unordered_map<PhaseType, vt::tv::PhaseWork> map;
map[phase] = std::move(*phase_work);
auto this_node = theContext()->getNode();
vt::tv::Rank r{this_node, std::move(map)};
std::unordered_map<NodeType, tv::Rank> rank_map;
rank_map[this_node] = std::move(r);
GatherTVInfo gather{rank_map, object_info, phase};
proxy.reduce<collectTVData, vt::collective::PlusOp>(0, std::move(gather));
});
}
#endif

void LBManager::finishedLB(PhaseType phase) {
Expand All @@ -531,18 +546,7 @@ void LBManager::finishedLB(PhaseType phase) {

#if vt_check_enabled(tv)
if (theConfig()->vt_tv) {
vt::runInEpochCollective([&]{
auto phase_work = theNodeLBData()->getLBData()->toTV(phase);
auto object_info = theNodeLBData()->getLBData()->getObjInfo(phase);
std::unordered_map<PhaseType, vt::tv::PhaseWork> map;
map[phase] = std::move(*phase_work);
auto this_node = theContext()->getNode();
vt::tv::Rank r{this_node, std::move(map)};
std::unordered_map<NodeType, tv::Rank> rank_map;
rank_map[this_node] = std::move(r);
GatherTVInfo gather{rank_map, object_info, phase};
proxy_.reduce<collectTVData, vt::collective::PlusOp>(0, std::move(gather));
});
gatherTVGlobal(phase, proxy_);
}
#endif
}
Expand Down

0 comments on commit ecc556b

Please sign in to comment.