Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to add annotations to clarify where the generic async t… #396

Merged
merged 2 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/node_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ future<void> node_server::exchange_flux_corrections() {
if (this->nieces[f] == +1) {
for (auto const &quadrant : geo::quadrant::full_set()) {
futs[index++] = niece_hydro_channels[f][quadrant].get_future().then(
/*hpx::util::annotated_function(*/[this, f, quadrant](future<std::vector<real> > &&fdata) -> void {
hpx::util::annotated_function([this, f, quadrant](future<std::vector<real> > &&fdata) -> void {
const auto face_dim = f.get_dimension();
std::array<integer, NDIM> lb, ub;
switch (face_dim) {
Expand Down Expand Up @@ -136,16 +136,17 @@ future<void> node_server::exchange_flux_corrections() {
break;
}
grid_ptr->set_flux_restrict(GET(fdata), lb, ub, face_dim);
}/*, "node_server::exchange_flux_corrections::set_flux_restrict")*/);
}, "node_server::exchange_flux_corrections::set_flux_restrict"));
}
}
}
return hpx::when_all(std::move(futs)).then([](future<decltype(futs)> fout) {
return hpx::when_all(std::move(futs)).then(
hpx::util::annotated_function([](future<decltype(futs)> fout) {
auto fin = GET(fout);
for (auto &f : fin) {
GET(f);
}
});
}, "node_server::exchange_flux_corrections::sync"));
}

void node_server::all_hydro_bounds() {
Expand Down Expand Up @@ -199,15 +200,15 @@ void node_server::collect_hydro_boundaries(bool energy_only) {
for (auto const &dir : geo::direction::full_set()) {
if (!(neighbors[dir].empty() && my_location.level() == 0)) {
results[index++] = sibling_hydro_channels[dir].get_future(hcycle).then(
/*hpx::util::annotated_function(*/[this, energy_only, dir](future<sibling_hydro_type> &&f) -> void {
hpx::util::annotated_function([this, energy_only, dir](future<sibling_hydro_type> &&f) -> void {
auto &&tmp = GET(f);
if (!neighbors[dir].empty()) {
grid_ptr->set_hydro_boundary(tmp.data, tmp.direction, energy_only);
} else {
grid_ptr->set_hydro_amr_boundary(tmp.data, tmp.direction, energy_only);

}
}/*, "node_server::collect_hydro_boundaries::set_hydro_boundary")*/);
}, "node_server::collect_hydro_boundaries::set_hydro_boundary"));
}
}
while (index < geo::direction::count()) {
Expand Down Expand Up @@ -243,7 +244,7 @@ void node_server::collect_hydro_boundaries(bool energy_only) {
grid_ptr->is_coarse, xmin, grid_ptr->U);
}
// None GPU build -> run on CPU
#else
#else
#if defined __x86_64__ && defined OCTOTIGER_HAVE_VC
complete_hydro_amr_boundary_vc(dx, energy_only, grid_ptr->Ushad, grid_ptr->is_coarse, xmin, grid_ptr->U);
#else
Expand Down Expand Up @@ -419,7 +420,7 @@ void node_server::compute_fmm(gsolve_type type, bool energy_account, bool aonly)
for (auto &ci : geo::octant::full_set()) {
future<multipole_pass_type> m_in_future = child_gravity_channels[ci].get_future();

futs[index++] = m_in_future.then(/*hpx::util::annotated_function(*/[&m_out, ci](future<multipole_pass_type> &&fut) {
futs[index++] = m_in_future.then(hpx::util::annotated_function([&m_out, ci](future<multipole_pass_type> &&fut) {
const integer x0 = ci.get_side(XDIM) * INX / 2;
const integer y0 = ci.get_side(YDIM) * INX / 2;
const integer z0 = ci.get_side(ZDIM) * INX / 2;
Expand All @@ -434,7 +435,7 @@ void node_server::compute_fmm(gsolve_type type, bool energy_account, bool aonly)
}
}
}
}/*, "node_server::compute_fmm::gather_from::child_gravity_channels")*/);
}, "node_server::compute_fmm::gather_from::child_gravity_channels"));
}
wait_all_and_propagate_exceptions(std::move(futs));
m_out = grid_ptr->compute_multipoles(type, &m_out);
Expand Down Expand Up @@ -506,7 +507,7 @@ void node_server::compute_fmm(gsolve_type type, bool energy_account, bool aonly)
// Check if we are a multipole
if (!grid_ptr->get_leaf()) {
// Input structure, needed for multipole-monopole interactions
std::array<real, NDIM> Xbase = {
std::array<real, NDIM> Xbase = {
grid_ptr->get_X()[0][hindex(H_BW, H_BW, H_BW)],
grid_ptr->get_X()[1][hindex(H_BW, H_BW, H_BW)],
grid_ptr->get_X()[2][hindex(H_BW, H_BW, H_BW)] };
Expand Down
9 changes: 5 additions & 4 deletions src/node_server_actions_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,10 @@ int node_server::form_tree(hpx::id_type self_gid, hpx::id_type parent_gid, std::
for (auto &f : geo::face::full_set()) {
const auto &neighbor = neighbors[f.to_direction()];
if (!neighbor.empty()) {
nfuts.push_back(neighbor.set_child_aunt(me.get_gid(), f ^ 1).then([this, f](future<set_child_aunt_type> &&n) {
nfuts.push_back(neighbor.set_child_aunt(me.get_gid(), f ^ 1).then(
hpx::util::annotated_function([this, f](future<set_child_aunt_type> &&n) {
nieces[f] = GET(n);
}));
}, "node_server::form_tree::sync")));
} else {
nieces[f] = -2;
}
Expand Down Expand Up @@ -570,9 +571,9 @@ future<hpx::id_type> node_client::get_child_client(const node_location &parent_l
++misses;
}
if (!found) {
rfut = hpx::async([=]() {
rfut = hpx::async(hpx::util::annotated_function([=]() {
return sfut.get();
});
}), "return_future_get_child_client");
}
#else
rfut = hpx::async<typename node_server::get_child_client_action>(get_unmanaged_gid(), ci);
Expand Down