#include "RConfigure.h"
#include "TProofBenchDataSet.h"
#include "TClass.h"
#include "TFileCollection.h"
#include "TList.h"
#include "TMap.h"
#include "TProof.h"
#include "TProofBenchTypes.h"
ClassImp(TProofBenchDataSet)
TProofBenchDataSet::TProofBenchDataSet(TProof *proof)
{
fProof = proof ? proof : gProof;
}
Int_t TProofBenchDataSet::ReleaseCache(const char *dset)
{
TPBHandleDSType type(TPBHandleDSType::kReleaseCache);
if (Handle(dset, &type) != 0) {
Error("ReleaseCache", "problems clearing cache for '%s'", dset);
return -1;
}
return 0;
}
Int_t TProofBenchDataSet::RemoveFiles(const char *dset)
{
TPBHandleDSType type(TPBHandleDSType::kRemoveFiles);
if (Handle(dset, &type) != 0) {
Error("RemoveFiles", "problems removing files for '%s'", dset);
return -1;
}
if (!fProof || (fProof && fProof->RemoveDataSet(dset) != 0)) {
Error("RemoveFiles", "problems removing meta-information for dataset '%s'", dset);
return -1;
}
return 0;
}
Int_t TProofBenchDataSet::CopyFiles(const char *dset, const char *destdir)
{
if (!destdir || (destdir && strlen(destdir) <= 0)) {
Error("CopyFiles", "specifying a destination dir is mandatory!");
return -1;
}
if (fProof) fProof->SetParameter("PROOF_Benchmark_DestDir", destdir);
TPBHandleDSType type(TPBHandleDSType::kCopyFiles);
if (Handle(dset, &type) != 0) {
Error("CopyFiles", "problems copying files for '%s'", dset);
return -1;
}
return 0;
}
Int_t TProofBenchDataSet::Handle(const char *dset, TObject *type)
{
if (!dset || (dset && strlen(dset) <= 0)) {
Error("Handle", "a valid dataset name is mandatory");
return -1;
}
if (!fProof || (fProof && !fProof->ExistsDataSet(dset))) {
Error("Handle", "dataset '%s' does not exist", dset);
return -1;
}
TFileCollection *fc = fProof->GetDataSet(dset);
if (!fc) {
Error("Handle", "TFileCollection object for dataset '%s' could not be retrieved", dset);
return -1;
}
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,30,0)
TMap *fcmap = fc->GetFilesPerServer(fProof->GetMaster(), kTRUE);
#else
TMap *fcmap = fc->GetFilesPerServer(fProof->GetMaster());
#endif
if (!fcmap) {
Error("Handle", "could not create map with per-server info for dataset '%s'", dset);
return -1;
}
fcmap->Print();
TString selName("TSelHandleDataSet");
if (!TClass::GetClass(selName)) {
#ifdef R__HAVE_CONFIG
TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchDataSelPar);
#else
TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchDataSelPar);
#endif
Info("Handle", "Uploading '%s' ...", par.Data());
if (fProof->UploadPackage(par) != 0) {
Error("Handle", "problems uploading '%s' - cannot continue", par.Data());
return -1;
}
Info("Handle", "Enabling '%s' ...", kPROOF_BenchDataSelPar);
if (fProof->EnablePackage(kPROOF_BenchDataSelPar) != 0) {
Error("Handle", "problems enabling '%s' - cannot continue", kPROOF_BenchDataSelPar);
return -1;
}
if (!TClass::GetClass(selName)) {
Error("Handle", "failed to load '%s'", selName.Data());
return -1;
}
}
fcmap->SetName("PROOF_FilesToProcess");
fProof->AddInput(fcmap);
TString oldpack;
if (TProof::GetParameter(fProof->GetInputList(), "PROOF_Packetizer", oldpack) != 0) oldpack = "";
fProof->SetParameter("PROOF_Packetizer", "TPacketizerFile");
fProof->AddInput(type);
fProof->Process(selName, (Long64_t) fc->GetNFiles());
if (fProof->GetInputList()) fProof->GetInputList()->Remove(type);
if (!oldpack.IsNull())
fProof->SetParameter("PROOF_Packetizer", oldpack);
else
fProof->DeleteParameters("PROOF_Packetizer");
fProof->GetInputList()->Remove(fcmap);
delete fcmap;
delete fc;
return 0;
}
TProofBenchDataSet.cxx:10 TProofBenchDataSet.cxx:11 TProofBenchDataSet.cxx:12 TProofBenchDataSet.cxx:13 TProofBenchDataSet.cxx:14 TProofBenchDataSet.cxx:15 TProofBenchDataSet.cxx:16 TProofBenchDataSet.cxx:17 TProofBenchDataSet.cxx:18 TProofBenchDataSet.cxx:19 TProofBenchDataSet.cxx:20 TProofBenchDataSet.cxx:21 TProofBenchDataSet.cxx:22 TProofBenchDataSet.cxx:23 TProofBenchDataSet.cxx:24 TProofBenchDataSet.cxx:25 TProofBenchDataSet.cxx:26 TProofBenchDataSet.cxx:27 TProofBenchDataSet.cxx:28 TProofBenchDataSet.cxx:29 TProofBenchDataSet.cxx:30 TProofBenchDataSet.cxx:31 TProofBenchDataSet.cxx:32 TProofBenchDataSet.cxx:33 TProofBenchDataSet.cxx:34 TProofBenchDataSet.cxx:35 TProofBenchDataSet.cxx:36 TProofBenchDataSet.cxx:37 TProofBenchDataSet.cxx:38 TProofBenchDataSet.cxx:39 TProofBenchDataSet.cxx:40 TProofBenchDataSet.cxx:41 TProofBenchDataSet.cxx:42 TProofBenchDataSet.cxx:43 TProofBenchDataSet.cxx:44 TProofBenchDataSet.cxx:45 TProofBenchDataSet.cxx:46 TProofBenchDataSet.cxx:47 TProofBenchDataSet.cxx:48 TProofBenchDataSet.cxx:49 TProofBenchDataSet.cxx:50 TProofBenchDataSet.cxx:51 TProofBenchDataSet.cxx:52 TProofBenchDataSet.cxx:53 TProofBenchDataSet.cxx:54 TProofBenchDataSet.cxx:55 TProofBenchDataSet.cxx:56 TProofBenchDataSet.cxx:57 TProofBenchDataSet.cxx:58 TProofBenchDataSet.cxx:59 TProofBenchDataSet.cxx:60 TProofBenchDataSet.cxx:61 TProofBenchDataSet.cxx:62 TProofBenchDataSet.cxx:63 TProofBenchDataSet.cxx:64 TProofBenchDataSet.cxx:65 TProofBenchDataSet.cxx:66 TProofBenchDataSet.cxx:67 TProofBenchDataSet.cxx:68 TProofBenchDataSet.cxx:69 TProofBenchDataSet.cxx:70 TProofBenchDataSet.cxx:71 TProofBenchDataSet.cxx:72 TProofBenchDataSet.cxx:73 TProofBenchDataSet.cxx:74 TProofBenchDataSet.cxx:75 TProofBenchDataSet.cxx:76 TProofBenchDataSet.cxx:77 TProofBenchDataSet.cxx:78 TProofBenchDataSet.cxx:79 TProofBenchDataSet.cxx:80 TProofBenchDataSet.cxx:81 TProofBenchDataSet.cxx:82 TProofBenchDataSet.cxx:83 TProofBenchDataSet.cxx:84 TProofBenchDataSet.cxx:85 TProofBenchDataSet.cxx:86 TProofBenchDataSet.cxx:87 TProofBenchDataSet.cxx:88 TProofBenchDataSet.cxx:89 TProofBenchDataSet.cxx:90 TProofBenchDataSet.cxx:91 TProofBenchDataSet.cxx:92 TProofBenchDataSet.cxx:93 TProofBenchDataSet.cxx:94 TProofBenchDataSet.cxx:95 TProofBenchDataSet.cxx:96 TProofBenchDataSet.cxx:97 TProofBenchDataSet.cxx:98 TProofBenchDataSet.cxx:99 TProofBenchDataSet.cxx:100 TProofBenchDataSet.cxx:101 TProofBenchDataSet.cxx:102 TProofBenchDataSet.cxx:103 TProofBenchDataSet.cxx:104 TProofBenchDataSet.cxx:105 TProofBenchDataSet.cxx:106 TProofBenchDataSet.cxx:107 TProofBenchDataSet.cxx:108 TProofBenchDataSet.cxx:109 TProofBenchDataSet.cxx:110 TProofBenchDataSet.cxx:111 TProofBenchDataSet.cxx:112 TProofBenchDataSet.cxx:113 TProofBenchDataSet.cxx:114 TProofBenchDataSet.cxx:115 TProofBenchDataSet.cxx:116 TProofBenchDataSet.cxx:117 TProofBenchDataSet.cxx:118 TProofBenchDataSet.cxx:119 TProofBenchDataSet.cxx:120 TProofBenchDataSet.cxx:121 TProofBenchDataSet.cxx:122 TProofBenchDataSet.cxx:123 TProofBenchDataSet.cxx:124 TProofBenchDataSet.cxx:125 TProofBenchDataSet.cxx:126 TProofBenchDataSet.cxx:127 TProofBenchDataSet.cxx:128 TProofBenchDataSet.cxx:129 TProofBenchDataSet.cxx:130 TProofBenchDataSet.cxx:131 TProofBenchDataSet.cxx:132 TProofBenchDataSet.cxx:133 TProofBenchDataSet.cxx:134 TProofBenchDataSet.cxx:135 TProofBenchDataSet.cxx:136 TProofBenchDataSet.cxx:137 TProofBenchDataSet.cxx:138 TProofBenchDataSet.cxx:139 TProofBenchDataSet.cxx:140 TProofBenchDataSet.cxx:141 TProofBenchDataSet.cxx:142 TProofBenchDataSet.cxx:143 TProofBenchDataSet.cxx:144 TProofBenchDataSet.cxx:145 TProofBenchDataSet.cxx:146 TProofBenchDataSet.cxx:147 TProofBenchDataSet.cxx:148 TProofBenchDataSet.cxx:149 TProofBenchDataSet.cxx:150 TProofBenchDataSet.cxx:151 TProofBenchDataSet.cxx:152 TProofBenchDataSet.cxx:153 TProofBenchDataSet.cxx:154 TProofBenchDataSet.cxx:155 TProofBenchDataSet.cxx:156 TProofBenchDataSet.cxx:157 TProofBenchDataSet.cxx:158 TProofBenchDataSet.cxx:159 TProofBenchDataSet.cxx:160 TProofBenchDataSet.cxx:161 TProofBenchDataSet.cxx:162 TProofBenchDataSet.cxx:163 TProofBenchDataSet.cxx:164 TProofBenchDataSet.cxx:165 TProofBenchDataSet.cxx:166 TProofBenchDataSet.cxx:167 TProofBenchDataSet.cxx:168 TProofBenchDataSet.cxx:169 TProofBenchDataSet.cxx:170 TProofBenchDataSet.cxx:171 TProofBenchDataSet.cxx:172 TProofBenchDataSet.cxx:173 TProofBenchDataSet.cxx:174 TProofBenchDataSet.cxx:175 TProofBenchDataSet.cxx:176 TProofBenchDataSet.cxx:177 TProofBenchDataSet.cxx:178 TProofBenchDataSet.cxx:179 TProofBenchDataSet.cxx:180 TProofBenchDataSet.cxx:181 TProofBenchDataSet.cxx:182 TProofBenchDataSet.cxx:183 TProofBenchDataSet.cxx:184 TProofBenchDataSet.cxx:185 TProofBenchDataSet.cxx:186 TProofBenchDataSet.cxx:187 TProofBenchDataSet.cxx:188 TProofBenchDataSet.cxx:189 TProofBenchDataSet.cxx:190 TProofBenchDataSet.cxx:191 TProofBenchDataSet.cxx:192 TProofBenchDataSet.cxx:193 TProofBenchDataSet.cxx:194 TProofBenchDataSet.cxx:195 TProofBenchDataSet.cxx:196 TProofBenchDataSet.cxx:197