Skip to content

Commit 0d184ff

Browse files
committed
change to contexts
1 parent d3c2cac commit 0d184ff

6 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,12 @@ def main():
217217
)
218218

219219
workers = vine.Factory(manager_host_port=f"localhost:{distributor.port}")
220+
workers.ssl = True
220221
workers.cores = 2
221222
workers.min_workers = 1
222223
workers.max_workers = 1
223224

224-
with workers:
225+
with distributor, workers:
225226
vr.compute()
226227

227228
result = load_result(results_dir, "ttbar_like", "trijet")

‎examples/ADL/vr_adl_benchmarks.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ def main():
157157
checkpoint_dir=checkpoint_dir,
158158
)
159159
workers = vine.Factory(manager_host_port=f"localhost:{distributor.port}")
160+
workers.ssl = True
160161
workers.cores = 2
161162
workers.min_workers = 1
162163
workers.max_workers = 1
163164

164-
with workers:
165+
with distributor, workers:
165166
# reducer defaults to VineReduceCoffea's own default_reducer, which
166167
# already knows how to sum Hists (and dicts of them, for q6) - see
167168
# processors.py's module docstring.
@@ -178,7 +179,6 @@ def main():
178179
extra_files=[os.path.join(here, "processors.py")],
179180
)
180181
vr.compute()
181-
distributor.shutdown()
182182

183183
results = {name: load_result(results_dir, DATASET_NAME, name) for name in PROCESSORS}
184184
for name, result in results.items():

‎examples/cortado/vr_cortado.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ def main():
201201
checkpoint_dir=checkpoint_dir,
202202
)
203203
workers = vine.Factory(manager_host_port=f"localhost:{distributor.port}")
204+
workers.ssl = True
204205
workers.cores = 2
205206
workers.min_workers = 1
206207
workers.max_workers = 1
207208

208-
with workers:
209+
with distributor, workers:
209210
vr = VineReduceCoffea(
210211
processors={"skim_4lep": skimmer},
211212
input=datasets,
@@ -216,7 +217,6 @@ def main():
216217
result_postprocess=make_result_postprocess(results_dir),
217218
)
218219
vr.compute()
219-
distributor.shutdown()
220220

221221
# Every dataset's parquet skim was already written by
222222
# result_postprocess during compute(); just report how many events

‎examples/trijet/vr_trijet_iterative.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ def main():
286286
# db_path=None,
287287
)
288288

289-
vr.compute()
290-
distributor.shutdown()
289+
with distributor:
290+
vr.compute()
291291

292292
result = load_result(results_dir, "ttbar_like", "trijet")
293293
# flow=True: our uncorrelated, random-direction synthetic jets often

‎examples/trijet/vr_trijet_taskvine.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ def main():
292292
)
293293

294294
workers = vine.Factory(manager_host_port=f"localhost:{distributor.port}")
295+
workers.ssl = True
295296
workers.cores = 2
296297
workers.min_workers = 1
297298
workers.max_workers = 1
298299

299-
with workers:
300+
with distributor, workers:
300301
vr.compute()
301-
distributor.shutdown()
302302

303303
result = load_result(results_dir, "ttbar_like", "trijet")
304304
# flow=True: our uncorrelated, random-direction synthetic jets often

‎examples/ttBar/run_processor_with_vr.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ def load_all_results(results_dir, dataset_names, processor_names):
293293
results_dir=results_dir,
294294
distributor=distributor,
295295
)
296-
vr.compute()
297-
distributor.shutdown()
296+
with distributor:
297+
vr.compute()
298298

299299
hists = load_all_results(results_dir, list(available.keys()), list(vr.processors.keys()))
300300
print("\n\n resulting hists: ")

0 commit comments

Comments
 (0)