|
|
Go to the documentation of this file.
17 #include <sys/types.h>
25 #include <openssl/md5.h>
26 #include <boost/filesystem.hpp>
27 #include <boost/iostreams/device/mapped_file.hpp>
52 gethostname(hostname, 64);
57 snprintf(
suffix, 127,
".ls%08ld_host%s_pid%08d",
fp.lumi_, hostname, pid);
91 h.save(tmp_root_fp,
"",
fp.run_,
true,
"RECREATE");
96 std::ofstream meta_fd(tmp_meta_fp);
100 checkError(
"Rename failed: ", root_fp, ::
rename(tmp_root_fp.c_str(), root_fp.c_str()));
101 checkError(
"Rename failed: ", meta_fp, ::
rename(tmp_meta_fp.c_str(), meta_fp.c_str()));
122 checkError(
"Unlink failed: ", x.meta, ::unlink(x.meta.c_str()));
125 checkError(
"Unlink failed: ", x.data, ::unlink(x.data.c_str()));
131 if (!
f.data.empty()) {
139 actual_msg += std::strerror(
status);
148 unsigned char md5[MD5_DIGEST_LENGTH];
150 boost::iostreams::mapped_file_source
fp(
filename);
152 MD5((
unsigned char*)
fp.data(),
fp.size(), md5);
154 std::ostringstream
hash;
155 for (
unsigned char&
i : md5) {
156 hash << std::hex << std::setfill(
'0') << std::setw(2) << (
int)
i;
159 std::ostringstream
out;
160 out <<
"md5:" <<
hash.str() <<
" " <<
fp.size() <<
" " << final_filename;
166 desc.
setComment(
"Saves histograms from DQM store, online workflow.");
170 "How often the backup file will be generated, in lumisections (-1 "
175 "Usually the backup old backup is deleted once the new file is "
176 "available. Setting this to true ensures that no backup files are "
177 "ever deleted. Useful for ML applications, which use backups as a "
178 "'history' of what happened during the run.");
static const std::string fillOrigin(const std::string &filename, const std::string &final_filename)
void logFileAction(const std::string &msg, const std::string &fileName) const
static const std::string filename(const FileParameters &fp, bool useLumi=false)
~DQMFileSaverOnline() override
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void makeSnapshot(const FileParameters &fp, bool final) const
T getUntrackedParameter(std::string const &, T const &) const
void checkError(const char *msg, const std::string &file, int status) const
void appendSnapshot(SnapshotFiles new_snap) const
void saveRun(const FileParameters &fp) const override
std::list< SnapshotFiles > snapshots_
#define DEFINE_FWK_MODULE(type)
void saveLumi(const FileParameters &fp) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void saveJobReport(const std::string &filename) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
DQMFileSaverOnline(const edm::ParameterSet &ps)
std::mutex snapshots_lock_
static void fillDescription(edm::ParameterSetDescription &d)
void addDefault(ParameterSetDescription const &psetDescription)