Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions coreneuron/network/netcvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ void NetCvodeThreadData::enqueue(NetCvode* nc, NrnThread* nt) {
for (size_t i = 0; i < inter_thread_events_.size(); ++i) {
InterThreadEvent ite = inter_thread_events_[i];
nc->bin_event(ite.t_, ite.de_, nt);
#if COLLECT_TQueue_STATISTICS
/// TQueue::qtype::ite = 2
tqe_->record_stat_event(2, ite.t_);
#endif
}
inter_thread_events_.clear();
MUTUNLOCK
Expand Down Expand Up @@ -525,11 +521,6 @@ void InputPreSyn::send(double tt, NetCvode* ns, NrnThread* nt) {
if (d->active_ && d->target_) {
NrnThread* n = PP2NT(d->target_);

#if COLLECT_TQueue_STATISTICS
/// TQueue::qtype::spike = 1
ns->p[nt->id].tqe_->record_stat_event(1, tt);
#endif

if (nt == n)
ns->bin_event(tt + d->delay_, d, n);
else
Expand Down Expand Up @@ -769,11 +760,6 @@ void NetCvode::deliver_net_events(NrnThread* nt) { // for default method
}
#endif

#if COLLECT_TQueue_STATISTICS
/// TQueue::qtype::deq = 3
p[tid].tqe_->record_stat_event(3, q->t_);
#endif

delete q;
db->deliver(nt->_t, this, nt);
}
Expand Down
14 changes: 0 additions & 14 deletions coreneuron/network/tqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ THE POSSIBILITY OF SUCH DAMAGE.
#include "coreneuron/sim/multicore.hpp"
#include "coreneuron/network/tqueue.hpp"

#if COLLECT_TQueue_STATISTICS
#define STAT(arg) ++arg;
#else
#define STAT(arg) /**/
#endif
namespace coreneuron {
// splay tree + bin queue limited to fixed step method
// for event-sets or priority queues
Expand All @@ -65,9 +60,6 @@ BinQ::BinQ() {
}
qpt_ = 0;
tt_ = 0.;
#if COLLECT_TQueue_STATISTICS
nfenq = nfdeq = 0;
#endif
}

BinQ::~BinQ() {
Expand Down Expand Up @@ -115,17 +107,11 @@ void BinQ::enqueue(double td, TQItem* q) {
q->cnt_ = idt; // only for iteration
q->left_ = bins_[idt];
bins_[idt] = q;
#if COLLECT_TQueue_STATISTICS
++nfenq;
#endif
}
TQItem* BinQ::dequeue() {
TQItem* q = bins_[qpt_];
if (q) {
bins_[qpt_] = q->left_;
#if COLLECT_TQueue_STATISTICS
++nfdeq;
#endif
}
return q;
}
Expand Down
17 changes: 0 additions & 17 deletions coreneuron/network/tqueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ THE POSSIBILITY OF SUCH DAMAGE.
#include "coreneuron/utils/nrnmutdec.h"

namespace coreneuron {
#define COLLECT_TQueue_STATISTICS 0
#define STRCMP(a, b) (a - b)

class TQItem;
Expand Down Expand Up @@ -134,10 +133,6 @@ class BinQ {
TQItem* next(TQItem*);
void remove(TQItem*);
void resize(int);
#if COLLECT_TQueue_STATISTICS
public:
int nfenq, nfdeq;
#endif
private:
double tt_; // time at beginning of qpt_ interval
int nbin_, qpt_;
Expand Down Expand Up @@ -172,21 +167,13 @@ class TQueue {
inline TQItem* atomic_dq(double til);
inline void remove(TQItem*);
inline void move(TQItem*, double tnew);
#if COLLECT_TQueue_STATISTICS
inline void statistics();
inline void record_stat_event(int type, double time);
#endif
int nshift_;

/// Priority queue of vectors for queuing the events. enqueuing for move() and
/// move_least_nolock() is not implemented
std::priority_queue<TQPair, std::vector<TQPair>, less_time> pq_que_;
/// Types of queuing statistics
enum qtype { enq = 0, spike, ite, deq };
#if COLLECT_TQueue_STATISTICS
/// Map for queuing statistics
std::map<double, long> time_map_events[4];
#endif

private:
double least_t_nolock() {
Expand All @@ -208,10 +195,6 @@ class TQueue {
return TQPair(p->t_, p);
}
MUTDEC
#if COLLECT_TQueue_STATISTICS
unsigned long ninsert, nrem, nleast, nbal, ncmplxrem;
unsigned long ncompare, nleastsrch, nfind, nfindsrch, nmove, nfastmove;
#endif
};
} // namespace coreneuron
#include "coreneuron/network/tqueue.ipp"
Expand Down
58 changes: 0 additions & 58 deletions coreneuron/network/tqueue.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ THE POSSIBILITY OF SUCH DAMAGE.
#include "coreneuron/sim/multicore.hpp"
#include "coreneuron/network/tqueue.hpp"

#if COLLECT_TQueue_STATISTICS
#define STAT(arg) ++arg;
#else
#define STAT(arg) /**/
#endif
namespace coreneuron {
// splay tree + bin queue limited to fixed step method
// for event-sets or priority queues
Expand All @@ -62,11 +57,6 @@ TQueue<C>::TQueue() {
spinit(sptree_);
binq_ = new BinQ;
least_ = 0;

#if COLLECT_TQueue_STATISTICS
nmove = ninsert = nrem = nleast = nbal = ncmplxrem = 0;
nfastmove = ncompare = nleastsrch = nfind = nfindsrch = 0;
#endif
}

template <container C>
Expand Down Expand Up @@ -102,10 +92,6 @@ TQueue<C>::~TQueue() {
template <container C>
TQItem* TQueue<C>::enqueue_bin(double td, void* d) {
MUTLOCK
#if COLLECT_TQueue_STATISTICS
STAT(ninsert);
record_stat_event(enq, td);
#endif
TQItem* i = new TQItem;
i->data_ = d;
i->t_ = td;
Expand All @@ -114,24 +100,6 @@ TQItem* TQueue<C>::enqueue_bin(double td, void* d) {
return i;
}

#if COLLECT_TQueue_STATISTICS
template <container C>
void TQueue<C>::record_stat_event(int type, double time) {
if (time_map_events[type].find(time) == time_map_events[type].end())
time_map_events[type][time] = 1;
else
++time_map_events[type][time];
}

template <container C>
void TQueue<C>::statistics() {
printf("insertions=%lu moves=%lu removals=%lu calls to least=%lu\n", ninsert, nmove, nrem,
nleast);
printf("calls to find=%lu\n", nfind);
printf("comparisons=%d\n", sptree_->enqcmps);
}
#endif

/// Splay tree priority queue implementation
template <>
inline void TQueue<spltree>::move_least_nolock(double tnew) {
Expand Down Expand Up @@ -167,7 +135,6 @@ inline void TQueue<pq_que>::move_least_nolock(double tnew) {
template <>
inline void TQueue<spltree>::move(TQItem* i, double tnew) {
MUTLOCK
STAT(nmove)
if (i == least_) {
move_least_nolock(tnew);
} else if (tnew < least_->t_) {
Expand All @@ -187,7 +154,6 @@ inline void TQueue<spltree>::move(TQItem* i, double tnew) {
template <>
inline void TQueue<pq_que>::move(TQItem* i, double tnew) {
MUTLOCK
STAT(nmove)
if (i == least_) {
move_least_nolock(tnew);
} else if (tnew < least_->t_) {
Expand All @@ -213,10 +179,6 @@ inline void TQueue<pq_que>::move(TQItem* i, double tnew) {
template <>
inline TQItem* TQueue<spltree>::insert(double tt, void* d) {
MUTLOCK
#if COLLECT_TQueue_STATISTICS
STAT(ninsert);
record_stat_event(enq, tt);
#endif
TQItem* i = new TQItem;
i->data_ = d;
i->t_ = tt;
Expand All @@ -242,10 +204,6 @@ inline TQItem* TQueue<spltree>::insert(double tt, void* d) {
template <>
inline TQItem* TQueue<pq_que>::insert(double tt, void* d) {
MUTLOCK
#if COLLECT_TQueue_STATISTICS
STAT(ninsert);
record_stat_event(enq, tt);
#endif
TQItem* i = new TQItem;
i->data_ = d;
i->t_ = tt;
Expand All @@ -271,10 +229,6 @@ inline TQItem* TQueue<pq_que>::insert(double tt, void* d) {
template <>
inline void TQueue<spltree>::remove(TQItem* q) {
MUTLOCK
#if COLLECT_TQueue_STATISTICS
STAT(nrem);
record_stat_event(deq, q->t_);
#endif
if (q) {
if (q == least_) {
if (sptree_->root) {
Expand All @@ -294,10 +248,6 @@ inline void TQueue<spltree>::remove(TQItem* q) {
template <>
inline void TQueue<pq_que>::remove(TQItem* q) {
MUTLOCK
#if COLLECT_TQueue_STATISTICS
STAT(nrem);
record_stat_event(deq, q->t_);
#endif
if (q) {
if (q == least_) {
if (pq_que_.size()) {
Expand All @@ -320,10 +270,6 @@ inline TQItem* TQueue<spltree>::atomic_dq(double tt) {
MUTLOCK
if (least_ && least_->t_ <= tt) {
q = least_;
#if COLLECT_TQueue_STATISTICS
STAT(nrem);
record_stat_event(deq, tt);
#endif
if (sptree_->root) {
least_ = spdeq(&sptree_->root);
} else {
Expand All @@ -341,10 +287,6 @@ inline TQItem* TQueue<pq_que>::atomic_dq(double tt) {
MUTLOCK
if (least_ && least_->t_ <= tt) {
q = least_;
#if COLLECT_TQueue_STATISTICS
STAT(nrem);
record_stat_event(deq, tt);
#endif
// int qsize = pq_que_.size();
// printf("map size: %d\n", msize);
/// This while loop is to delete events whose times have been moved with the ::move
Expand Down
Loading