CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
evf::EvFDaqDirector Class Reference

#include <EvFDaqDirector.h>

Public Types

enum  FileStatus {
  noFile, sameFile, newFile, newLumi,
  runEnded, runAbort
}
 

Public Member Functions

std::string & baseRunDir ()
 
std::string & buBaseRunDir ()
 
std::string & buBaseRunOpenDir ()
 
void checkTransferSystemPSet ()
 
void createProcessingNotificationMaybe () const
 
void createRunOpendirMaybe ()
 
bool emptyLumisectionMode () const
 
 EvFDaqDirector (const edm::ParameterSet &pset, edm::ActivityRegistry &reg)
 
std::string findCurrentRunDir ()
 
std::string getBoLSFilePathOnFU (const unsigned int ls) const
 
std::string getEoLSFilePathOnBU (const unsigned int ls) const
 
std::string getEoLSFilePathOnFU (const unsigned int ls) const
 
std::string getEoRFilePath () const
 
std::string getEoRFilePathOnFU () const
 
std::string getInitFilePath (std::string const &stream) const
 
std::string getInputJsonFilePath (const unsigned int ls, const unsigned int index) const
 
std::string getMergedDatChecksumFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getMergedDatFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getMergedProtocolBufferHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getMergedRootHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getOpenDatFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getOpenInitFilePath (std::string const &stream) const
 
std::string getOpenInputJsonFilePath (const unsigned int ls, const unsigned int index) const
 
std::string getOpenOutputJsonFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getOpenProtocolBufferHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getOpenRawFilePath (const unsigned int ls, const unsigned int index) const
 
std::string getOpenRootHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getOutputJsonFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getProtocolBufferHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
std::string getRawFilePath (const unsigned int ls, const unsigned int index) const
 
std::string getRootHistogramFilePath (const unsigned int ls, std::string const &stream) const
 
unsigned int getRunNumber () const
 
std::string getRunOpenDirPath () const
 
std::string getStreamDestinations (std::string const &stream) const
 
std::vector< int > * getStreamFileTracker ()
 
bool isSingleStreamThread ()
 
void lockFULocal ()
 
void lockFULocal2 ()
 
void lockInitLock ()
 
FILE * maybeCreateAndLockFileHeadForStream (unsigned int ls, std::string &stream)
 
bool outputAdler32Recheck () const
 
void postEndRun (edm::GlobalContext const &globalContext)
 
void preallocate (edm::service::SystemBounds const &bounds)
 
void preBeginRun (edm::GlobalContext const &globalContext)
 
void preGlobalEndLumi (edm::GlobalContext const &globalContext)
 
void preSourceEvent (edm::StreamID const &streamID)
 
int readLastLSEntry (std::string const &file)
 
void removeFile (unsigned int ls, unsigned int index)
 
void removeFile (std::string)
 
void setDeleteTracking (std::mutex *fileDeleteLock, std::list< std::pair< int, InputFile * >> *filesToDelete)
 
void setFMS (evf::FastMonitoringService *fms)
 
void tryInitializeFuLockFile ()
 
void unlockAndCloseMergeStream ()
 
void unlockFULocal ()
 
void unlockFULocal2 ()
 
void unlockInitLock ()
 
void updateFileIndex (int const &fileIndex)
 
FileStatus updateFuLock (unsigned int &ls, std::string &nextFile, uint32_t &fsize, uint64_t &lockWaitTime)
 
 ~EvFDaqDirector ()
 

Private Member Functions

bool bumpFile (unsigned int &ls, unsigned int &index, std::string &nextFile, uint32_t &fsize, int maxLS)
 
std::string eolsFileName (const unsigned int ls) const
 
std::string eorFileName () const
 
int getNFilesFromEoLS (std::string BUEoLSFile)
 
std::string initFileName (std::string const &stream) const
 
std::string inputFileNameStem (const unsigned int ls, const unsigned int index) const
 
std::string mergedFileNameStem (const unsigned int ls, std::string const &stream) const
 
void openFULockfileStream (std::string &fuLockFilePath, bool create)
 
std::string outputFileNameStem (const unsigned int ls, std::string const &stream) const
 

Private Attributes

std::string base_dir_
 
std::string bu_base_dir_
 
struct flock bu_r_flk
 
struct flock bu_r_fulk
 
FILE * bu_r_lock_stream
 
int bu_readlock_fd_
 
std::string bu_run_dir_
 
std::string bu_run_open_dir_
 
FILE * bu_t_monitor_stream
 
struct flock bu_w_flk
 
struct flock bu_w_fulk
 
FILE * bu_w_lock_stream
 
FILE * bu_w_monitor_stream
 
int bu_writelock_fd_
 
int currentFileIndex_ = -1
 
int data_readwrite_fd_
 
struct flock data_rw_flk
 
struct flock data_rw_fulk
 
FILE * data_rw_stream
 
bool directorBu_
 
DirManager dirManager_
 
bool emptyLumisectionMode_
 
unsigned int eolsNFilesIndex_ = 1
 
std::mutexfileDeleteLockPtr_ = nullptr
 
std::list< std::pair< int,
InputFile * > > * 
filesToDeletePtr_ = nullptr
 
evf::FastMonitoringServicefms_ = nullptr
 
int fu_readwritelock_fd_
 
struct flock fu_rw_flk
 
struct flock fu_rw_fulk
 
FILE * fu_rw_lock_stream
 
int fulocal_rwlock_fd2_
 
int fulocal_rwlock_fd_
 
unsigned int fuLockPollInterval_
 
std::string hltSourceDirectory_
 
std::string hostname_
 
pthread_mutex_t init_lock_ = PTHREAD_MUTEX_INITIALIZER
 
unsigned int nStreams_ =0
 
unsigned int nThreads_ =0
 
bool outputAdler32Recheck_
 
unsigned long previousFileSize_
 
bool readEolsDefinition_ = true
 
bool requireTSPSet_
 
unsigned int run_
 
std::string run_dir_
 
std::string run_string_
 
std::string selectedTransferMode_
 
std::string stopFilePath_
 
std::vector< int > streamFileTracker_
 
std::shared_ptr< Json::ValuetransferSystemJson_
 

Detailed Description

Definition at line 42 of file EvFDaqDirector.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

evf::EvFDaqDirector::EvFDaqDirector ( const edm::ParameterSet pset,
edm::ActivityRegistry reg 
)
explicit

Definition at line 39 of file EvFDaqDirector.cc.

References base_dir_, bu_base_dir_, bu_run_dir_, bu_run_open_dir_, bu_w_lock_stream, bu_writelock_fd_, eostools::chmod(), roll_playback::copy_file, createRunOpendirMaybe(), directorBu_, emptyLumisectionMode_, edm::hlt::Exception, fu_readwritelock_fd_, fu_rw_lock_stream, fulocal_rwlock_fd2_, fulocal_rwlock_fd_, fuLockPollInterval_, getRunOpenDirPath(), hltSourceDirectory_, hostname_, init_lock_, eostools::mkdir(), NULL, openFULockfileStream(), postEndRun(), preallocate(), preBeginRun(), preGlobalEndLumi(), preSourceEvent(), run_, run_dir_, run_string_, contentValuesCheck::ss, stopFilePath_, AlCaHLTBitMon_QueryRunRegistry::string, tryInitializeFuLockFile(), edm::ActivityRegistry::watchPostGlobalEndRun(), edm::ActivityRegistry::watchPreallocate(), edm::ActivityRegistry::watchPreGlobalBeginRun(), edm::ActivityRegistry::watchPreGlobalEndLumi(), and edm::ActivityRegistry::watchPreSourceEvent().

40  :
41  base_dir_(
42  pset.getUntrackedParameter<std::string> ("baseDir", "/data")
43  ),
45  pset.getUntrackedParameter<std::string> ("buBaseDir", "/data")
46  ),
48  pset.getUntrackedParameter<bool> ("directorIsBu", false)
49  ),
50  run_(pset.getUntrackedParameter<unsigned int> ("runNumber",0)),
51  outputAdler32Recheck_(pset.getUntrackedParameter<bool>("outputAdler32Recheck",false)),
52  requireTSPSet_(pset.getUntrackedParameter<bool>("requireTransfersPSet",false)),
53  selectedTransferMode_(pset.getUntrackedParameter<std::string>("selectedTransferMode","")),
54  hltSourceDirectory_(pset.getUntrackedParameter<std::string>("hltSourceDirectory","")),
55  fuLockPollInterval_(pset.getUntrackedParameter<unsigned int>("fuLockPollInterval",2000)),
56  emptyLumisectionMode_(pset.getUntrackedParameter<bool>("emptyLumisectionMode",false)),
57  hostname_(""),
58  bu_readlock_fd_(-1),
59  bu_writelock_fd_(-1),
64 
68  //bu_w_monitor_stream(0),
69  //bu_t_monitor_stream(0),
70  data_rw_stream(0),
71 
73 
75 
76  bu_w_flk( make_flock( F_WRLCK, SEEK_SET, 0, 0, 0 )),
77  bu_r_flk( make_flock( F_RDLCK, SEEK_SET, 0, 0, 0 )),
78  bu_w_fulk( make_flock( F_UNLCK, SEEK_SET, 0, 0, 0 )),
79  bu_r_fulk( make_flock( F_UNLCK, SEEK_SET, 0, 0, 0 )),
80  fu_rw_flk( make_flock ( F_WRLCK, SEEK_SET, 0, 0, getpid() )),
81  fu_rw_fulk( make_flock( F_UNLCK, SEEK_SET, 0, 0, getpid() )),
82  data_rw_flk( make_flock ( F_WRLCK, SEEK_SET, 0, 0, getpid() )),
83  data_rw_fulk( make_flock( F_UNLCK, SEEK_SET, 0, 0, getpid() ))
84  //fulocal_rw_flk( make_flock( F_WRLCK, SEEK_SET, 0, 0, getpid() )),
85  //fulocal_rw_fulk( make_flock( F_UNLCK, SEEK_SET, 0, 0, getpid() )),
86  //fulocal_rw_flk2( make_flock( F_WRLCK, SEEK_SET, 0, 0, getpid() )),
87  //fulocal_rw_fulk2( make_flock( F_UNLCK, SEEK_SET, 0, 0, getpid() ))
88  {
89 
95 
96  std::stringstream ss;
97  ss << "run" << std::setfill('0') << std::setw(6) << run_;
98  run_string_ = ss.str();
100 
101  //save hostname for later
102  char hostname[33];
103  gethostname(hostname,32);
104  hostname_ = hostname;
105 
106  char * fuLockPollIntervalPtr = getenv("FFF_LOCKPOLLINTERVAL");
107  if (fuLockPollIntervalPtr) {
108  try {
109  fuLockPollInterval_=boost::lexical_cast<unsigned int>(std::string(fuLockPollIntervalPtr));
110  edm::LogInfo("Setting fu lock poll interval by environment string: ") << fuLockPollInterval_ << " us";
111  }
112  catch (...) {edm::LogWarning("Unable to parse environment string: ") << std::string(fuLockPollIntervalPtr);}
113  }
114 
115  char * emptyLumiModePtr = getenv("FFF_EMPTYLSMODE");
116  if (emptyLumiModePtr) {
117  emptyLumisectionMode_ = true;
118  edm::LogInfo("Setting empty lumisection mode");
119  }
120 
121  // check if base dir exists or create it accordingly
122  int retval = mkdir(base_dir_.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
123  if (retval != 0 && errno != EEXIST) {
124  throw cms::Exception("DaqDirector") << " Error checking for base dir -: "
125  << base_dir_ << " mkdir error:" << strerror(errno);
126  }
127 
128  //create run dir in base dir
129  umask(0);
130  retval = mkdir(run_dir_.c_str(),
131  S_IRWXU | S_IRWXG | S_IROTH | S_IRWXO | S_IXOTH);
132  if (retval != 0 && errno != EEXIST) {
133  throw cms::Exception("DaqDirector") << " Error creating run dir -: "
134  << run_dir_ << " mkdir error:" << strerror(errno);
135  }
136 
137  //create fu-local.lock in run open dir
138  if (!directorBu_) {
139 
141  std::string fulocal_lock_ = getRunOpenDirPath() +"/fu-local.lock";
142  fulocal_rwlock_fd_ = open(fulocal_lock_.c_str(), O_RDWR | O_CREAT, S_IRWXU | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH);//O_RDWR?
143  if (fulocal_rwlock_fd_==-1)
144  throw cms::Exception("DaqDirector") << " Error creating/opening a local lock file -: " << fulocal_lock_.c_str() << " : " << strerror(errno);
145  chmod(fulocal_lock_.c_str(),0777);
146  fsync(fulocal_rwlock_fd_);
147  //open second fd for another input source thread
148  fulocal_rwlock_fd2_ = open(fulocal_lock_.c_str(), O_RDWR, S_IRWXU | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH);//O_RDWR?
149  if (fulocal_rwlock_fd2_==-1)
150  throw cms::Exception("DaqDirector") << " Error opening a local lock file -: " << fulocal_lock_.c_str() << " : " << strerror(errno);
151  }
152 
153  //bu_run_dir: for FU, for which the base dir is local and the BU is remote, it is expected to be there
154  //for BU, it is created at this point
155  if (directorBu_)
156  {
158  std::string bulockfile = bu_run_dir_ + "/bu.lock";
159  std::string fulockfile = bu_run_dir_ + "/fu.lock";
160 
161  //make or find bu run dir
162  retval = mkdir(bu_run_dir_.c_str(),
163  S_IRWXU | S_IRWXG | S_IRWXO);
164  if (retval != 0 && errno != EEXIST) {
165  throw cms::Exception("DaqDirector")
166  << " Error creating bu run dir -: " << bu_run_dir_
167  << " mkdir error:" << strerror(errno) << "\n";
168  }
169  bu_run_open_dir_ = bu_run_dir_ + "/open";
170  retval = mkdir(bu_run_open_dir_.c_str(),
171  S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
172  if (retval != 0 && errno != EEXIST) {
173  throw cms::Exception("DaqDirector") << " Error creating bu run open dir -: "
174  << bu_run_open_dir_ << " mkdir error:" << strerror(errno)
175  << "\n";
176  }
177 
178  // the BU director does not need to know about the fu lock
179  bu_writelock_fd_ = open(bulockfile.c_str(),
180  O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
181  if (bu_writelock_fd_ == -1)
182  edm::LogWarning("EvFDaqDirector") << "problem with creating filedesc for buwritelock -: "
183  << strerror(errno);
184  else
185  edm::LogInfo("EvFDaqDirector") << "creating filedesc for buwritelock -: "
186  << bu_writelock_fd_;
187  bu_w_lock_stream = fdopen(bu_writelock_fd_, "w");
188  if (bu_w_lock_stream == 0)
189  edm::LogWarning("EvFDaqDirector")<< "Error creating write lock stream -: " << strerror(errno);
190 
191  // BU INITIALIZES LOCK FILE
192  // FU LOCK FILE OPEN
193  openFULockfileStream(fulockfile, true);
195  fflush(fu_rw_lock_stream);
196  close(fu_readwritelock_fd_);
197 
198  if (hltSourceDirectory_.size())
199  {
200  struct stat buf;
201  if (stat(hltSourceDirectory_.c_str(),&buf)==0) {
202  std::string hltdir=bu_run_dir_+"/hlt";
203  std::string tmphltdir=bu_run_open_dir_+"/hlt";
204  retval = mkdir(tmphltdir.c_str(),S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
205 
206  boost::filesystem::copy_file(hltSourceDirectory_+"/HltConfig.py",tmphltdir+"/HltConfig.py");
207  try {
208  boost::filesystem::copy_file(hltSourceDirectory_+"/CMSSW_VERSION",tmphltdir+"/CMSSW_VERSION");
209  boost::filesystem::copy_file(hltSourceDirectory_+"/SCRAM_ARCH",tmphltdir+"/SCRAM_ARCH");
210  } catch (...) {}
211 
212  boost::filesystem::copy_file(hltSourceDirectory_+"/fffParameters.jsn",tmphltdir+"/fffParameters.jsn");
213 
214  boost::filesystem::rename(tmphltdir,hltdir);
215  }
216  else
217  throw cms::Exception("DaqDirector") << " Error looking for HLT configuration -: " << hltSourceDirectory_;
218  }
219  //else{}//no configuration specified
220  }
221  else
222  {
223  // for FU, check if bu base dir exists
224 
225  retval = mkdir(bu_base_dir_.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
226  if (retval != 0 && errno != EEXIST) {
227  throw cms::Exception("DaqDirector") << " Error checking for bu base dir -: "
228  << bu_base_dir_ << " mkdir error:" << strerror(errno) << "\n";
229  }
230 
232  std::string fulockfile = bu_run_dir_ + "/fu.lock";
233  openFULockfileStream(fulockfile, false);
234  }
235 
236  pthread_mutex_init(&init_lock_,NULL);
237 
238  stopFilePath_ = run_dir_+"/CMSSW_STOP";
239  }
struct flock bu_w_fulk
T getUntrackedParameter(std::string const &, T const &) const
struct flock fu_rw_flk
std::string run_string_
void watchPreallocate(Preallocate::slot_type const &iSlot)
void openFULockfileStream(std::string &fuLockFilePath, bool create)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
pthread_mutex_t init_lock_
struct flock bu_r_fulk
#define NULL
Definition: scimark2.h:8
struct flock data_rw_flk
unsigned long previousFileSize_
def chmod
Definition: eostools.py:291
struct flock fu_rw_fulk
std::string hltSourceDirectory_
std::string stopFilePath_
std::string bu_base_dir_
std::string selectedTransferMode_
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
struct flock bu_w_flk
void preBeginRun(edm::GlobalContext const &globalContext)
void preSourceEvent(edm::StreamID const &streamID)
void preGlobalEndLumi(edm::GlobalContext const &globalContext)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
std::string bu_run_dir_
def mkdir
Definition: eostools.py:248
void postEndRun(edm::GlobalContext const &globalContext)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
void preallocate(edm::service::SystemBounds const &bounds)
struct flock data_rw_fulk
std::string getRunOpenDirPath() const
unsigned int fuLockPollInterval_
struct flock bu_r_flk
std::string bu_run_open_dir_
evf::EvFDaqDirector::~EvFDaqDirector ( )

Definition at line 241 of file EvFDaqDirector.cc.

References fulocal_rwlock_fd2_, fulocal_rwlock_fd_, unlockFULocal(), and unlockFULocal2().

242  {
243  if (fulocal_rwlock_fd_!=-1) {
244  unlockFULocal();
245  close(fulocal_rwlock_fd_);
246  }
247 
248  if (fulocal_rwlock_fd2_!=-1) {
249  unlockFULocal2();
250  close(fulocal_rwlock_fd2_);
251  }
252 
253  }

Member Function Documentation

std::string& evf::EvFDaqDirector::baseRunDir ( )
inline

Definition at line 56 of file EvFDaqDirector.h.

References run_dir_.

56 {return run_dir_;}
std::string& evf::EvFDaqDirector::buBaseRunDir ( )
inline

Definition at line 57 of file EvFDaqDirector.h.

References bu_run_dir_.

57 {return bu_run_dir_;}
std::string bu_run_dir_
std::string& evf::EvFDaqDirector::buBaseRunOpenDir ( )
inline

Definition at line 58 of file EvFDaqDirector.h.

References bu_run_open_dir_.

58 {return bu_run_open_dir_;}
std::string bu_run_open_dir_
bool evf::EvFDaqDirector::bumpFile ( unsigned int &  ls,
unsigned int &  index,
std::string &  nextFile,
uint32_t &  fsize,
int  maxLS 
)
private

Definition at line 666 of file EvFDaqDirector.cc.

References evf::FastMonitoringService::accumulateFileSize(), fms_, getEoLSFilePathOnBU(), getInputJsonFilePath(), getNFilesFromEoLS(), cmsHarvester::index, eostools::ls(), previousFileSize_, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by updateFuLock().

666  {
667 
668  if (previousFileSize_ != 0) {
669  if (!fms_) {
670  try {
672  } catch (...) {
673  edm::LogError("EvFDaqDirector") <<" FastMonitoringService not found";
674  }
675  }
677  previousFileSize_ = 0;
678  }
679 
680  //reached limit
681  if (maxLS>=0 && ls > (unsigned int)maxLS) return false;
682 
683  struct stat buf;
684  std::stringstream ss;
685  unsigned int nextIndex = index;
686  nextIndex++;
687 
688  // 1. Check suggested file
689  nextFile = getInputJsonFilePath(ls,index);
690  if (stat(nextFile.c_str(), &buf) == 0) {
691 
692  previousFileSize_ = buf.st_size;
693  fsize = buf.st_size;
694  return true;
695  }
696  // 2. No file -> lumi ended? (and how many?)
697  else {
698  std::string BUEoLSFile = getEoLSFilePathOnBU(ls);
699  bool eolFound = (stat(BUEoLSFile.c_str(), &buf) == 0);
700  while (eolFound) {
701 
702  // recheck that no raw file appeared in the meantime
703  if (stat(nextFile.c_str(), &buf) == 0) {
704  previousFileSize_ = buf.st_size;
705  fsize = buf.st_size;
706  return true;
707  }
708 
709  int indexFilesInLS = getNFilesFromEoLS(BUEoLSFile);
710  if (indexFilesInLS < 0)
711  //parsing failed
712  return false;
713  else {
714  //check index
715  if ((int)index<indexFilesInLS) {
716  //we have 2 files, and check for 1 failed... retry (2 will never be here)
717  edm::LogError("EvFDaqDirector") << "Potential miss of index file in LS -: " << ls << ". Missing "
718  << nextFile << " because " << indexFilesInLS-1 << " is the highest index expected. Will not update fu.lock file";
719  return false;
720  }
721  }
722  // this lumi ended, check for files
723  ++ls;
724  index = 0;
725 
726  //reached limit
727  if (maxLS>=0 && ls > (unsigned int)maxLS) return false;
728 
729  nextFile = getInputJsonFilePath(ls,0);
730  if (stat(nextFile.c_str(), &buf) == 0) {
731  // a new file was found at new lumisection, index 0
732  previousFileSize_ = buf.st_size;
733  fsize = buf.st_size;
734  return true;
735  }
736  else {
737  //change of policy: we need to cycle through each LS
738  return false;
739  }
740  BUEoLSFile = getEoLSFilePathOnBU(ls);
741  eolFound = (stat(BUEoLSFile.c_str(), &buf) == 0);
742  }
743  }
744  // no new file found
745  return false;
746  }
void accumulateFileSize(unsigned int lumi, unsigned long fileSize)
def ls
Definition: eostools.py:346
std::string getEoLSFilePathOnBU(const unsigned int ls) const
unsigned long previousFileSize_
int getNFilesFromEoLS(std::string BUEoLSFile)
evf::FastMonitoringService * fms_
std::string getInputJsonFilePath(const unsigned int ls, const unsigned int index) const
void evf::EvFDaqDirector::checkTransferSystemPSet ( )

Definition at line 856 of file EvFDaqDirector.cc.

References Json::Value::append(), Json::arrayValue, alignCSCRings::dest, gather_cfg::destinations, edm::hlt::Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getParameterSet(), edm::getProcessParameterSet(), alignBH_cfg::mode, edm::ParameterSet::psetTable(), requireTSPSet_, and transferSystemJson_.

Referenced by preallocate().

857  {
858  transferSystemJson_.reset(new Json::Value);
859  if (edm::getProcessParameterSet().existsAs<edm::ParameterSet>("transferSystem",true))
860  {
861  const edm::ParameterSet& tsPset(edm::getProcessParameterSet().getParameterSet("transferSystem"));
862 
863  Json::Value destinationsVal(Json::arrayValue);
864  std::vector<std::string> destinations = tsPset.getParameter<std::vector<std::string>>("destinations");
865  for (auto & dest: destinations) destinationsVal.append(dest);
866  (*transferSystemJson_)["destinations"]=destinationsVal;
867 
868  Json::Value modesVal(Json::arrayValue);
869  std::vector<std::string> modes = tsPset.getParameter< std::vector<std::string> >("transferModes");
870  for (auto & mode: modes) modesVal.append(mode);
871  (*transferSystemJson_)["transferModes"]=modesVal;
872 
873  for (auto psKeyItr =tsPset.psetTable().begin();psKeyItr!=tsPset.psetTable().end(); ++ psKeyItr) {
874  if (psKeyItr->first!="destinations" && psKeyItr->first!="transferModes") {
875  const edm::ParameterSet & streamDef = tsPset.getParameterSet(psKeyItr->first);
876  Json::Value streamVal;
877  for (auto & mode : modes) {
878  //validation
879  if (!streamDef.existsAs<std::vector<std::string>>(mode,true))
880  throw cms::Exception("EvFDaqDirector") << " Missing transfer system specification for -:" << psKeyItr->first << " (transferMode " << mode << ")";
881  std::vector<std::string> streamDestinations = streamDef.getParameter<std::vector<std::string>>(mode);
882 
883  Json::Value sDestsValue(Json::arrayValue);
884 
885  if (!streamDestinations.size())
886  throw cms::Exception("EvFDaqDirector") << " Missing transter system destination(s) for -: "<< psKeyItr->first << ", mode:" << mode;
887 
888  for (auto & sdest:streamDestinations) {
889  bool sDestValid=false;
890  sDestsValue.append(sdest);
891  for (auto & dest: destinations) {
892  if (dest==sdest) sDestValid=true;
893  }
894  if (!sDestValid)
895  throw cms::Exception("EvFDaqDirector") << " Invalid transter system destination specified for -: "<< psKeyItr->first << ", mode:" << mode << ", dest:"<<sdest;
896  }
897  streamVal[mode]=sDestsValue;
898  }
899  (*transferSystemJson_)[psKeyItr->first] = streamVal;
900  }
901  }
902  }
903  else {
904  if (requireTSPSet_)
905  throw cms::Exception("EvFDaqDirector") << "transferSystem PSet not found";
906  }
907  }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
std::shared_ptr< Json::Value > transferSystemJson_
ParameterSet const & getParameterSet(ParameterSetID const &id)
Represents a JSON value.
Definition: value.h:111
ParameterSet const & getProcessParameterSet()
Definition: Registry.cc:85
ParameterSet const & getParameterSet(std::string const &) const
tuple destinations
Definition: gather_cfg.py:120
array value (ordered list)
Definition: value.h:31
void evf::EvFDaqDirector::createProcessingNotificationMaybe ( ) const

Definition at line 956 of file EvFDaqDirector.cc.

References run_dir_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FedRawDataInputSource::checkNextEvent().

956  {
957  std::string proc_flag = run_dir_ + "/processing";
958  int proc_flag_fd = open(proc_flag.c_str(), O_RDWR | O_CREAT, S_IRWXU | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH);
959  close(proc_flag_fd);
960  }
void evf::EvFDaqDirector::createRunOpendirMaybe ( )

Definition at line 828 of file EvFDaqDirector.cc.

References getRunOpenDirPath(), LogDebug, and cmsHarvester::path.

Referenced by EvFDaqDirector().

828  {
829  // create open dir if not already there
830 
832  if (!boost::filesystem::is_directory(openPath)) {
833  LogDebug("EvFDaqDirector") << "<open> FU dir not found. Creating... -:" << openPath.string();
834  boost::filesystem::create_directories(openPath);
835  }
836  }
#define LogDebug(id)
tuple path
else: Piece not in the list, fine.
std::string getRunOpenDirPath() const
bool evf::EvFDaqDirector::emptyLumisectionMode ( ) const
inline

Definition at line 112 of file EvFDaqDirector.h.

References emptyLumisectionMode_.

Referenced by FedRawDataInputSource::checkNextEvent().

112 {return emptyLumisectionMode_;}
std::string evf::EvFDaqDirector::eolsFileName ( const unsigned int  ls) const
private
std::string evf::EvFDaqDirector::eorFileName ( ) const
private
std::string evf::EvFDaqDirector::findCurrentRunDir ( )
inline

Definition at line 60 of file EvFDaqDirector.h.

References dirManager_, evf::DirManager::findRunDir(), and run_.

60 { return dirManager_.findRunDir(run_);}
std::string findRunDir(unsigned int)
Definition: DirManager.cc:37
std::string evf::EvFDaqDirector::getBoLSFilePathOnFU ( const unsigned int  ls) const

Definition at line 413 of file EvFDaqDirector.cc.

References fffnaming::bolsFileName(), run_, and run_dir_.

Referenced by FedRawDataInputSource::createBoLSFile().

413  {
414  return run_dir_ + "/" + fffnaming::bolsFileName(run_,ls);
415  }
std::string bolsFileName(const unsigned int run, const unsigned int ls)
def ls
Definition: eostools.py:346
std::string evf::EvFDaqDirector::getEoLSFilePathOnBU ( const unsigned int  ls) const

Definition at line 405 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::eolsFileName(), and run_.

Referenced by bumpFile(), and FedRawDataInputSource::checkNextEvent().

405  {
406  return bu_run_dir_ + "/" + fffnaming::eolsFileName(run_,ls);
407  }
def ls
Definition: eostools.py:346
std::string bu_run_dir_
std::string eolsFileName(const unsigned int run, const unsigned int ls)
std::string evf::EvFDaqDirector::getEoLSFilePathOnFU ( const unsigned int  ls) const

Definition at line 409 of file EvFDaqDirector.cc.

References fffnaming::eolsFileName(), run_, and run_dir_.

Referenced by FedRawDataInputSource::checkNextEvent(), FedRawDataInputSource::maybeOpenNewLumiSection(), and updateFuLock().

409  {
410  return run_dir_ + "/" + fffnaming::eolsFileName(run_,ls);
411  }
def ls
Definition: eostools.py:346
std::string eolsFileName(const unsigned int run, const unsigned int ls)
std::string evf::EvFDaqDirector::getEoRFilePath ( ) const

Definition at line 417 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::eorFileName(), and run_.

Referenced by updateFuLock().

417  {
418  return bu_run_dir_ + "/" + fffnaming::eorFileName(run_);
419  }
std::string eorFileName(const unsigned int run)
std::string bu_run_dir_
std::string evf::EvFDaqDirector::getEoRFilePathOnFU ( ) const

Definition at line 422 of file EvFDaqDirector.cc.

References fffnaming::eorFileName(), run_, and run_dir_.

Referenced by FedRawDataInputSource::checkNextEvent().

422  {
423  return run_dir_ + "/" + fffnaming::eorFileName(run_);
424  }
std::string eorFileName(const unsigned int run)
std::string evf::EvFDaqDirector::getInitFilePath ( std::string const &  stream) const

Definition at line 377 of file EvFDaqDirector.cc.

References fffnaming::initFileNameWithPid(), run_, and run_dir_.

Referenced by DQMFileSaver::globalBeginRun().

377  {
379  }
std::string initFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getInputJsonFilePath ( const unsigned int  ls,
const unsigned int  index 
) const

Definition at line 336 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::inputJsonFileName(), and run_.

Referenced by bumpFile().

336  {
338  }
def ls
Definition: eostools.py:346
std::string inputJsonFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
std::string bu_run_dir_
std::string evf::EvFDaqDirector::getMergedDatChecksumFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 369 of file EvFDaqDirector.cc.

References hostname_, run_, run_dir_, and fffnaming::streamerDataChecksumFileNameWithInstance().

369  {
371  }
std::string streamerDataChecksumFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
def ls
Definition: eostools.py:346
std::string evf::EvFDaqDirector::getMergedDatFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 365 of file EvFDaqDirector.cc.

References hostname_, run_, run_dir_, and fffnaming::streamerDataFileNameWithInstance().

Referenced by maybeCreateAndLockFileHeadForStream().

365  {
367  }
def ls
Definition: eostools.py:346
std::string streamerDataFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
std::string evf::EvFDaqDirector::getMergedProtocolBufferHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 389 of file EvFDaqDirector.cc.

References hostname_, fffnaming::protocolBufferHistogramFileNameWithInstance(), run_, and run_dir_.

389  {
391  }
std::string protocolBufferHistogramFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
def ls
Definition: eostools.py:346
std::string evf::EvFDaqDirector::getMergedRootHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 401 of file EvFDaqDirector.cc.

References hostname_, fffnaming::rootHistogramFileNameWithInstance(), run_, and run_dir_.

401  {
403  }
def ls
Definition: eostools.py:346
std::string rootHistogramFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
int evf::EvFDaqDirector::getNFilesFromEoLS ( std::string  BUEoLSFile)
private

Definition at line 605 of file EvFDaqDirector.cc.

References bu_run_dir_, data, def, jsoncollector::DataPoint::deserialize(), eolsNFilesIndex_, jsoncollector::DataPoint::getData(), jsoncollector::DataPoint::getDefinition(), jsoncollector::DataPointDefinition::getNames(), i, Json::Reader::parse(), readEolsDefinition_, matplotRender::reader, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bumpFile().

605  {
606 
607  boost::filesystem::ifstream ij(BUEoLSFile);
608  Json::Value deserializeRoot;
610 
611  if (!reader.parse(ij, deserializeRoot)) {
612  edm::LogError("EvFDaqDirector") << "Cannot deserialize input JSON file -:" << BUEoLSFile;
613  return -1;
614  }
615 
617  DataPoint dp;
618  dp.deserialize(deserializeRoot);
619 
620  //read definition
621  if (readEolsDefinition_) {
622  //std::string def = boost::algorithm::trim(dp.getDefinition());
624  if (!def.size()) readEolsDefinition_=false;
625  while (def.size()) {
626  std::string fullpath;
627  if (def.find('/')==0)
628  fullpath = def;
629  else
630  fullpath = bu_run_dir_+'/'+def;
631  struct stat buf;
632  if (stat(fullpath.c_str(), &buf) == 0) {
633  DataPointDefinition eolsDpd;
634  std::string defLabel = "legend";
635  DataPointDefinition::getDataPointDefinitionFor(fullpath, &eolsDpd,&defLabel);
636  if (eolsDpd.getNames().size()==0) {
637  //try with "data" label if "legend" format is not used
638  eolsDpd = DataPointDefinition();
639  defLabel="data";
640  DataPointDefinition::getDataPointDefinitionFor(fullpath, &eolsDpd,&defLabel);
641  }
642  for (unsigned int i=0;i<eolsDpd.getNames().size();i++)
643  if (eolsDpd.getNames().at(i)=="NFiles")
645  readEolsDefinition_=false;
646  break;
647  }
648  //check if we can still find definition
649  if (def.size()<=1 || def.find('/')==std::string::npos) {
650  readEolsDefinition_=false;
651  break;
652  }
653  def = def.substr(def.find('/')+1);
654  }
655  }
656 
657  if (dp.getData().size()>eolsNFilesIndex_)
658  data = dp.getData()[eolsNFilesIndex_];
659  else {
660  edm::LogError("EvFDaqDirector") << " error reading number of files from BU JSON -: " << BUEoLSFile;
661  return -1;
662  }
663  return boost::lexical_cast<int>(data);
664  }
std::vector< std::string > & getData()
Definition: DataPoint.h:58
int i
Definition: DBlmapReader.cc:9
bool parse(const std::string &document, Value &root, bool collectComments=true)
Read a Value from a JSON document.
Represents a JSON value.
Definition: value.h:111
virtual void deserialize(Json::Value &root)
Definition: DataPoint.cc:56
unsigned int eolsNFilesIndex_
std::string & getDefinition()
Definition: DataPoint.h:59
std::string bu_run_dir_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Unserialize a JSON document into a Value.
Definition: reader.h:16
std::vector< std::string > const & getNames()
JetCorrectorParameters::Definitions def
Definition: classes.h:6
std::string evf::EvFDaqDirector::getOpenDatFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 353 of file EvFDaqDirector.cc.

References run_, run_dir_, and fffnaming::streamerDataFileNameWithPid().

353  {
355  }
def ls
Definition: eostools.py:346
std::string streamerDataFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getOpenInitFilePath ( std::string const &  stream) const

Definition at line 373 of file EvFDaqDirector.cc.

References fffnaming::initFileNameWithPid(), run_, and run_dir_.

373  {
374  return run_dir_ + "/open/" + fffnaming::initFileNameWithPid(run_,0,stream);
375  }
std::string initFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getOpenInputJsonFilePath ( const unsigned int  ls,
const unsigned int  index 
) const

Definition at line 349 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::inputJsonFileName(), and run_.

349  {
351  }
def ls
Definition: eostools.py:346
std::string inputJsonFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
std::string bu_run_dir_
std::string evf::EvFDaqDirector::getOpenOutputJsonFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 357 of file EvFDaqDirector.cc.

References run_, run_dir_, and fffnaming::streamerJsonFileNameWithPid().

357  {
359  }
def ls
Definition: eostools.py:346
std::string streamerJsonFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getOpenProtocolBufferHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 381 of file EvFDaqDirector.cc.

References fffnaming::protocolBufferHistogramFileNameWithPid(), run_, and run_dir_.

381  {
383  }
def ls
Definition: eostools.py:346
std::string protocolBufferHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getOpenRawFilePath ( const unsigned int  ls,
const unsigned int  index 
) const

Definition at line 345 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::inputRawFileName(), and run_.

345  {
346  return bu_run_dir_ + "/open/" + fffnaming::inputRawFileName(run_,ls,index);
347  }
std::string inputRawFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
def ls
Definition: eostools.py:346
std::string bu_run_dir_
std::string evf::EvFDaqDirector::getOpenRootHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 393 of file EvFDaqDirector.cc.

References fffnaming::rootHistogramFileNameWithPid(), run_, and run_dir_.

393  {
395  }
def ls
Definition: eostools.py:346
std::string rootHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getOutputJsonFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 361 of file EvFDaqDirector.cc.

References run_, run_dir_, and fffnaming::streamerJsonFileNameWithPid().

361  {
363  }
def ls
Definition: eostools.py:346
std::string streamerJsonFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getProtocolBufferHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 385 of file EvFDaqDirector.cc.

References fffnaming::protocolBufferHistogramFileNameWithPid(), run_, and run_dir_.

385  {
387  }
def ls
Definition: eostools.py:346
std::string protocolBufferHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string evf::EvFDaqDirector::getRawFilePath ( const unsigned int  ls,
const unsigned int  index 
) const

Definition at line 341 of file EvFDaqDirector.cc.

References bu_run_dir_, fffnaming::inputRawFileName(), and run_.

Referenced by removeFile().

341  {
343  }
std::string inputRawFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
def ls
Definition: eostools.py:346
std::string bu_run_dir_
std::string evf::EvFDaqDirector::getRootHistogramFilePath ( const unsigned int  ls,
std::string const &  stream 
) const

Definition at line 397 of file EvFDaqDirector.cc.

References fffnaming::rootHistogramFileNameWithPid(), run_, and run_dir_.

397  {
399  }
def ls
Definition: eostools.py:346
std::string rootHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
unsigned int evf::EvFDaqDirector::getRunNumber ( ) const
inline

Definition at line 90 of file EvFDaqDirector.h.

References run_.

90 { return run_; }
std::string evf::EvFDaqDirector::getRunOpenDirPath ( ) const
inline

Definition at line 83 of file EvFDaqDirector.h.

References run_dir_.

Referenced by createRunOpendirMaybe(), and EvFDaqDirector().

83 {return run_dir_ +"/open";}
std::string evf::EvFDaqDirector::getStreamDestinations ( std::string const &  stream) const

Definition at line 909 of file EvFDaqDirector.cc.

References Json::Value::begin(), Json::Value::end(), edm::hlt::Exception, visualization-live-secondInstance_cfg::msg, requireTSPSet_, run_regression::ret, selectedTransferMode_, edmStreamStallGrapher::stream, AlCaHLTBitMon_QueryRunRegistry::string, and transferSystemJson_.

910  {
911  std::string streamRequestName;
912  if (transferSystemJson_->isMember(stream.c_str()))
913  streamRequestName = stream;
914  else {
915  std::stringstream msg;
916  msg << "Transfer system mode definitions missing for -: " << stream;
917  if (requireTSPSet_)
918  throw cms::Exception("EvFDaqDirector") << msg.str();
919  else {
920  edm::LogWarning("EvFDaqDirector") << msg.str() << " (permissive mode)";
921  return std::string("Failsafe");
922  }
923  }
924  //return empty if strict check parameter is not on
926  edm::LogWarning("EvFDaqDirector") << "Selected mode string is not provided as DaqDirector parameter."
927  << "Switch on requireTSPSet parameter to enforce this requirement. Setting mode to empty string.";
928  return std::string("Failsafe");
929  }
931  throw cms::Exception("EvFDaqDirector") << "Selected mode string is not provided as DaqDirector parameter.";
932  }
933  //check if stream has properly listed transfer stream
934  if (!transferSystemJson_->get(streamRequestName, "").isMember(selectedTransferMode_.c_str()))
935  {
936  std::stringstream msg;
937  msg << "Selected transfer mode " << selectedTransferMode_ << " is not specified for stream " << streamRequestName;
938  if (requireTSPSet_)
939  throw cms::Exception("EvFDaqDirector") << msg.str();
940  else
941  edm::LogWarning("EvFDaqDirector") << msg.str() << " (permissive mode)";
942  return std::string("Failsafe");
943  }
944  Json::Value destsVec = transferSystemJson_->get(streamRequestName, "").get(selectedTransferMode_,"");
945 
946  //flatten string json::Array into CSV std::string
948  for (Json::Value::iterator it = destsVec.begin(); it!=destsVec.end(); it++)
949  {
950  if (ret!="") ret +=",";
951  ret+=(*it).asString();
952  }
953  return ret;
954  }
const_iterator begin() const
std::shared_ptr< Json::Value > transferSystemJson_
Represents a JSON value.
Definition: value.h:111
std::string selectedTransferMode_
const_iterator end() const
Iterator for object and array value.
Definition: value.h:1007
std::vector<int>* evf::EvFDaqDirector::getStreamFileTracker ( )
inline

Definition at line 97 of file EvFDaqDirector.h.

References streamFileTracker_.

Referenced by FedRawDataInputSource::getNextEvent().

97 {return &streamFileTracker_;}
std::vector< int > streamFileTracker_
std::string evf::EvFDaqDirector::initFileName ( std::string const &  stream) const
private
std::string evf::EvFDaqDirector::inputFileNameStem ( const unsigned int  ls,
const unsigned int  index 
) const
private
bool evf::EvFDaqDirector::isSingleStreamThread ( )
inline

Definition at line 98 of file EvFDaqDirector.h.

References nStreams_, and nThreads_.

Referenced by FedRawDataInputSource::getNextEvent().

98 {return nStreams_==1 && nThreads_==1;}
unsigned int nThreads_
unsigned int nStreams_
void evf::EvFDaqDirector::lockFULocal ( )

Definition at line 806 of file EvFDaqDirector.cc.

References fulocal_rwlock_fd_.

Referenced by updateFuLock().

806  {
807  //fcntl(fulocal_rwlock_fd_, F_SETLKW, &fulocal_rw_flk);
808  flock(fulocal_rwlock_fd_,LOCK_SH);
809  }
void evf::EvFDaqDirector::lockFULocal2 ( )

Definition at line 817 of file EvFDaqDirector.cc.

References fulocal_rwlock_fd2_.

Referenced by FedRawDataInputSource::checkNextEvent(), and FedRawDataInputSource::maybeOpenNewLumiSection().

817  {
818  //fcntl(fulocal_rwlock_fd2_, F_SETLKW, &fulocal_rw_flk2);
819  flock(fulocal_rwlock_fd2_,LOCK_EX);
820  }
void evf::EvFDaqDirector::lockInitLock ( )

Definition at line 798 of file EvFDaqDirector.cc.

References init_lock_.

798  {
799  pthread_mutex_lock(&init_lock_);
800  }
pthread_mutex_t init_lock_
FILE * evf::EvFDaqDirector::maybeCreateAndLockFileHeadForStream ( unsigned int  ls,
std::string &  stream 
)

Definition at line 778 of file EvFDaqDirector.cc.

References data_readwrite_fd_, data_rw_flk, data_rw_stream, getMergedDatFilePath(), and LogDebug.

778  {
779  data_rw_stream = fopen(getMergedDatFilePath(ls,stream).c_str(), "a"); //open stream for appending
781  if (data_readwrite_fd_ == -1)
782  edm::LogError("EvFDaqDirector") << "problem with creating filedesc for datamerge "
783  << strerror(errno);
784  else
785  LogDebug("EvFDaqDirector") << "creating filedesc for datamerge -: "
787  fcntl(data_readwrite_fd_, F_SETLKW, &data_rw_flk);
788 
789  return data_rw_stream;
790  }
#define LogDebug(id)
def ls
Definition: eostools.py:346
struct flock data_rw_flk
std::string getMergedDatFilePath(const unsigned int ls, std::string const &stream) const
std::string evf::EvFDaqDirector::mergedFileNameStem ( const unsigned int  ls,
std::string const &  stream 
) const
private
void evf::EvFDaqDirector::openFULockfileStream ( std::string &  fuLockFilePath,
bool  create 
)
private

Definition at line 759 of file EvFDaqDirector.cc.

References eostools::chmod(), fu_readwritelock_fd_, fu_rw_lock_stream, and LogDebug.

Referenced by EvFDaqDirector().

759  {
760  if (create) {
761  fu_readwritelock_fd_ = open(fulockfile.c_str(), O_RDWR | O_CREAT,
762  S_IRWXU | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH);
763  chmod(fulockfile.c_str(),0766);
764  } else {
765  fu_readwritelock_fd_ = open(fulockfile.c_str(), O_RDWR, S_IRWXU);
766  }
767  if (fu_readwritelock_fd_ == -1)
768  edm::LogError("EvFDaqDirector") << "problem with creating filedesc for fuwritelock -: " << fulockfile.c_str()
769  << " create:" << create << " error:" << strerror(errno);
770  else
771  LogDebug("EvFDaqDirector") << "creating filedesc for fureadwritelock -: "
773 
774  fu_rw_lock_stream = fdopen(fu_readwritelock_fd_, "r+");
775  }
#define LogDebug(id)
def chmod
Definition: eostools.py:291
SurfaceDeformation * create(int type, const std::vector< double > &params)
bool evf::EvFDaqDirector::outputAdler32Recheck ( ) const
inline

Definition at line 84 of file EvFDaqDirector.h.

References outputAdler32Recheck_.

std::string evf::EvFDaqDirector::outputFileNameStem ( const unsigned int  ls,
std::string const &  stream 
) const
private
void evf::EvFDaqDirector::postEndRun ( edm::GlobalContext const &  globalContext)

Definition at line 255 of file EvFDaqDirector.cc.

References bu_readlock_fd_, bu_run_dir_, bu_writelock_fd_, directorBu_, lut2db_cfg::filename, removeFile(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EvFDaqDirector().

255  {
256  close(bu_readlock_fd_);
257  close(bu_writelock_fd_);
258  if (directorBu_) {
259  std::string filename = bu_run_dir_ + "/bu.lock";
260  removeFile(filename);
261  }
262  }
void removeFile(unsigned int ls, unsigned int index)
std::string bu_run_dir_
tuple filename
Definition: lut2db_cfg.py:20
void evf::EvFDaqDirector::preallocate ( edm::service::SystemBounds const &  bounds)

Definition at line 264 of file EvFDaqDirector.cc.

References checkTransferSystemPSet(), i, edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), nStreams_, nThreads_, and streamFileTracker_.

Referenced by EvFDaqDirector().

264  {
265 
266  for (unsigned int i=0;i<bounds.maxNumberOfStreams();i++){
267  streamFileTracker_.push_back(-1);
268  }
269  nThreads_=bounds.maxNumberOfStreams();
270  nStreams_=bounds.maxNumberOfThreads();
271 
273  }
unsigned int nThreads_
int i
Definition: DBlmapReader.cc:9
std::vector< int > streamFileTracker_
unsigned int nStreams_
void evf::EvFDaqDirector::preBeginRun ( edm::GlobalContext const &  globalContext)

Definition at line 275 of file EvFDaqDirector.cc.

References dirManager_, evf::DirManager::findHighestRunDir(), and run_dir_.

Referenced by EvFDaqDirector().

275  {
276 
277  //assert(run_ == id.run());
278 
279  // check if the requested run is the latest one - issue a warning if it isn't
281  edm::LogWarning("EvFDaqDirector") << "WARNING - checking run dir -: "
282  << run_dir_ << ". This is not the highest run "
284  }
285  }
std::string findHighestRunDir()
Definition: DirManager.cc:20
void evf::EvFDaqDirector::preGlobalEndLumi ( edm::GlobalContext const &  globalContext)

Definition at line 287 of file EvFDaqDirector.cc.

References cppFunctionSkipper::exception, fileDeleteLockPtr_, filesToDeletePtr_, LogDebug, eostools::ls(), edm::LuminosityBlockID::luminosityBlock(), edm::GlobalContext::luminosityBlockID(), cmsHarvester::path, and python.multivaluedict::remove().

Referenced by EvFDaqDirector().

288  {
289  //delete all files belonging to just closed lumi
290  unsigned int ls = globalContext.luminosityBlockID().luminosityBlock();
292  edm::LogWarning("EvFDaqDirector") << " Handles to check for files to delete were not set by the input source...";
293  return;
294  }
295 
296  std::unique_lock<std::mutex> lkw(*fileDeleteLockPtr_);
297  auto it = filesToDeletePtr_->begin();
298  while (it!=filesToDeletePtr_->end()) {
299  if (it->second->lumi_ == ls) {
300  const boost::filesystem::path filePath(it->second->fileName_);
301  LogDebug("EvFDaqDirector") << "Deleting input file -:" << it->second->fileName_;
302  try {
303  //rarely this fails but file gets deleted
304  boost::filesystem::remove(filePath);
305  }
306  catch (const boost::filesystem::filesystem_error& ex)
307  {
308  edm::LogError("EvFDaqDirector") << " - deleteFile BOOST FILESYSTEM ERROR CAUGHT -: " << ex.what() << ". Trying again.";
309  usleep(10000);
310  try {
311  boost::filesystem::remove(filePath);
312  }
313  catch (...) {/*file gets deleted first time but exception is still thrown*/}
314  }
315  catch (std::exception& ex)
316  {
317  edm::LogError("EvFDaqDirector") << " - deleteFile std::exception CAUGHT -: " << ex.what() << ". Trying again.";
318  usleep(10000);
319  try {
320  boost::filesystem::remove(filePath);
321  } catch (...) {/*file gets deleted first time but exception is still thrown*/}
322  }
323 
324  delete it->second;
325  it = filesToDeletePtr_->erase(it);
326  }
327  else it++;
328  }
329  }
#define LogDebug(id)
std::list< std::pair< int, InputFile * > > * filesToDeletePtr_
def ls
Definition: eostools.py:346
std::mutex * fileDeleteLockPtr_
tuple path
else: Piece not in the list, fine.
void evf::EvFDaqDirector::preSourceEvent ( edm::StreamID const &  streamID)
inline

Definition at line 331 of file EvFDaqDirector.cc.

References currentFileIndex_, and streamFileTracker_.

Referenced by EvFDaqDirector().

331  {
333  }
std::vector< int > streamFileTracker_
int evf::EvFDaqDirector::readLastLSEntry ( std::string const &  file)

Definition at line 839 of file EvFDaqDirector.cc.

References Json::Value::asInt(), mergeVDriftHistosByStation::file, Json::Value::get(), Json::Reader::parse(), matplotRender::reader, and run_regression::ret.

Referenced by updateFuLock().

839  {
840 
841  boost::filesystem::ifstream ij(file);
842  Json::Value deserializeRoot;
844 
845  if (!reader.parse(ij, deserializeRoot)) {
846  edm::LogError("EvFDaqDirector") << "Cannot deserialize input JSON file -:" << file;
847  return -1;
848  }
849 
850  int ret = deserializeRoot.get("lastLS","").asInt();
851  return ret;
852 
853  }
Value get(UInt index, const Value &defaultValue) const
bool parse(const std::string &document, Value &root, bool collectComments=true)
Read a Value from a JSON document.
Represents a JSON value.
Definition: value.h:111
Int asInt() const
Unserialize a JSON document into a Value.
Definition: reader.h:16
void evf::EvFDaqDirector::removeFile ( unsigned int  ls,
unsigned int  index 
)

Definition at line 433 of file EvFDaqDirector.cc.

References getRawFilePath().

Referenced by postEndRun().

433  {
435  }
def ls
Definition: eostools.py:346
std::string getRawFilePath(const unsigned int ls, const unsigned int index) const
void removeFile(unsigned int ls, unsigned int index)
void evf::EvFDaqDirector::removeFile ( std::string  filename)

Definition at line 426 of file EvFDaqDirector.cc.

426  {
427  int retval = remove(filename.c_str());
428  if (retval != 0)
429  edm::LogError("EvFDaqDirector") << "Could not remove used file -: " << filename << ". error = "
430  << strerror(errno);
431  }
tuple filename
Definition: lut2db_cfg.py:20
void evf::EvFDaqDirector::setDeleteTracking ( std::mutex fileDeleteLock,
std::list< std::pair< int, InputFile * >> *  filesToDelete 
)
inline

Definition at line 106 of file EvFDaqDirector.h.

References fileDeleteLockPtr_, and filesToDeletePtr_.

Referenced by FedRawDataInputSource::FedRawDataInputSource().

106  {
107  fileDeleteLockPtr_=fileDeleteLock;
108  filesToDeletePtr_ = filesToDelete;
109  }
std::list< std::pair< int, InputFile * > > * filesToDeletePtr_
std::mutex * fileDeleteLockPtr_
void evf::EvFDaqDirector::setFMS ( evf::FastMonitoringService fms)
inline

Definition at line 95 of file EvFDaqDirector.h.

References fms_.

Referenced by FedRawDataInputSource::FedRawDataInputSource().

95 {fms_=fms;}
evf::FastMonitoringService * fms_
void evf::EvFDaqDirector::tryInitializeFuLockFile ( )

Definition at line 748 of file EvFDaqDirector.cc.

References fu_rw_lock_stream, and getHLTprescales::readIndex().

Referenced by EvFDaqDirector().

748  {
749  if (fu_rw_lock_stream == 0)
750  edm::LogError("EvFDaqDirector") << "Error creating fu read/write lock stream "
751  << strerror(errno);
752  else {
753  edm::LogInfo("EvFDaqDirector") << "Initializing FU LOCK FILE";
754  unsigned int readLs = 1, readIndex = 0;
755  fprintf(fu_rw_lock_stream, "%u %u", readLs, readIndex);
756  }
757  }
void evf::EvFDaqDirector::unlockAndCloseMergeStream ( )

Definition at line 792 of file EvFDaqDirector.cc.

References data_readwrite_fd_, data_rw_fulk, and data_rw_stream.

792  {
793  fflush(data_rw_stream);
794  fcntl(data_readwrite_fd_, F_SETLKW, &data_rw_fulk);
795  fclose(data_rw_stream);
796  }
struct flock data_rw_fulk
void evf::EvFDaqDirector::unlockFULocal ( )

Definition at line 811 of file EvFDaqDirector.cc.

References fulocal_rwlock_fd_.

Referenced by FedRawDataInputSource::grabNextJsonFile(), and ~EvFDaqDirector().

811  {
812  //fcntl(fulocal_rwlock_fd_, F_SETLKW, &fulocal_rw_fulk);
813  flock(fulocal_rwlock_fd_,LOCK_UN);
814  }
void evf::EvFDaqDirector::unlockFULocal2 ( )

Definition at line 822 of file EvFDaqDirector.cc.

References fulocal_rwlock_fd2_.

Referenced by FedRawDataInputSource::checkNextEvent(), FedRawDataInputSource::maybeOpenNewLumiSection(), and ~EvFDaqDirector().

822  {
823  //fcntl(fulocal_rwlock_fd2_, F_SETLKW, &fulocal_rw_fulk2);
824  flock(fulocal_rwlock_fd2_,LOCK_UN);
825  }
void evf::EvFDaqDirector::unlockInitLock ( )

Definition at line 802 of file EvFDaqDirector.cc.

References init_lock_.

802  {
803  pthread_mutex_unlock(&init_lock_);
804  }
pthread_mutex_t init_lock_
void evf::EvFDaqDirector::updateFileIndex ( int const &  fileIndex)
inline

Definition at line 96 of file EvFDaqDirector.h.

References currentFileIndex_.

Referenced by FedRawDataInputSource::getNextEvent().

96 {currentFileIndex_=fileIndex;}
EvFDaqDirector::FileStatus evf::EvFDaqDirector::updateFuLock ( unsigned int &  ls,
std::string &  nextFile,
uint32_t &  fsize,
uint64_t &  lockWaitTime 
)

Definition at line 437 of file EvFDaqDirector.cc.

References bu_run_dir_, bumpFile(), DDVectorGetter::check(), edm::hlt::Exception, fu_readwritelock_fd_, fu_rw_flk, fu_rw_fulk, fu_rw_lock_stream, fuLockPollInterval_, getEoLSFilePathOnFU(), getEoRFilePath(), lockFULocal(), LogDebug, eostools::ls(), newFile, noFile, getHLTprescales::readIndex(), readLastLSEntry(), runEnded, and stopFilePath_.

Referenced by FedRawDataInputSource::readSupervisor().

437  {
438  EvFDaqDirector::FileStatus fileStatus = noFile;
439 
440  int retval = -1;
441  int lock_attempts = 0;
442 
443  struct stat buf;
444  int stopFileLS = -1;
445  if (stat(stopFilePath_.c_str(),&buf)==0) {
446  stopFileLS = readLastLSEntry(stopFilePath_);
447  edm::LogWarning("EvFDaqDirector") << "Detected stop request from hltd. Ending run for this process after LS -: " << stopFileLS;
448  //return runEnded;
449  }
450 
451  timeval ts_lockbegin;
452  gettimeofday(&ts_lockbegin,0);
453 
454  while (retval==-1) {
455  retval = fcntl(fu_readwritelock_fd_, F_SETLK, &fu_rw_flk);
456  if (retval==-1) usleep(fuLockPollInterval_);
457  else continue;
458 
459  lock_attempts+=fuLockPollInterval_;
460  if (lock_attempts>5000000 || errno==116) {
461  if (errno==116)
462  edm::LogWarning("EvFDaqDirector") << "Stale lock file handle. Checking if run directory and fu.lock file are present" << std::endl;
463  else
464  edm::LogWarning("EvFDaqDirector") << "Unable to obtain a lock for 5 seconds. Checking if run directory and fu.lock file are present -: errno "
465  << errno <<":"<< strerror(errno) << std::endl;
466 
467 
468  if (stat(getEoLSFilePathOnFU(ls).c_str(),&buf)==0) {
469  edm::LogWarning("EvFDaqDirector") << "Detected local EoLS for lumisection "<< ls ;
470  ls++;
471  return noFile;
472  }
473 
474  if (stat(bu_run_dir_.c_str(), &buf)!=0) return runEnded;
475  if (stat((bu_run_dir_+"/fu.lock").c_str(), &buf)!=0) return runEnded;
476  lock_attempts=0;
477  }
478  }
479 
480  timeval ts_lockend;
481  gettimeofday(&ts_lockend,0);
482  long deltat = (ts_lockend.tv_usec-ts_lockbegin.tv_usec) + (ts_lockend.tv_sec-ts_lockbegin.tv_sec)*1000000;
483  if (deltat>0.) lockWaitTime=deltat;
484 
485 
486 
487  if(retval!=0) return fileStatus;
488 
489 #ifdef DEBUG
490  timeval ts_lockend;
491  gettimeofday(&ts_lockend,0);
492 #endif
493 
494  // if the stream is readable
495  if (fu_rw_lock_stream != 0) {
496  unsigned int readLs, readIndex;
497  int check = 0;
498  // rewind the stream
499  check = fseek(fu_rw_lock_stream, 0, SEEK_SET);
500  // if rewinded ok
501  if (check == 0) {
502  // read its' values
503  fscanf(fu_rw_lock_stream, "%u %u", &readLs, &readIndex);
504  edm::LogInfo("EvFDaqDirector") << "Read fu.lock file file -: " << readLs << ":" << readIndex;
505 
506  unsigned int currentLs = readLs;
507  bool bumpedOk = false;
508  //if next lumisection in a lock file is not +1 wrt. source, cycle through the next empty one, unless initial lumi not yet set
509  //no lock file write in this case
510  if (ls && ls+1 < currentLs) ls++;
511  else {
512  // try to bump (look for new index or EoLS file)
513  bumpedOk = bumpFile(readLs, readIndex, nextFile, fsize, stopFileLS);
514  //avoid 2 lumisections jump
515  if (ls && readLs>currentLs && currentLs > ls) {
516  ls++;
517  readLs=currentLs=ls;
518  readIndex=0;
519  bumpedOk=false;
520  //no write to lock file
521  }
522  else {
523  if (ls==0 && readLs>currentLs) {
524  //make sure to intialize always with LS found in the lock file, with possibility of grabbing index file immediately
525  //in this case there is no new file in the same LS
526  readLs=currentLs;
527  readIndex=0;
528  bumpedOk=false;
529  //no write to lock file
530  }
531  //update return LS value
532  ls = readLs;
533  }
534  }
535  if (bumpedOk) {
536  // there is a new index file to grab, lock file needs to be updated
537  check = fseek(fu_rw_lock_stream, 0, SEEK_SET);
538  if (check == 0) {
539  ftruncate(fu_readwritelock_fd_, 0);
540  // write next index in the file, which is the file the next process should take
541  fprintf(fu_rw_lock_stream, "%u %u", readLs, readIndex + 1);
542  fflush(fu_rw_lock_stream);
543  fsync(fu_readwritelock_fd_);
544  fileStatus = newFile;
545  LogDebug("EvFDaqDirector") << "Written to file -: " << readLs << ":" << readIndex + 1;
546  }
547  else {
548  throw cms::Exception("EvFDaqDirector") << "seek on fu read/write lock for updating failed with error " << strerror(errno);
549  }
550  }
551  else if (currentLs < readLs) {
552  //there is no new file in next LS (yet), but lock file can be updated to the next LS
553  check = fseek(fu_rw_lock_stream, 0, SEEK_SET);
554  if (check == 0) {
555  ftruncate(fu_readwritelock_fd_, 0);
556  // in this case LS was bumped, but no new file. Thus readIndex is 0 (set by bumpFile)
557  fprintf(fu_rw_lock_stream, "%u %u", readLs, readIndex);
558  fflush(fu_rw_lock_stream);
559  fsync(fu_readwritelock_fd_);
560  LogDebug("EvFDaqDirector") << "Written to file -: " << readLs << ":" << readIndex;
561  }
562  else {
563  throw cms::Exception("EvFDaqDirector") << "seek on fu read/write lock for updating failed with error " << strerror(errno);
564  }
565  }
566  } else {
567  edm::LogError("EvFDaqDirector") << "seek on fu read/write lock for reading failed with error " << strerror(errno);
568  }
569  } else {
570  edm::LogError("EvFDaqDirector") << "fu read/write lock stream is invalid " << strerror(errno);
571  }
572 
573 #ifdef DEBUG
574  timeval ts_preunlock;
575  gettimeofday(&ts_preunlock,0);
576  int locked_period_int = ts_preunlock.tv_sec - ts_lockend.tv_sec;
577  double locked_period=locked_period_int+double(ts_preunlock.tv_usec - ts_lockend.tv_usec)/1000000;
578 #endif
579 
580  //if new json is present, lock file which FedRawDataInputSource will later unlock
581  if (fileStatus==newFile) lockFULocal();
582 
583  //release lock at this point
584  int retvalu=-1;
585  retvalu=fcntl(fu_readwritelock_fd_, F_SETLKW, &fu_rw_fulk);
586  if (retvalu==-1) edm::LogError("EvFDaqDirector") << "Error unlocking the fu.lock " << strerror(errno);
587 
588 #ifdef DEBUG
589  edm::LogDebug("EvFDaqDirector") << "Waited during lock -: " << locked_period << " seconds";
590 #endif
591 
592  if ( fileStatus == noFile ) {
593  struct stat buf;
594  //edm::LogInfo("EvFDaqDirector") << " looking for EoR file: " << getEoRFilePath().c_str();
595  if ( stat(getEoRFilePath().c_str(), &buf) == 0 || stat(bu_run_dir_.c_str(), &buf)!=0)
596  fileStatus = runEnded;
597  if (stopFileLS>=0 && (int)ls > stopFileLS) {
598  edm::LogInfo("EvFDaqDirector") << "Reached maximum lumisection set by hltd";
599  fileStatus = runEnded;
600  }
601  }
602  return fileStatus;
603  }
#define LogDebug(id)
struct flock fu_rw_flk
def ls
Definition: eostools.py:346
std::string getEoRFilePath() const
struct flock fu_rw_fulk
bool check(const std::string &)
std::string stopFilePath_
int readLastLSEntry(std::string const &file)
std::string bu_run_dir_
std::string getEoLSFilePathOnFU(const unsigned int ls) const
bool bumpFile(unsigned int &ls, unsigned int &index, std::string &nextFile, uint32_t &fsize, int maxLS)
unsigned int fuLockPollInterval_

Member Data Documentation

std::string evf::EvFDaqDirector::base_dir_
private

Definition at line 128 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector().

std::string evf::EvFDaqDirector::bu_base_dir_
private

Definition at line 129 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector().

struct flock evf::EvFDaqDirector::bu_r_flk
private

Definition at line 164 of file EvFDaqDirector.h.

struct flock evf::EvFDaqDirector::bu_r_fulk
private

Definition at line 166 of file EvFDaqDirector.h.

FILE* evf::EvFDaqDirector::bu_r_lock_stream
private

Definition at line 153 of file EvFDaqDirector.h.

int evf::EvFDaqDirector::bu_readlock_fd_
private

Definition at line 145 of file EvFDaqDirector.h.

Referenced by postEndRun().

std::string evf::EvFDaqDirector::bu_run_dir_
private
std::string evf::EvFDaqDirector::bu_run_open_dir_
private

Definition at line 143 of file EvFDaqDirector.h.

Referenced by buBaseRunOpenDir(), and EvFDaqDirector().

FILE* evf::EvFDaqDirector::bu_t_monitor_stream
private

Definition at line 156 of file EvFDaqDirector.h.

struct flock evf::EvFDaqDirector::bu_w_flk
private

Definition at line 163 of file EvFDaqDirector.h.

struct flock evf::EvFDaqDirector::bu_w_fulk
private

Definition at line 165 of file EvFDaqDirector.h.

FILE* evf::EvFDaqDirector::bu_w_lock_stream
private

Definition at line 152 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector().

FILE* evf::EvFDaqDirector::bu_w_monitor_stream
private

Definition at line 155 of file EvFDaqDirector.h.

int evf::EvFDaqDirector::bu_writelock_fd_
private

Definition at line 146 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), and postEndRun().

int evf::EvFDaqDirector::currentFileIndex_ = -1
private

Definition at line 178 of file EvFDaqDirector.h.

Referenced by preSourceEvent(), and updateFileIndex().

int evf::EvFDaqDirector::data_readwrite_fd_
private
struct flock evf::EvFDaqDirector::data_rw_flk
private

Definition at line 169 of file EvFDaqDirector.h.

Referenced by maybeCreateAndLockFileHeadForStream().

struct flock evf::EvFDaqDirector::data_rw_fulk
private

Definition at line 170 of file EvFDaqDirector.h.

Referenced by unlockAndCloseMergeStream().

FILE* evf::EvFDaqDirector::data_rw_stream
private
bool evf::EvFDaqDirector::directorBu_
private

Definition at line 130 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), and postEndRun().

DirManager evf::EvFDaqDirector::dirManager_
private

Definition at line 159 of file EvFDaqDirector.h.

Referenced by findCurrentRunDir(), and preBeginRun().

bool evf::EvFDaqDirector::emptyLumisectionMode_
private

Definition at line 137 of file EvFDaqDirector.h.

Referenced by emptyLumisectionMode(), and EvFDaqDirector().

unsigned int evf::EvFDaqDirector::eolsNFilesIndex_ = 1
private

Definition at line 189 of file EvFDaqDirector.h.

Referenced by getNFilesFromEoLS().

std::mutex* evf::EvFDaqDirector::fileDeleteLockPtr_ = nullptr
private

Definition at line 180 of file EvFDaqDirector.h.

Referenced by preGlobalEndLumi(), and setDeleteTracking().

std::list<std::pair<int,InputFile*> >* evf::EvFDaqDirector::filesToDeletePtr_ = nullptr
private

Definition at line 181 of file EvFDaqDirector.h.

Referenced by preGlobalEndLumi(), and setDeleteTracking().

evf::FastMonitoringService* evf::EvFDaqDirector::fms_ = nullptr
private

Definition at line 176 of file EvFDaqDirector.h.

Referenced by bumpFile(), and setFMS().

int evf::EvFDaqDirector::fu_readwritelock_fd_
private

Definition at line 147 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), openFULockfileStream(), and updateFuLock().

struct flock evf::EvFDaqDirector::fu_rw_flk
private

Definition at line 167 of file EvFDaqDirector.h.

Referenced by updateFuLock().

struct flock evf::EvFDaqDirector::fu_rw_fulk
private

Definition at line 168 of file EvFDaqDirector.h.

Referenced by updateFuLock().

FILE* evf::EvFDaqDirector::fu_rw_lock_stream
private
int evf::EvFDaqDirector::fulocal_rwlock_fd2_
private

Definition at line 150 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), lockFULocal2(), unlockFULocal2(), and ~EvFDaqDirector().

int evf::EvFDaqDirector::fulocal_rwlock_fd_
private

Definition at line 149 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), lockFULocal(), unlockFULocal(), and ~EvFDaqDirector().

unsigned int evf::EvFDaqDirector::fuLockPollInterval_
private

Definition at line 136 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), and updateFuLock().

std::string evf::EvFDaqDirector::hltSourceDirectory_
private

Definition at line 135 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector().

std::string evf::EvFDaqDirector::hostname_
private
pthread_mutex_t evf::EvFDaqDirector::init_lock_ = PTHREAD_MUTEX_INITIALIZER
private

Definition at line 183 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), lockInitLock(), and unlockInitLock().

unsigned int evf::EvFDaqDirector::nStreams_ =0
private

Definition at line 185 of file EvFDaqDirector.h.

Referenced by isSingleStreamThread(), and preallocate().

unsigned int evf::EvFDaqDirector::nThreads_ =0
private

Definition at line 186 of file EvFDaqDirector.h.

Referenced by isSingleStreamThread(), and preallocate().

bool evf::EvFDaqDirector::outputAdler32Recheck_
private

Definition at line 132 of file EvFDaqDirector.h.

Referenced by outputAdler32Recheck().

unsigned long evf::EvFDaqDirector::previousFileSize_
private

Definition at line 161 of file EvFDaqDirector.h.

Referenced by bumpFile().

bool evf::EvFDaqDirector::readEolsDefinition_ = true
private

Definition at line 188 of file EvFDaqDirector.h.

Referenced by getNFilesFromEoLS().

bool evf::EvFDaqDirector::requireTSPSet_
private

Definition at line 133 of file EvFDaqDirector.h.

Referenced by checkTransferSystemPSet(), and getStreamDestinations().

unsigned int evf::EvFDaqDirector::run_
private
std::string evf::EvFDaqDirector::run_dir_
private
std::string evf::EvFDaqDirector::run_string_
private

Definition at line 140 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector().

std::string evf::EvFDaqDirector::selectedTransferMode_
private

Definition at line 134 of file EvFDaqDirector.h.

Referenced by getStreamDestinations().

std::string evf::EvFDaqDirector::stopFilePath_
private

Definition at line 190 of file EvFDaqDirector.h.

Referenced by EvFDaqDirector(), and updateFuLock().

std::vector<int> evf::EvFDaqDirector::streamFileTracker_
private

Definition at line 177 of file EvFDaqDirector.h.

Referenced by getStreamFileTracker(), preallocate(), and preSourceEvent().

std::shared_ptr<Json::Value> evf::EvFDaqDirector::transferSystemJson_
private

Definition at line 192 of file EvFDaqDirector.h.

Referenced by checkTransferSystemPSet(), and getStreamDestinations().