OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
IpplMessageCounter.cpp
Go to the documentation of this file.
2
4
9
11{
12 if(activeRegion>=0 && (unsigned int) activeRegion<counterRegions.size())
14 else
15 return 0;
16}
17
22
27
29{
30 counterRegions.push_back(mcr); return counterRegions.size()-1;
31}
32
38
44
49
54
56{
57 count++;
58 total_size += size;
59 //std::cout << "node " << Ippl::myNode() << " sent message of size " << size << std::endl;
60}
61
62
64{
65 Inform msg("MsgCounter");
66 msg << "Message Counts------------------------------------------------\n";
67 for(unsigned int i=0;i<counterRegions.size();++i)
68 {
69 counterRegions[i]->print(msg);
70 }
71 msg << "--------------------------------------------------------------\n";
72}
73
75{
76 unsigned total_count=0, total_total_size=0;
77 reduce(count, total_count, OpAddAssign());
78 reduce(total_size, total_total_size, OpAddAssign());
79 msg << name << " count = " << total_count << " size = "
80 << total_total_size/(1024.*1024.) << " Mb" << endl;
81}
bool reduce(Communicate &, InputIterator, InputIterator, OutputIterator, const ReduceOp &, bool *IncludeVal=0)
Inform & endl(Inform &inf)
Definition Inform.cpp:42
IpplMessageCounterRegion(const std::string &)
IpplMessageCounterRegion * getActiveRegion()
std::vector< IpplMessageCounterRegion * > counterRegions
static IpplMessageCounter & getInstance()
int addRegion(IpplMessageCounterRegion *)