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

python: fix handle barrier method to return a Future #5825

Merged
merged 3 commits into from
Mar 25, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bindings/python/flux/core/handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def fd_watcher_create(self, fd_int, callback, events=None, args=None):
return FDWatcher(self, fd_int, events, callback, args=args)

def barrier(self, name, nprocs):
self.flux_barrier(name, nprocs)
return Future(self.flux_barrier(name, nprocs))

def get_rank(self):
rank = ffi.new("uint32_t [1]")
Expand Down
2 changes: 1 addition & 1 deletion t/issues/t2492-shell-lost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ try:
taskid = int(os.environ["FLUX_TASK_RANK"])
if taskid == 0:
print(f"waiting on barrier for {size} tasks", flush=True)
h.barrier("test", size)
h.barrier("test", size).get()
if taskid == 0:
print(f"exited barrier", flush=True)

Expand Down
6 changes: 3 additions & 3 deletions t/python/t0003-barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def barr_count(x, name, count):
print(x, name, count)
f = flux.Flux()
f.barrier(name, count)
f.barrier(name, count).get()


def __flux_size():
Expand All @@ -33,8 +33,8 @@ def setUpClass(self):
self.f = flux.Flux()

def test_single(self):
self.f.barrier("testbarrier1", 1)
self.f.barrier("testbarrier1", 1)
self.f.barrier("testbarrier1", 1).get()
self.f.barrier("testbarrier1", 1).get()

def test_eight(self):
p = mp.Pool(8)
Expand Down