16 #include <TPluginManager.h>
48 mgr->AddHandler(
"TFile",
50 "TStorageFactoryFile",
52 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t)");
54 mgr->AddHandler(
"TSystem",
56 "TStorageFactorySystem",
58 "TStorageFactorySystem()");
59 }
else if (altType == 1) {
60 mgr->AddHandler(
"TFile",
62 "TStorageFactoryFile",
64 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t, Int_t, Bool_t)");
66 mgr->AddHandler(
"TSystem",
68 "TStorageFactorySystem",
70 "TStorageFactorySystem(const char *,Bool_t)");
84 enablePrefetching_(
false),
85 cacheHint_(
"auto-detect"),
86 readHint_(
"auto-detect"),
137 if ((
enablePrefetching_) && ((cacheHint_ ==
"storage-only") || (cacheHint_ ==
"auto-detect")))
138 cacheHint_ =
"application-only";
141 if (cacheHint_ ==
"application-only")
143 else if (cacheHint_ ==
"storage-only")
145 else if (cacheHint_ ==
"lazy-download")
147 else if (cacheHint_ ==
"auto-detect")
151 <<
"Unrecognised 'cacheHint' value '" << cacheHint_
152 <<
"', recognised values are 'application-only',"
153 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
155 if (readHint_ ==
"direct-unbuffered")
157 else if (readHint_ ==
"read-ahead-buffered")
159 else if (readHint_ ==
"auto-detect")
163 <<
"Unrecognised 'readHint' value '" << readHint_
164 <<
"', recognised values are 'direct-unbuffered',"
165 <<
" 'read-ahead-buffered', 'auto-detect'";
177 TPluginManager* mgr = gROOT->GetPluginManager();
180 mgr->LoadHandlersFromPluginDirs(
"TFile");
181 mgr->LoadHandlersFromPluginDirs(
"TSystem");
211 descriptions.
add(
"AdaptorConfig", desc);
217 std::map<std::string, std::string>
data;
230 float const oneMeg = 1048576.0;
231 o <<
"Storage parameters: adaptor: true"
232 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n'
236 <<
"Storage statistics: "
238 <<
"; tfile/read=?/?/" << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms"
239 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
247 float const oneMeg = 1048576.0;
248 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
249 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
250 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
251 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
252 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
254 std::ostringstream
r;
255 std::ostringstream
w;
256 r << (TFile::GetFileBytesRead() / oneMeg);
257 w << (TFile::GetFileBytesWritten() / oneMeg);
258 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes", r.str()));
259 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
static StorageFactory * get(void)
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)
#define DEFINE_FWK_SERVICE(type)
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
TFileAdaptor AdaptorConfig
void termination(void) const
void statsXML(std::map< std::string, std::string > &data) const