-
-
Save sithhell/64d3cb1bf7c54c148889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// schedule threads based on given parcel | |
void applier::schedule_action(parcelset::parcel p, std::size_t num_thread) | |
{ | |
// fetch the set of destinations | |
#if !defined(HPX_SUPPORT_MULTIPLE_PARCEL_DESTINATIONS) | |
std::size_t const size = 1ul; | |
#else | |
std::size_t const size = p.size(); | |
#endif | |
naming::id_type const* ids = p.destinations(); | |
naming::address const* addrs = p.addrs(); | |
// make sure the target has not been migrated away | |
naming::resolver_client& client = hpx::naming::get_agas_client(); | |
// Get the pinned pointers | |
std::vector<pinned_ptr> ptrs = client.get_pinned_ptrs(ids, size); | |
// If the pinned pointers are invalid, route the parcel | |
if (ptrs[0]) | |
{ | |
using hpx::util::placeholders::_1; | |
using hpx::util::placeholders::_2; | |
client.route(std::move(p), | |
util::bind(&detail::parcel_sent_handler, | |
std::ref(parcel_handler_), _1, _2)); | |
return; | |
} | |
// ..... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment