#include <srtable.h>
Public Member Functions | |
SRtable () | |
Basic constructor. | |
~SRtable () | |
Destructor. | |
void | pup (PUP::er &p) |
PUP routine. | |
void | Initialize () |
Initialize table to a minimum size. | |
void | Insert (POSE_TimeType ts, int sr) |
Insert send/recv record sr at timestamp ts. | |
void | Insert (SRentry *e) |
Insert an existing SRentry e. | |
void | Restructure (POSE_TimeType newGVTest, POSE_TimeType firstTS, int firstSR) |
Restructure the table according to new GVT estimate and first send/recv. | |
void | MapToBuckets (SRentry *bkt, SRentry *endBkt, int *s, int *r) |
Move contents of bkt to new bucket structure. | |
UpdateMsg * | PackTable (POSE_TimeType pvt, POSE_TimeType *maxSRb) |
Compress and pack table into an UpdateMsg and return it. | |
void | SortTable () |
CompressAndSort all buckets. | |
void | CompressAndSortBucket (POSE_TimeType i, int is_overflow) |
Compress a bucket so all SRentries have unique timestamps and are sorted. | |
void | FreeTable () |
Free all buckets and overflows, reset all counts. | |
void | dump () |
Dump data fields. | |
char * | dumpString () |
Dump data fields to a string. | |
void | sanitize () |
Check validity of data fields. | |
void | self_test () |
Test this class. | |
Data Fields | |
POSE_TimeType | offset |
Base timestamp to index tables. | |
int | b |
Number of buckets to sort sends/recvs into. | |
int | size_b |
Size of each bucket. | |
SRentry * | buckets [MAX_B] |
The buckets to sort sends/recvs into. | |
SRentry * | end_bucket [MAX_B] |
Pointers to the last entry of each bucket. | |
int | sends [MAX_B] |
Error checking on bucket counts. | |
int | recvs [MAX_B] |
int | ofSends |
int | ofRecvs |
SRentry * | overflow |
The overflow bucket. | |
SRentry * | end_overflow |
End entry of overflow. | |
int | numEntries [MAX_B] |
Number of distinct timestamp entries per bucket. | |
int | numOverflow |
Number of distinct entries in overflow bucket. |
This class is used in GVT to keep track of messages sent/received
Definition at line 109 of file srtable.h.
SRtable::SRtable | ( | ) |
Basic constructor.
Initializes all data fields
Definition at line 21 of file srtable.C.
References buckets, end_bucket, numEntries, recvs, and sends.
SRtable::~SRtable | ( | ) | [inline] |
Destructor.
Definition at line 144 of file srtable.h.
References FreeTable().
void SRtable::pup | ( | PUP::er & | p | ) | [inline] |
PUP routine.
Definition at line 146 of file srtable.h.
References b, buckets, end_bucket, end_overflow, PUP::er::isUnpacking(), SRentry::next, numEntries, numOverflow, offset, ofRecvs, ofSends, overflow, SRentry::pup(), PUP::PUParray(), recvs, sends, and size_b.
Referenced by PVT::pup().
void SRtable::Initialize | ( | ) |
void SRtable::Insert | ( | POSE_TimeType | ts, | |
int | sr | |||
) | [inline] |
Insert send/recv record sr at timestamp ts.
Definition at line 221 of file srtable.h.
References b, buckets, end_bucket, end_overflow, SRentry::next, offset, ofRecvs, ofSends, overflow, recvs, SRentry::recvs, sanitize(), sends, SRentry::sends, size_b, and SRentry::timestamp.
Referenced by PVT::objUpdate(), and Restructure().
void SRtable::Insert | ( | SRentry * | e | ) | [inline] |
Insert an existing SRentry e.
Definition at line 268 of file srtable.h.
References b, buckets, end_bucket, end_overflow, SRentry::next, offset, ofRecvs, ofSends, overflow, recvs, SRentry::recvs, sanitize(), sends, SRentry::sends, size_b, and SRentry::timestamp.
void SRtable::Restructure | ( | POSE_TimeType | newGVTest, | |
POSE_TimeType | firstTS, | |||
int | firstSR | |||
) |
Restructure the table according to new GVT estimate and first send/recv.
Number of buckets and bucket size are determined from firstTS, and entries below newGVTest are discarded.
Number of buckets and bucket size are determined from firstTS, and entries below newGVTest are discarded.
Definition at line 42 of file srtable.C.
References b, buckets, CompressAndSortBucket(), PUP::d, end_bucket, end_overflow, Insert(), MapToBuckets(), SRentry::next, offset, ofRecvs, ofSends, overflow, SRentry::recvs, recvs, sanitize(), SRentry::sends, sends, size_b, and SRentry::timestamp.
Referenced by PVT::objUpdate(), and PVT::startPhase().
Move contents of bkt to new bucket structure.
Definition at line 188 of file srtable.C.
References b, buckets, end_bucket, end_overflow, SRentry::next, offset, ofRecvs, ofSends, overflow, recvs, SRentry::recvs, sanitize(), sends, SRentry::sends, size_b, and SRentry::timestamp.
Referenced by Restructure().
UpdateMsg * SRtable::PackTable | ( | POSE_TimeType | pvt, | |
POSE_TimeType * | maxSRb | |||
) |
Compress and pack table into an UpdateMsg and return it.
Definition at line 284 of file srtable.C.
References b, buckets, SRentry::next, offset, overflow, POSE_UnsetTS, SRentry::recvs, sanitize(), SRentry::sends, size_b, SortTable(), and SRentry::timestamp.
Referenced by PVT::startPhase().
void SRtable::SortTable | ( | ) |
CompressAndSort all buckets.
Definition at line 359 of file srtable.C.
References b, CompressAndSortBucket(), and sanitize().
Referenced by PackTable().
void SRtable::CompressAndSortBucket | ( | POSE_TimeType | i, | |
int | is_overflow | |||
) |
Compress a bucket so all SRentries have unique timestamps and are sorted.
Definition at line 373 of file srtable.C.
References buckets, end_bucket, end_overflow, SRentry::next, numEntries, numOverflow, overflow, SRentry::recvs, sanitize(), SRentry::sends, and SRentry::timestamp.
Referenced by Restructure(), and SortTable().
void SRtable::FreeTable | ( | ) |
Free all buckets and overflows, reset all counts.
Definition at line 476 of file srtable.C.
References b, buckets, SRentry::next, numEntries, offset, ofRecvs, ofSends, overflow, recvs, sanitize(), sends, and size_b.
Referenced by ~SRtable().
void SRtable::dump | ( | ) |
Dump data fields.
Definition at line 503 of file srtable.C.
References b, buckets, SRentry::dump(), SRentry::next, offset, overflow, and size_b.
char * SRtable::dumpString | ( | ) |
Dump data fields to a string.
Definition at line 526 of file srtable.C.
References b, buckets, SRentry::dumpString(), SRentry::next, overflow, and snprintf().
void SRtable::sanitize | ( | ) |
Check validity of data fields.
Check validity of data field.
Definition at line 556 of file srtable.C.
References b, buckets, end_bucket, end_overflow, SRentry::next, offset, ofRecvs, ofSends, overflow, recvs, SRentry::recvs, SRentry::sanitize(), sends, SRentry::sends, size_b, and SRentry::timestamp.
Referenced by CompressAndSortBucket(), FreeTable(), Insert(), MapToBuckets(), PackTable(), Restructure(), and SortTable().
void SRtable::self_test | ( | ) |
Test this class.
Base timestamp to index tables.
offset is the current GVT
Definition at line 113 of file srtable.h.
Referenced by dump(), FreeTable(), Initialize(), Insert(), MapToBuckets(), PackTable(), pup(), Restructure(), and sanitize().
Number of buckets to sort sends/recvs into.
Recomputed with each new offset
Definition at line 116 of file srtable.h.
Referenced by dump(), dumpString(), FreeTable(), Initialize(), Insert(), MapToBuckets(), PackTable(), pup(), Restructure(), sanitize(), and SortTable().
Size of each bucket.
Recomputed with each new offset
Definition at line 119 of file srtable.h.
Referenced by dump(), FreeTable(), Initialize(), Insert(), MapToBuckets(), PackTable(), pup(), Restructure(), and sanitize().
SRentry* SRtable::buckets[MAX_B] |
The buckets to sort sends/recvs into.
Only entries [0..b-1] are used
Definition at line 122 of file srtable.h.
Referenced by CompressAndSortBucket(), dump(), dumpString(), FreeTable(), Insert(), MapToBuckets(), PackTable(), pup(), Restructure(), sanitize(), and SRtable().
SRentry* SRtable::end_bucket[MAX_B] |
Pointers to the last entry of each bucket.
Only entries [0..b-1] are used
Definition at line 125 of file srtable.h.
Referenced by CompressAndSortBucket(), Insert(), MapToBuckets(), pup(), Restructure(), sanitize(), and SRtable().
int SRtable::sends[MAX_B] |
Error checking on bucket counts.
Definition at line 127 of file srtable.h.
Referenced by FreeTable(), Insert(), MapToBuckets(), pup(), Restructure(), sanitize(), and SRtable().
int SRtable::recvs[MAX_B] |
Definition at line 127 of file srtable.h.
Referenced by FreeTable(), Insert(), MapToBuckets(), pup(), Restructure(), sanitize(), and SRtable().
Definition at line 127 of file srtable.h.
Referenced by FreeTable(), Insert(), MapToBuckets(), pup(), Restructure(), and sanitize().
Definition at line 127 of file srtable.h.
Referenced by FreeTable(), Insert(), MapToBuckets(), pup(), Restructure(), and sanitize().
The overflow bucket.
What doesn't fit in buckets goes here
Definition at line 130 of file srtable.h.
Referenced by CompressAndSortBucket(), dump(), dumpString(), FreeTable(), Insert(), MapToBuckets(), PackTable(), pup(), Restructure(), and sanitize().
End entry of overflow.
Definition at line 132 of file srtable.h.
Referenced by CompressAndSortBucket(), Insert(), MapToBuckets(), pup(), Restructure(), and sanitize().
int SRtable::numEntries[MAX_B] |
Number of distinct timestamp entries per bucket.
This is computed in CompressAndSortBucket
Definition at line 135 of file srtable.h.
Referenced by CompressAndSortBucket(), FreeTable(), pup(), and SRtable().
Number of distinct entries in overflow bucket.
This is computed in CompressAndSortBucket
Definition at line 138 of file srtable.h.
Referenced by CompressAndSortBucket(), and pup().