Skip to content

Commit

Permalink
ensure Darc Drops are awaited properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rdfriese committed Nov 8, 2024
1 parent 3872700 commit 6bde847
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/darc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,8 @@ macro_rules! launch_drop {
);
}
// team.print_cnt();
team.team_counters.inc_outstanding(1);
team.world_counters.inc_outstanding(1); //ensure we don't trigger any warnings in wait all
let mut am = team.exec_am_local(DroppedWaitAM {
inner_addr: $inner_addr as *const u8 as usize,
mode_addr: $inner.mode_addr,
Expand All @@ -1629,6 +1631,8 @@ macro_rules! launch_drop {
phantom: PhantomData::<T>,
});
am.launch();
team.team_counters.dec_outstanding(1);
team.world_counters.dec_outstanding(1);
};
}

Expand Down
9 changes: 8 additions & 1 deletion src/lamellar_team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,8 @@ impl LamellarTeamRT {
let mut temp_now = Instant::now();
let mut orig_reqs = self.team_counters.send_req_cnt.load(Ordering::SeqCst);
let mut orig_launched = self.team_counters.launched_req_cnt.load(Ordering::SeqCst);
let mut world_orig_reqs = self.world_counters.send_req_cnt.load(Ordering::SeqCst);
let mut world_orig_launched = self.world_counters.launched_req_cnt.load(Ordering::SeqCst);

// println!(
// "in team wait_all mype: {:?} cnt: {:?} {:?}",
Expand All @@ -1436,10 +1438,15 @@ impl LamellarTeamRT {
|| orig_reqs != self.team_counters.send_req_cnt.load(Ordering::SeqCst)
|| orig_launched != self.team_counters.launched_req_cnt.load(Ordering::SeqCst))
|| (self.parent.is_none()
&& self.world_counters.outstanding_reqs.load(Ordering::SeqCst) > 0))
&& (self.world_counters.outstanding_reqs.load(Ordering::SeqCst) > 0
|| world_orig_reqs != self.world_counters.send_req_cnt.load(Ordering::SeqCst)
|| world_orig_launched != self.world_counters.launched_req_cnt.load(Ordering::SeqCst))
))
{
orig_reqs = self.team_counters.send_req_cnt.load(Ordering::SeqCst);
orig_launched = self.team_counters.launched_req_cnt.load(Ordering::SeqCst);
world_orig_reqs = self.world_counters.send_req_cnt.load(Ordering::SeqCst);
world_orig_launched = self.world_counters.launched_req_cnt.load(Ordering::SeqCst);
// std::thread::yield_now();
// self.flush();
if std::thread::current().id() != *crate::MAIN_THREAD {
Expand Down

0 comments on commit 6bde847

Please sign in to comment.