15 #include <TPluginManager.h>
47 mgr->AddHandler(
"TFile",
49 "TStorageFactoryFile",
51 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t)");
53 mgr->AddHandler(
"TSystem",
55 "TStorageFactorySystem",
57 "TStorageFactorySystem()");
58 }
else if (altType == 1) {
59 mgr->AddHandler(
"TFile",
61 "TStorageFactoryFile",
63 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t, Int_t, Bool_t)");
65 mgr->AddHandler(
"TSystem",
67 "TStorageFactorySystem",
69 "TStorageFactorySystem(const char *,Bool_t)");
83 enablePrefetching_(
false),
84 cacheHint_(
"auto-detect"),
85 readHint_(
"auto-detect"),
136 if ((
enablePrefetching_) && ((cacheHint_ ==
"storage-only") || (cacheHint_ ==
"auto-detect")))
137 cacheHint_ =
"application-only";
140 if (cacheHint_ ==
"application-only")
142 else if (cacheHint_ ==
"storage-only")
144 else if (cacheHint_ ==
"lazy-download")
146 else if (cacheHint_ ==
"auto-detect")
150 <<
"Unrecognised 'cacheHint' value '" << cacheHint_
151 <<
"', recognised values are 'application-only',"
152 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
154 if (readHint_ ==
"direct-unbuffered")
156 else if (readHint_ ==
"read-ahead-buffered")
158 else if (readHint_ ==
"auto-detect")
162 <<
"Unrecognised 'readHint' value '" << readHint_
163 <<
"', recognised values are 'direct-unbuffered',"
164 <<
" 'read-ahead-buffered', 'auto-detect'";
176 TPluginManager* mgr = gROOT->GetPluginManager();
179 mgr->LoadHandlersFromPluginDirs(
"TFile");
180 mgr->LoadHandlersFromPluginDirs(
"TSystem");
210 descriptions.
add(
"AdaptorConfig", desc);
216 std::map<std::string, std::string>
data;
229 float const oneMeg = 1048576.0;
230 o <<
"Storage parameters: adaptor: true"
231 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n'
235 <<
"Storage statistics: "
237 <<
"; tfile/read=?/?/" << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms"
238 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
246 float const oneMeg = 1048576.0;
247 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
248 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
249 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
250 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
251 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
253 std::ostringstream
r;
254 std::ostringstream
w;
255 r << (TFile::GetFileBytesRead() / oneMeg);
256 w << (TFile::GetFileBytesWritten() / oneMeg);
257 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes", r.str()));
258 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes", w.str()));
T getUntrackedParameter(std::string const &, T const &) const
bool enableAccounting(bool enabled)
boost::shared_ptr< TFileAdaptor > me
static void fillSummary(std::map< std::string, std::string > &summary)
bool native(char const *proto) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::string tempPath(void) const
void setTimeout(unsigned int timeout)
void setReadHint(ReadHint value)
void stats(std::ostream &o) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double tempMinFree(void) const
virtual bool enablePrefetching() const =0
virtual std::string const * sourceCacheTempDir() const =0
virtual unsigned int const * sourceTimeout() const =0
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
void setDebugLevel(unsigned int level)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual unsigned int debugLevel() const =0
std::vector< std::string > native_
static void addType(TPluginManager *mgr, char const *type, int altType=0)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual std::vector< std::string > const * sourceNativeProtocols() const =0
void setTempDir(const std::string &s, double minFreeSpace)
TFileAdaptor(edm::ParameterSet const &pset, edm::ActivityRegistry &ar)
void setCacheHint(CacheHint value)
char data[epos_bytes_allocation]
virtual double const * sourceCacheMinFree() const =0
virtual std::string const * sourceCacheHint() const =0
static std::string summaryText(bool banner=false)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
virtual std::string const * sourceReadHint() const =0
volatile std::atomic< bool > shutdown_flag false
void termination(void) const
static StorageFactory * getToModify(void)
void statsXML(std::map< std::string, std::string > &data) const