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,
98 std::ofstream meta_fd(tmp_meta_fp);
103 ::
rename(tmp_root_fp.c_str(), root_fp.c_str()));
105 ::
rename(tmp_meta_fp.c_str(), meta_fp.c_str()));
135 if (!f.
data.empty()) {
144 actual_msg += std::strerror(status);
154 unsigned char md5[MD5_DIGEST_LENGTH];
156 boost::iostreams::mapped_file_source fp(filename);
158 MD5((
unsigned char*)fp.data(), fp.size(), md5);
160 std::ostringstream
hash;
161 for (
int i = 0;
i < MD5_DIGEST_LENGTH; ++
i) {
162 hash << std::hex << std::setfill(
'0') << std::setw(2) << (
int)(md5[
i]);
165 std::ostringstream
out;
166 out <<
"md5:" << hash.str() <<
" " << fp.size() <<
" " << final_filename;
173 desc.
setComment(
"Saves histograms from DQM store, online workflow.");
177 "How often the backup file will be generated, in lumisections (-1 " 182 "Usually the backup old backup is deleted once the new file is " 183 "available. Setting this to true ensures that no backup files are " 184 "ever deleted. Useful for ML applications, which use backups as a " 185 "'history' of what happened during the run.");
T getUntrackedParameter(std::string const &, T const &) const
static const std::string fillOrigin(const std::string filename, const std::string final_filename)
void saveJobReport(const std::string &filename) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
#define DEFINE_FWK_MODULE(type)
void saveRun(const FileParameters &fp) const override
static const std::string filename(const FileParameters &fp, bool useLumi=false)
void setComment(std::string const &value)
void addDefault(ParameterSetDescription const &psetDescription)
~DQMFileSaverOnline() override
void appendSnapshot(SnapshotFiles new_snap) const
void checkError(const char *msg, const std::string file, int status) 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)