Skip to content

Commit

Permalink
Wait for a worker
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmith- committed Mar 4, 2021
1 parent 1589220 commit e640326
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def postprocess(self, accumulator):
if __name__ == "__main__":
tic = time.time()
cluster = LPCCondorCluster()
cluster.adapt(minimum=0, maximum=10)
# minimum > 0: https://github.com/CoffeaTeam/coffea/issues/465
cluster.adapt(minimum=1, maximum=10)
client = Client(cluster)

fileset = {
Expand All @@ -69,6 +70,8 @@ def postprocess(self, accumulator):

proc = MyProcessor()

print("Waiting for at least one worker...")
client.wait_for_workers(1)
hists, metrics = processor.run_uproot_job(
fileset,
treename="Events",
Expand All @@ -80,5 +83,5 @@ def postprocess(self, accumulator):
elapsed = time.time() - tic
print(f"Output: {hists}")
print(f"Metrics: {metrics}")
print(f"Finished in {elapsed}s")
print(f"Events/s: {metrics['entries'].value / elapsed}s")
print(f"Finished in {elapsed:.1f}s")
print(f"Events/s: {metrics['entries'].value / elapsed:.0f}")

0 comments on commit e640326

Please sign in to comment.