Changeset 16569 for trunk


Ignore:
Timestamp:
06/02/13 02:19:43 (11 years ago)
Author:
tbretz
Message:
Show an out-of-memory message not more often than once a second; therefore, moved the reportMem to the runCtrl structure and changed the type to time_t
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilder.cc

    r16531 r16569  
    12171217            if (evt && !evt->initMemory())
    12181218            {
    1219                 if (evt->reportMem)
     1219                const time_t tm = time(NULL);
     1220                if (evt->runCtrl->reportMem==tm)
    12201221                    continue;
    12211222
    12221223                factPrintf(MessageImp::kError, "No free memory left for %d (run=%d)", evt->evNum, evt->runNum);
    1223                 evt->reportMem = true;
     1224                evt->runCtrl->reportMem = tm;
    12241225                continue;
    12251226            }
  • trunk/FACT++/src/EventBuilder.h

    r16380 r16569  
    4949    int64_t runId ;      // Run number
    5050
     51    time_t reportMem;        // initMemory has reported no memory once (set outside of class)
     52
    5153    time_t openTime;     // Time when first event (first board) was received
    5254    time_t lastTime;     // Time when last event was received (set when first board data received)
     
    6769    std::list<std::array<int16_t,1440>> prevStart; // History for start cells of previous events (for step calibration)
    6870
    69     RUN_CTRL2() : runId(-1), lastTime(0), lastEvt(0), maxEvt(1<<31), fileStat(kFileNotYetOpen)
     71    RUN_CTRL2() : runId(-1), reportMem(0), lastTime(0), lastEvt(0), maxEvt(1<<31), fileStat(kFileNotYetOpen)
    7072    {
    7173        // runId   = -1;
     
    119121    PEVNT_HEADER *header;  // Pointer to a valid header within FADhead
    120122
    121     bool reportMem;        // initMemory has reported no memory once (set outside of class)
    122123    int closeRequest;
    123124
     
    126127    // Be carefull with this constructor... writeEvt can seg fault
    127128    // it gets an empty runCtrl
    128     EVT_CTRL2() : nBoard(0), FADhead(0), header(0), reportMem(false), closeRequest(kRequestNone)
     129    EVT_CTRL2() : nBoard(0), FADhead(0), header(0), closeRequest(kRequestNone)
    129130    {
    130131        //flag all boards as unused
     
    138139        }*/
    139140
    140     EVT_CTRL2(int req, const std::shared_ptr<RUN_CTRL2> &run) : nBoard(0), FADhead(0), header(0), reportMem(false), closeRequest(req), runCtrl(run)
     141    EVT_CTRL2(int req, const std::shared_ptr<RUN_CTRL2> &run) : nBoard(0), FADhead(0), header(0), closeRequest(req), runCtrl(run)
    141142    {
    142143        //flag all boards as unused
Note: See TracChangeset for help on using the changeset viewer.