Skip to content

Commit a4501d5

Browse files
committed
Raw,CTF: add option to specify base cache dir for remote files
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent cea6567 commit a4501d5

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

Detectors/CTF/workflow/include/CTFWorkflow/CTFReaderSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct CTFReaderInp {
2727
std::string inpdata{};
2828
o2::detectors::DetID::mask_t detMask = o2::detectors::DetID::FullMask;
2929
std::string copyCmd{};
30+
std::string copyDir{};
3031
std::string tffileRegex{};
3132
std::string remoteRegex{};
3233
std::string metricChannel{};

Detectors/CTF/workflow/src/CTFReaderSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void CTFReaderSpec::init(InitContext& ic)
171171
mInput.maxTFsPerFile = ic.options().get<int>("max-tf-per-file");
172172
mInput.maxTFsPerFile = mInput.maxTFsPerFile > 0 ? mInput.maxTFsPerFile : 0x7fffffff;
173173
mRunning = true;
174-
mFileFetcher = std::make_unique<o2::utils::FileFetcher>(mInput.inpdata, mInput.tffileRegex, mInput.remoteRegex, mInput.copyCmd);
174+
mFileFetcher = std::make_unique<o2::utils::FileFetcher>(mInput.inpdata, mInput.tffileRegex, mInput.remoteRegex, mInput.copyCmd, mInput.copyDir);
175175
mFileFetcher->setMaxFilesInQueue(mInput.maxFileCache);
176176
mFileFetcher->setMaxLoops(mInput.maxLoops);
177177
mFileFetcher->setFailThreshold(ic.options().get<float>("fetch-failure-threshold"));

Detectors/CTF/workflow/src/ctf-reader-workflow.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
6060
options.push_back(ConfigParamSpec{"delay", VariantType::Float, 0.f, {"delay in seconds between consecutive TFs sending"}});
6161
options.push_back(ConfigParamSpec{"shuffle", VariantType::Bool, false, {"shuffle TF sending order (for debug)"}});
6262
options.push_back(ConfigParamSpec{"copy-cmd", VariantType::String, "alien_cp ?src file://?dst", {"copy command for remote files or no-copy to avoid copying"}}); // Use "XrdSecPROTOCOL=sss,unix xrdcp -N root://eosaliceo2.cern.ch/?src ?dst" for direct EOS access
63+
options.push_back(ConfigParamSpec{"copy-dir", VariantType::String, "/tmp/", {"copy base directory for remote files"}});
6364
options.push_back(ConfigParamSpec{"ctf-file-regex", VariantType::String, ".*o2_ctf_run.+\\.root$", {"regex string to identify CTF files"}});
6465
options.push_back(ConfigParamSpec{"remote-regex", VariantType::String, "^(alien://|)/alice/data/.+", {"regex string to identify remote files"}}); // Use "^/eos/aliceo2/.+" for direct EOS access
6566
options.push_back(ConfigParamSpec{"max-cached-files", VariantType::Int, 3, {"max CTF files queued (copied for remote source)"}});
@@ -126,6 +127,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
126127

127128
ctfInput.shuffle = configcontext.options().get<bool>("shuffle");
128129
ctfInput.copyCmd = configcontext.options().get<std::string>("copy-cmd");
130+
ctfInput.copyDir = configcontext.options().get<std::string>("copy-dir");
129131
ctfInput.tffileRegex = configcontext.options().get<std::string>("ctf-file-regex");
130132
ctfInput.remoteRegex = configcontext.options().get<std::string>("remote-regex");
131133
ctfInput.allowMissingDetectors = configcontext.options().get<bool>("allow-missing-detectors");

Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void TFReaderSpec::init(o2f::InitContext& ic)
121121
if (!mInput.fileRunTimeSpans.empty()) {
122122
loadRunTimeSpans(mInput.fileRunTimeSpans);
123123
}
124-
mFileFetcher = std::make_unique<o2::utils::FileFetcher>(mInput.inpdata, mInput.tffileRegex, mInput.remoteRegex, mInput.copyCmd);
124+
mFileFetcher = std::make_unique<o2::utils::FileFetcher>(mInput.inpdata, mInput.tffileRegex, mInput.remoteRegex, mInput.copyCmd, mInput.copyDir);
125125
mFileFetcher->setMaxFilesInQueue(mInput.maxFileCache);
126126
mFileFetcher->setMaxLoops(mInput.maxLoops);
127127
mFileFetcher->setFailThreshold(ic.options().get<float>("fetch-failure-threshold"));

Detectors/Raw/TFReaderDD/src/TFReaderSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct TFReaderInp {
2929
std::string detListNonRawOnly{};
3030
std::string rawChannelConfig{};
3131
std::string copyCmd{};
32+
std::string copyDir{};
3233
std::string tffileRegex{};
3334
std::string remoteRegex{};
3435
std::string metricChannel{};

Detectors/Raw/TFReaderDD/src/tf-reader-workflow.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
3131
options.push_back(ConfigParamSpec{"loop", VariantType::Int, 0, {"loop N times (-1 = infinite)"}});
3232
options.push_back(ConfigParamSpec{"delay", VariantType::Float, 0.f, {"delay in seconds between consecutive TFs sending"}});
3333
options.push_back(ConfigParamSpec{"copy-cmd", VariantType::String, "alien_cp ?src file://?dst", {"copy command for remote files"}}); // Use "XrdSecPROTOCOL=sss,unix xrdcp -N root://eosaliceo2.cern.ch/?src ?dst" for direct EOS access
34+
options.push_back(ConfigParamSpec{"copy-dir", VariantType::String, "/tmp/", {"copy base directory for remote files"}});
3435
options.push_back(ConfigParamSpec{"tf-file-regex", VariantType::String, ".+\\.tf$", {"regex string to identify TF files"}});
3536
options.push_back(ConfigParamSpec{"remote-regex", VariantType::String, "^(alien://|)/alice/data/.+", {"regex string to identify remote files"}}); // Use "^/eos/aliceo2/.+" for direct EOS access
3637
options.push_back(ConfigParamSpec{"tf-reader-verbosity", VariantType::Int, 0, {"verbosity level (1 or 2: check RDH, print DH/DPH for 1st or all slices, >2 print RDH)"}});
@@ -71,6 +72,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
7172
rinp.delay_us = uint64_t(1e6 * configcontext.options().get<float>("delay")); // delay in microseconds
7273
rinp.verbosity = configcontext.options().get<int>("tf-reader-verbosity");
7374
rinp.copyCmd = configcontext.options().get<std::string>("copy-cmd");
75+
rinp.copyDir = configcontext.options().get<std::string>("copy-dir");
7476
rinp.tffileRegex = configcontext.options().get<std::string>("tf-file-regex");
7577
rinp.remoteRegex = configcontext.options().get<std::string>("remote-regex");
7678
rinp.sendDummyForMissing = !configcontext.options().get<bool>("disable-dummy-output");

0 commit comments

Comments
 (0)