Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76223
b: "refs/heads/CMSSW_7_1_X"
c: f3db959
h: "refs/heads/CMSSW_7_1_X"
i:
  76221: 2be0eda
  76219: be86c5b
  76215: 4311431
  76207: dfd27db
  76191: fbc0d3b
  76159: bbd352d
v: v3
  • Loading branch information
Lassi Tuura committed Oct 23, 2009
1 parent ca65b75 commit 04a03fb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": 133d805239a808ba5529512d68414df5a85ce3a5
"refs/heads/CMSSW_7_1_X": f3db95910c85c5f3c9cf5088c8a5cdece36cb8d5
25 changes: 15 additions & 10 deletions trunk/DQMServices/Core/interface/DQMNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,14 @@ class DQMImplNet : public DQMNet
virtual void
purgeDeadObjects(Peer *p)
{
uint64_t minreq
= (lat::Time::current()
- lat::TimeSpan(0, 0, 5 /* minutes */, 0, 0)).ns();
ImplPeer *ip = static_cast<ImplPeer *>(p);
typename ObjectMap::iterator i, e;
for (i = ip->objs.begin(), e = ip->objs.end(); i != e; )
{
if (i->flags & DQM_PROP_DEAD)
ip->objs.erase(i++);
else
{
if (i->lastreq && i->lastreq < minreq)
const_cast<ObjType &>(*i).lastreq = 0;
++i;
}
}
}

Expand Down Expand Up @@ -503,11 +496,16 @@ class DQMImplNet : public DQMNet
{
typename PeerMap::iterator pi, pe;
typename ObjectMap::iterator oi, oe;
uint32_t numobjs = 0;
size_t size = 0;
size_t numobjs = 0;
for (pi = peers_.begin(), pe = peers_.end(); pi != pe; ++pi)
numobjs += pi->second.objs.size();
for (oi = pi->second.objs.begin(), oe = pi->second.objs.end(); oi != oe; ++oi, ++numobjs)
if (all || (oi->flags & DQM_PROP_NEW))
size += 9*sizeof(uint32_t) + oi->dirname->size()
+ oi->objname.size() + 1 + oi->scalar.size() + oi->qdata.size()
+ (oi->lastreq > 0 ? oi->rawdata.size() : 0);

msg->data.reserve(msg->data.size() + 300*numobjs);
msg->data.reserve(msg->data.size() + size + 8 * sizeof(uint32_t));

uint32_t nupdates = 0;
uint32_t words [4];
Expand Down Expand Up @@ -535,7 +533,11 @@ class DQMImplNet : public DQMNet
virtual void
sendObjectListToPeers(bool all)
{
uint64_t minreq
= (lat::Time::current()
- lat::TimeSpan(0, 0, 5 /* minutes */, 0, 0)).ns();
typename PeerMap::iterator i, e;
typename ObjectMap::iterator oi, oe;
for (i = peers_.begin(), e = peers_.end(); i != e; ++i)
{
ImplPeer &p = i->second;
Expand All @@ -549,6 +551,9 @@ class DQMImplNet : public DQMNet
Bucket msg;
msg.next = 0;
sendObjectListToPeer(&msg, !p.updated || all, true);
for (oi = p.objs.begin(), oe = p.objs.end(); oi != oe; ++oi)
if (oi->lastreq && oi->lastreq < minreq)
const_cast<ObjType &>(*oi).lastreq = 0;

if (! msg.data.empty())
{
Expand Down
22 changes: 12 additions & 10 deletions trunk/DQMServices/Core/src/DQMNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
if (debug_)
logme()
<< "DEBUG: received message 'UPDATE ME' from peer "
<< p->peeraddr << std::endl;
<< p->peeraddr << ", size " << len << std::endl;

p->update = true;
}
Expand All @@ -486,7 +486,7 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
if (debug_)
logme()
<< "DEBUG: received message 'LIST OBJECTS' from peer "
<< p->peeraddr << std::endl;
<< p->peeraddr << ", size " << len << std::endl;

// Send over current status: list of known objects.
sendObjectListToPeer(msg, true, false);
Expand All @@ -498,7 +498,7 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
if (debug_)
logme()
<< "DEBUG: received message 'GET OBJECT' from peer "
<< p->peeraddr << std::endl;
<< p->peeraddr << ", size " << len << std::endl;

if (len < 3*sizeof(uint32_t))
{
Expand Down Expand Up @@ -564,7 +564,8 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
logme()
<< "DEBUG: received message 'LIST BEGIN "
<< (flags ? "FULL" : "INCREMENTAL")
<< "' from " << p->peeraddr << std::endl;
<< "' from " << p->peeraddr
<< ", size " << len << std::endl;

// If we are about to receive a full list of objects, flag all
// objects as possibly dead. Subsequent object notifications
Expand Down Expand Up @@ -602,7 +603,8 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
logme()
<< "DEBUG: received message 'LIST END "
<< (flags ? "FULL" : "INCREMENTAL")
<< "' from " << p->peeraddr << std::endl;
<< "' from " << p->peeraddr
<< ", size " << len << std::endl;

// Indicate we have received another update from this peer.
// Also indicate we should flush to our clients.
Expand Down Expand Up @@ -650,7 +652,8 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
if (debug_)
logme()
<< "DEBUG: received message 'OBJECT " << name
<< "' from " << p->peeraddr << std::endl;
<< "' from " << p->peeraddr
<< ", size " << len << std::endl;

// Mark the peer as a known object source.
p->source = true;
Expand Down Expand Up @@ -710,14 +713,13 @@ DQMNet::onMessage(Bucket *msg, Peer *p, unsigned char *data, size_t len)
}

unsigned char *namedata = data + sizeof(words);
unsigned char *enddata = namedata + namelen;
std::string name ((char *) namedata, namelen);
assert (enddata == data + len);
std::string name((char *) namedata, namelen);

if (debug_)
logme()
<< "DEBUG: received message 'NONE " << name
<< "' from " << p->peeraddr << std::endl;
<< "' from " << p->peeraddr
<< ", size " << len << std::endl;

// Mark the peer as a known object source.
p->source = true;
Expand Down
1 change: 1 addition & 0 deletions trunk/DQMServices/Core/src/DQMService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ DQMService::flush(const edm::Event &, const edm::EventSetup &)
if (! me.wasUpdated())
continue;

o.lastreq = 0;
o.hash = DQMNet::dqmhash(fullpath.c_str(), fullpath.size());
o.flags = me.data_.flags;
o.tag = me.data_.tag;
Expand Down

0 comments on commit 04a03fb

Please sign in to comment.