17 #include <sys/types.h> 25 #include <openssl/md5.h> 26 #include <boost/filesystem.hpp> 27 #include <boost/iostreams/device/mapped_file.hpp> 56 gethostname(hostname, 64);
61 snprintf(suffix, 127,
".ls%08ld_host%s_pid%08d", fp.
lumi_, hostname, pid);
81 snprintf(rewrite, 128,
"\\1Run %ld/\\2/Run summary", fp.
run_);
83 store->save(tmp_root_fp,
85 "^(Reference/)?([^/]+)",
87 store->mtEnabled() ? fp.
run_ : 0,
96 std::ofstream meta_fd(tmp_meta_fp);
101 ::
rename(tmp_root_fp.c_str(), root_fp.c_str()));
103 ::
rename(tmp_meta_fp.c_str(), meta_fp.c_str()));
133 if (!f.
data.empty()) {
142 actual_msg += std::strerror(status);
152 unsigned char md5[MD5_DIGEST_LENGTH];
154 boost::iostreams::mapped_file_source fp(filename);
156 MD5((
unsigned char*)fp.data(), fp.size(), md5);
158 std::ostringstream
hash;
159 for (
unsigned char &
i : md5) {
160 hash << std::hex << std::setfill(
'0') << std::setw(2) << (
int)
i;
163 std::ostringstream
out;
164 out <<
"md5:" << hash.str() <<
" " << fp.size() <<
" " << final_filename;
171 desc.
setComment(
"Saves histograms from DQM store, online workflow.");
175 "How often the backup file will be generated, in lumisections (-1 " 180 "Usually the backup old backup is deleted once the new file is " 181 "available. Setting this to true ensures that no backup files are " 182 "ever deleted. Useful for ML applications, which use backups as a " 183 "'history' of what happened during the run.");
T getUntrackedParameter(std::string const &, T const &) const
void saveJobReport(const std::string &filename) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static const std::string fillOrigin(const std::string &filename, const std::string &final_filename)
void saveRun(const FileParameters &fp) const override
static const std::string filename(const FileParameters &fp, bool useLumi=false)
void checkError(const char *msg, const std::string &file, int status) const
void setComment(std::string const &value)
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
~DQMFileSaverOnline() override
void appendSnapshot(SnapshotFiles new_snap) const
void logFileAction(const std::string &msg, const std::string &fileName) const
void makeSnapshot(const FileParameters &fp, bool final) const
std::list< SnapshotFiles > snapshots_
std::mutex snapshots_lock_
DQMStore::SaveReferenceTag saveReference_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescription(edm::ParameterSetDescription &d)
void saveLumi(const FileParameters &fp) const override
DQMFileSaverOnline(const edm::ParameterSet &ps)