Skip to content

Commit

Permalink
continue to fix the cases where ncomps > 1 and progress_type == worker
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Oct 12, 2023
1 parent 1498c35 commit c5ad8d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/full/parcelport_lci/src/parcelport_lci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ namespace hpx::parcelset::policies::lci {
while (prg_thread_flag)
{
for (auto& device : devices)
{
util::lci_environment::do_progress(device.device);
}
}
}

Expand Down Expand Up @@ -455,11 +457,11 @@ namespace hpx::parcelset::policies::lci {
if (HPX_UNLIKELY(!is_initialized ||
hpx::threads::get_self_id() == hpx::threads::invalid_thread_id))
{
static thread_local std::size_t tls_rr_device_idx = 0;
static thread_local unsigned int tls_rand_seed = rand();
util::lci_environment::log(
util::lci_environment::log_level_t::debug, "device",
"Rank %d unusual phase\n", LCI_RANK);
return devices[tls_rr_device_idx++ % devices.size()];
return devices[rand_r(&tls_rand_seed) % devices.size()];
}
if (tls_device_idx == std::size_t(-1))
{
Expand Down

0 comments on commit c5ad8d0

Please sign in to comment.