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();
207 descriptions.
add(
"AdaptorConfig", desc);
213 std::map<std::string, std::string>
data;
226 float const oneMeg = 1048576.0;
227 o <<
"Storage parameters: adaptor: true"
228 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n'
232 <<
"Storage statistics: "
234 <<
"; tfile/read=?/?/" << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms"
235 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
243 float const oneMeg = 1048576.0;
244 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
245 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
246 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
247 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
248 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
250 std::ostringstream
r;
251 std::ostringstream
w;
252 r << (TFile::GetFileBytesRead() / oneMeg);
253 w << (TFile::GetFileBytesWritten() / oneMeg);
254 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes", r.str()));
255 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes", w.str()));
274 boost::shared_ptr<TFileAdaptor>
me;
T getUntrackedParameter(std::string const &, T const &) const
bool enableAccounting(bool enabled)
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
boost::shared_ptr< TFileAdaptor > me
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