@@ -6,7 +6,7 @@ const MINITREE_DIR = Ref("/data/jiling/WVZ/v2.3")
6
6
const ANALYSIS_DIR = Ref (" /data/jiling/WVZ/v2.3_hists" )
7
7
8
8
const ONNX_MODEL_PATH = Ref (" /data/grabanal/NN/NN_08_23.onnx" )
9
- const BDT_MODEL_PATH = Ref (" /home /rjacobse/BDT /kfolding/" )
9
+ const BDT_MODEL_PATH = Ref (" /data /rjacobse/WVZ /kfolding/" )
10
10
11
11
function init_ONNX ()
12
12
model= ONNX. load (ONNX_MODEL_PATH[], zeros (Float32, 30 , 1 ))
@@ -326,54 +326,12 @@ end
326
326
327
327
328
328
"""
329
- hist_root(tag; output_dir, kw...)
330
-
331
- return a dictionary of all systematics histograms for a given tag, the `output_dir` is
332
- used to store Julia Serializatio files as a backup measure, and for later conversion to
333
- `.root` histograms via `PythonCall.jl` + `uproot`.
334
- """
335
- function hist_root (tag; output_dir, kw... )
336
- p = output_dir
337
- if ! isdir (p)
338
- mkdir (p)
339
- end
340
- @show Threads. nthreads ()
341
- @info " -------------- $tag SF begin ------------ "
342
- sf_tasks = prep_tasks (tag)
343
- println (" $(length (sf_tasks)) tasks in total" )
344
- p1 = Progress (length (sf_tasks))
345
- sf_list = map (sf_tasks) do t
346
- x = main_looper (t)
347
- next! (p1)
348
- x
349
- end
350
- sf_hist = reduce (mergewith (+ ), sf_list)
351
-
352
- @info " -------------- $tag shapes begin ------------ "
353
- shape_tasks = mapreduce (shape_variation -> prep_tasks (tag; shape_variation), vcat,
354
- SHAPE_TREE_NAMES)
355
- sort! (shape_tasks; by = x-> x. path)
356
- println (" $(length (shape_tasks)) tasks in total" )
357
- p2 = Progress (length (shape_tasks))
358
- shape_list = map (shape_tasks) do t
359
- x = main_looper (t)
360
- next! (p2)
361
- x
362
- end
363
- shape_hist = reduce (mergewith (+ ), shape_list)
364
-
365
- Hs = merge (sf_hist, shape_hist)
366
- serialize (joinpath (p, " $(tag) .jlserialize" ), Hs)
367
- Hs
368
- end
369
-
370
- """
371
- hist_root_pmap(tag; output_dir, kw...)
329
+ hist_root(tag; mapper=pmap, no_shape=false, output_dir, kw...)
372
330
373
331
Similar to the one without `pmap`, except uses pmap for everything. Checkout `ClusterManager.jl`
374
332
and be sure to have a handful of workers before running this.
375
333
"""
376
- function hist_root_pmap (tag; output_dir, kw... )
334
+ function hist_root (tag; mapper = pmap, no_shape = false , output_dir, kw... )
377
335
p = output_dir
378
336
if ! isdir (p)
379
337
mkdir (p)
@@ -382,16 +340,25 @@ function hist_root_pmap(tag; output_dir, kw...)
382
340
383
341
all_tasks = prep_tasks (tag; sfsys= true )
384
342
if tag != " Data"
385
- @info " -------------- $tag SF + shapes ------------ "
386
- shape_tasks = mapreduce (shape_variation -> prep_tasks (tag; shape_variation, sfsys= false ), vcat,
387
- SHAPE_TREE_NAMES)
388
- sort! (shape_tasks; by = x-> x. path)
389
- append! (all_tasks, shape_tasks)
343
+ if no_shape
344
+ @info " -------------- $tag SF ------------ "
345
+ else
346
+ @info " -------------- $tag SF + shapes ------------ "
347
+ shape_tasks = mapreduce (shape_variation -> prep_tasks (tag; shape_variation, sfsys= false ), vcat,
348
+ SHAPE_TREE_NAMES)
349
+ sort! (shape_tasks; by = x-> x. path)
350
+ append! (all_tasks, shape_tasks)
351
+ end
390
352
else
391
353
@info " -------------- !!! $tag !!! ------------ "
392
354
end
393
355
println (" $(length (all_tasks)) tasks in total" )
394
- all_list = @showprogress pmap (main_looper, all_tasks)
356
+ prog = Progress (length (all_tasks))
357
+ all_list = mapper (all_tasks) do task
358
+ _m = main_looper (task)
359
+ next! (prog)
360
+ return _m
361
+ end
395
362
# TODO
396
363
# process_theory_syst!.(all_list)
397
364
Hs = reduce (mergewith (+ ), all_list)
0 commit comments