Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
a6a770b0
Commit
a6a770b0
authored
4 months ago
by
Dmitry Kalinkin
Browse files
Options
Downloads
Patches
Plain Diff
ecal_gaps: enable caching for simulation/reconstruction
parent
417e9545
No related branches found
No related tags found
No related merge requests found
Pipeline
#107716
canceled
4 months ago
Stage: status-pending
Stage: config
Stage: data_init
Stage: simulate
Stage: calibrate
Stage: benchmarks
Stage: collect
Stage: deploy
Stage: status-report
Changes
3
Pipelines
47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Snakefile
+30
-0
30 additions, 0 deletions
Snakefile
benchmarks/backwards_ecal/Snakefile
+0
-27
0 additions, 27 deletions
benchmarks/backwards_ecal/Snakefile
benchmarks/ecal_gaps/Snakefile
+16
-5
16 additions, 5 deletions
benchmarks/ecal_gaps/Snakefile
with
46 additions
and
32 deletions
Snakefile
+
30
−
0
View file @
a6a770b0
configfile: "snakemake.yml"
configfile: "snakemake.yml"
import functools
import os
from snakemake.logging import logger
@functools.cache
def get_spack_package_hash(package_name):
import json
try:
ver_info = json.loads(subprocess.check_output(["spack", "find", "--json", package_name]))
return ver_info[0]["package_hash"]
except FileNotFoundError as e:
logger.warning("Spack is not installed")
return ""
except subprocess.CalledProcessError as e:
print(e)
return ""
@functools.cache
def find_epic_libraries():
import ctypes.util
# if library is not found (not avaliable) we return an empty list to let DAG still evaluate
libs = []
lib = ctypes.util.find_library("epic")
if lib is not None:
libs.append(os.environ["DETECTOR_PATH"] + "/../../lib/" + lib)
return libs
include: "benchmarks/backgrounds/Snakefile"
include: "benchmarks/backgrounds/Snakefile"
include: "benchmarks/backwards_ecal/Snakefile"
include: "benchmarks/backwards_ecal/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
...
...
This diff is collapsed.
Click to expand it.
benchmarks/backwards_ecal/Snakefile
+
0
−
27
View file @
a6a770b0
...
@@ -4,33 +4,6 @@ def get_n_events(wildcards):
...
@@ -4,33 +4,6 @@ def get_n_events(wildcards):
n_events = int(n_events // (energy ** 0.5))
n_events = int(n_events // (energy ** 0.5))
return n_events
return n_events
import functools
import json
import ctypes.util
import warnings
from snakemake.logging import logger
@functools.cache
def get_spack_package_hash(package_name):
try:
ver_info = json.loads(subprocess.check_output(["spack", "find", "--json", package_name]))
return ver_info[0]["package_hash"]
except FileNotFoundError as e:
logger.warning("Spack is not installed")
return ""
except subprocess.CalledProcessError as e:
print(e)
return ""
@functools.cache
def find_epic_libraries():
# if library is not found (not avaliable) we return an empty list to let DAG still evaluate
libs = []
lib = ctypes.util.find_library("epic")
if lib is not None:
libs.append(os.environ["DETECTOR_PATH"] + "/../../lib/" + lib)
return libs
rule backwards_ecal_sim:
rule backwards_ecal_sim:
input:
input:
...
...
This diff is collapsed.
Click to expand it.
benchmarks/ecal_gaps/Snakefile
+
16
−
5
View file @
a6a770b0
...
@@ -3,8 +3,9 @@ import os
...
@@ -3,8 +3,9 @@ import os
rule ecal_gaps_sim:
rule ecal_gaps_sim:
input:
input:
steering_file=
ancient(
"EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer"
)
,
steering_file="EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
output:
"sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
"sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
log:
log:
...
@@ -15,7 +16,13 @@ rule ecal_gaps_sim:
...
@@ -15,7 +16,13 @@ rule ecal_gaps_sim:
PHASE_SPACE="(3to50|45to135|130to177)deg",
PHASE_SPACE="(3to50|45to135|130to177)deg",
INDEX="\d{4}",
INDEX="\d{4}",
params:
params:
N_EVENTS=1000
N_EVENTS=1000,
SEED=lambda wildcards: "1" + wildcards.INDEX,
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
shell:
"""
"""
set -m # monitor mode to prevent lingering processes
set -m # monitor mode to prevent lingering processes
...
@@ -23,11 +30,11 @@ exec ddsim \
...
@@ -23,11 +30,11 @@ exec ddsim \
--runType batch \
--runType batch \
--enableGun \
--enableGun \
--steeringFile "{input.steering_file}" \
--steeringFile "{input.steering_file}" \
--random.seed
1{wildcards.INDEX
} \
--random.seed
{params.SEED
} \
--filter.tracker edep0 \
--filter.tracker edep0 \
-v WARNING \
-v WARNING \
--numberOfEvents {params.N_EVENTS} \
--numberOfEvents {params.N_EVENTS} \
--compactFile
$
DETECTOR_PATH/{
wildcard
s.DETECTOR_CONFIG}.xml \
--compactFile
{params.
DETECTOR_PATH
}
/{
param
s.DETECTOR_CONFIG}.xml \
--outputFile {output}
--outputFile {output}
"""
"""
...
@@ -41,9 +48,13 @@ rule ecal_gaps_recon:
...
@@ -41,9 +48,13 @@ rule ecal_gaps_recon:
"sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
"sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
wildcard_constraints:
INDEX="\d{4}",
INDEX="\d{4}",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: """
shell: """
set -m # monitor mode to prevent lingering processes
set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={
wildcard
s.DETECTOR_CONFIG} \
exec env DETECTOR_CONFIG={
param
s.DETECTOR_CONFIG} \
eicrecon {input} -Ppodio:output_file={output} \
eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_collections=EcalEndcapNRecHits,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits,EcalEndcapPRecHits,MCParticles
-Ppodio:output_collections=EcalEndcapNRecHits,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits,EcalEndcapPRecHits,MCParticles
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment