Skip to content

Commit

Permalink
Snakefile: use XRootD by default
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Feb 12, 2024
1 parent 49ed8bb commit 93d8a47
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
19 changes: 19 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
configfile: "config.yaml"

if config["remote"] == "S3":
from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider
provider = S3RemoteProvider(
endpoint_url="https://eics3.sdcc.bnl.gov:9000",
access_key_id=os.environ["S3_ACCESS_KEY"],
secret_access_key=os.environ["S3_SECRET_KEY"],
)
remote_path = lambda path: f"eictest/{path}"
elif config["remote"] == "XRootD":
from snakemake.remote.XRootD import RemoteProvider as XRootDRemoteProvider
provider = XRootDRemoteProvider(
stay_on_remote=False,
)
remote_path = lambda path: f"root://dtn-eic.jlab.org//work/eic2/{path}"
else:
raise ValueError(f"Unexpected config[\"remote\"] = {config['remote']}")

include: "benchmarks/backgrounds/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"

Expand Down
15 changes: 3 additions & 12 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import os
import shutil

from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider


S3 = S3RemoteProvider(
endpoint_url="https://eics3.sdcc.bnl.gov:9000",
access_key_id=os.environ["S3_ACCESS_KEY"],
secret_access_key=os.environ["S3_SECRET_KEY"],
)


rule backgrounds_get_beam_gas_electron:
input:
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_10Mevt_vtx.hepmc"),
provider.remote(remote_path("EPIC/EVGEN/BACKGROUNDS/BEAMGAS/electron/beam_gas_ep_10GeV_foam_emin10keV_10Mevt_vtx.hepmc")),
output:
"input/backgrounds/beam_gas_electron.hepmc",
run:
Expand All @@ -22,7 +13,7 @@ rule backgrounds_get_beam_gas_electron:

rule backgrounds_get_beam_gas_proton:
input:
S3.remote("eictest/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/ProtonBeamGasEvents/100GeV/100GeV_1.hepmc"),
provider.remote(remote_path("EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/ProtonBeamGasEvents/100GeV/100GeV_1.hepmc")),
output:
"input/backgrounds/beam_gas_proton.hepmc",
run:
Expand All @@ -31,7 +22,7 @@ rule backgrounds_get_beam_gas_proton:

rule backgrounds_get_DIS:
input:
S3.remote("eictest/EPIC/EVGEN/DIS/NC/{BEAM}/minQ2={MINQ2}/pythia8NCDIS_{BEAM}_minQ2={MINQ2}_{SUFFIX}.hepmc"),
provider.remote(remote_path("EPIC/EVGEN/DIS/NC/{BEAM}/minQ2={MINQ2}/pythia8NCDIS_{BEAM}_minQ2={MINQ2}_{SUFFIX}.hepmc")),
wildcard_constraints:
BEAM="\d+x\d+",
MINQ2="\d+",
Expand Down
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remote: XRootD

0 comments on commit 93d8a47

Please sign in to comment.