52 #define TBUFSIZE (1 << 15)
58 static unsigned long tbuf_[
TBUFSIZE];
64 static unsigned long t__;
68 tbuf_[itbuf_++] = t__; \
71 #define TBUF tbuf_[itbuf_++] = (unsigned long) DCMF_Timebase();
90 #define PHASE2BUFFER_SIZE 2048
91 #define PHASE2BUFFER_MASK (PHASE2BUFFER_SIZE - 1)
101 #define MULTISEND_RECEIVEBUFFER_SIZE 10000
107 void incoming(
int gid,
double spiketime);
233 PreSyn* ps = iter->second;
234 if (
use_phase2_ && ps->bgp.multisend_send_phase2_) {
258 void Multisend_ReceiveBuffer::enqueue1() {
267 PreSyn* ps = iter->second;
269 if (
use_phase2_ && ps->bgp.multisend_send_phase2_) {
283 void Multisend_ReceiveBuffer::enqueue2() {
340 for (
int i = 0;
i <= itbuf_; ++
i) {
430 static void mymulticast(DCMF_Multicast_t* arg) {
433 static void myrestart(DCMF_Request_t* arg) {
500 tbuf_[itbuf_++] = (
unsigned long)
ncons;
502 tbuf_[itbuf_++] = (
unsigned long)
s;
503 tbuf_[itbuf_++] = (
unsigned long) r;
504 tbuf_[itbuf_++] = 0UL;
527 tbuf_[itbuf_++] = tfind;
528 tbuf_[itbuf_++] = tsend;
549 if (ps->bgp.multisend_send_)
554 if (ps && ps->bgp.multisend_send_) {
556 delete ps->bgp.multisend_send_;
557 ps->bgp.multisend_send_ = 0;
560 delete ps->bgp.multisend_send_phase2_;
561 ps->bgp.multisend_send_phase2_ = 0;
570 for (
const auto& iter:
gid2in_) {
583 #if WORK_AROUND_RECORD_BUG
592 for (
int i = 0;
i < nold; ++
i) {
650 int ncs_multisend_sending_info(
int** sendlist2build) {
653 if (iter.second->output_index_ >= 0) {
658 *sendlist2build = nsrcgid ?
new int[nsrcgid] : 0;
660 for (
const auto& iter:
gid2out) {
663 (*sendlist2build)[
i] = ps->
gid_;
676 int ncs_multisend_target_hosts(
int gid,
int** targetnodes) {
679 PreSyn* ps = iter->second;
680 if (ps->bgp.multisend_send_) {
681 (*targetnodes) = ps->bgp.multisend_send_->ntarget_hosts_
682 ?
new int[ps->bgp.multisend_send_->ntarget_hosts_]
684 return ps->bgp.multisend_send_->ntarget_hosts_;
691 int ncs_multisend_target_info(
int** presyngids) {
699 for (
const auto& iter:
gid2in_) {
702 if (ps->bgp.srchost_ != -1) {
709 (*presyngids) = nsrcgid ?
new int[nsrcgid] : 0;
712 for (
const auto& iter:
gid2in_) {
715 if (ps->bgp.srchost_ != -1) {
716 (*presyngids)[
i] = ps->
gid_;
724 int ncs_multisend_mindelays(
int** srchost,
double** delays) {
727 for (
const auto& iter:
gid2in_) {
730 if (ps->bgp.srchost_ != -1) {
735 (*delays) = nsrcgid ?
new double[nsrcgid] : 0;
736 (*srchost) = nsrcgid ?
new int[nsrcgid] : 0;
739 for (
const auto& iter:
gid2in_) {
742 if (ps->bgp.srchost_ != -1) {
744 (*srchost)[
i] = ps->bgp.srchost_;
static void nrnmpi_barrier()
void incoming(int gid, double spiketime)
Multisend_ReceiveBuffer()
unsigned long long timebase_
virtual ~Multisend_ReceiveBuffer()
Phase2Buffer * phase2_buffer_
Multisend_Send_Phase2()=default
virtual ~Multisend_Send_Phase2()
void send_phase2(int gid, double t, Multisend_ReceiveBuffer *)
int * target_hosts_phase2_
int ntarget_hosts_phase2_
void send(int gid, double t)
virtual ~Multisend_Send()
int ntarget_hosts_phase1_
virtual void send(double sendtime, NetCvode *, NrnThread *)
void vector_resize(IvocVect *v, int n)
IvocVect * vector_arg(int i)
static double nrnmpi_wtime()
double * vector_vec(IvocVect *v)
void nrn2ncs_outputevent(int netcon_output_index, double firetime)
void nrn_outputevent(unsigned char, double)
void nrn_multisend_receive(NrnThread *)
void nrn_multisend_advance()
NetCvode * net_cvode_instance
std::map< int, PreSyn * > gid2out
Maps for ouput and input presyns.
#define nrn_assert(x)
assert()-like macro, independent of NDEBUG status
#define MULTISEND_RECEIVEBUFFER_SIZE
Pool< NRNMPI_Spike > SpkPool
void nrn_multisend_setup()
TBUF void nrn_multisend_send(PreSyn *ps, double t)
void nrn_multisend_cleanup_presyn(PreSyn *ps)
static Multisend_ReceiveBuffer * multisend_receive_buffer[2]
void nrnmpi_multisend_comm()
#define PHASE2BUFFER_MASK
static void nrn_multisend_init()
int nrnmpi_multisend_single_advance(NRNMPI_Spike *)
static void nrn_multisend_cleanup()
static int multisend_advance()
static int max_multisend_targets
static unsigned long enq2_enqueue_time_
void nrnmpi_multisend_multisend(NRNMPI_Spike *, int, int *)
int nrnmpi_multisend_conserve(int nsend, int nrecv)
static int max_ntarget_host
static unsigned long enq2_find_time_
multisend_receive_buffer[current_rbuf] phase2_nsend_
double nrn_multisend_receive_time(int type)
multisend_receive_buffer[current_rbuf] phase2_nsend_cell_
#define PHASE2BUFFER_SIZE
static void setup_presyn_multisend_lists()
static Gid2PreSyn gid2out_
static Gid2PreSyn gid2in_
static int n_multisend_interval
Represent main neuron object computed by single thread.