NEURON
multicore.cpp File Reference
#include "multicore.h"
#include <nrnmpi.h>
#include "hoclist.h"
#include "section.h"
#include "nmodlmutex.h"
#include <cstdint>
#include <condition_variable>
#include <mutex>
#include <thread>
#include <utility>
#include <variant>
#include <vector>
#include <iostream>
#include <queue>

Go to the source code of this file.

Namespaces

 nrn
 

Macros

#define CACHELINE_ALLOC(name, type, size)    name = (type*) nrn_cacheline_alloc((void**) &name, size * sizeof(type))
 
#define CACHELINE_CALLOC(name, type, size)    name = (type*) nrn_cacheline_calloc((void**) &name, size, sizeof(type))
 

Functions

void spDestroy (char *)
 
void nrn_mk_table_check ()
 
static void * nulljob (NrnThread *nt)
 
void nrn_thread_error (const char *s)
 
void nrn_threads_create (int n, bool parallel)
 
void nrn_fast_imem_alloc ()
 
void nrn_threads_free ()
 
static void thread_memblist_setup (NrnThread *_nt, int *mlcnt, void **vmap)
 
void nrn_thread_memblist_setup ()
 
void reorder_secorder ()
 
void nrn_thread_table_check (neuron::model_sorted_token const &sorted_token)
 
void nrn_hoc_lock ()
 
void nrn_hoc_unlock ()
 
void nrn_multithread_job (worker_job_t job)
 
void nrn_multithread_job (neuron::model_sorted_token const &cache_token, worker_job_with_token_t job)
 
void nrn_onethread_job (int i, void *(*job)(NrnThread *))
 
void nrn_wait_for_threads ()
 
void nrn_thread_partition (int it, Object *sl)
 
Object ** nrn_get_thread_partition (int it)
 
int nrn_user_partition ()
 
void nrn_use_busywait (int b)
 
int nrn_allow_busywait (int b)
 
int nrn_how_many_processors ()
 
std::size_t nof_worker_threads ()
 

Variables

int nrn_nthread
 
NrnThreadnrn_threads
 
void(* nrn_mk_transfer_thread_data_ )()
 
static int busywait_
 
static int busywait_main_
 
void(* nrn_multisplit_setup_ )()
 
int v_structure_change
 
int diam_changed
 
Section ** secorder
 
int section_count
 
static std::vector< std::pair< int, NrnThreadMembList * > > table_check_
 
static int allow_busywait_
 
int nrn_inthread_
 
std::unique_ptr< std::mutex > nrn::nmodlmutex
 

Macro Definition Documentation

◆ CACHELINE_ALLOC

#define CACHELINE_ALLOC (   name,
  type,
  size 
)     name = (type*) nrn_cacheline_alloc((void**) &name, size * sizeof(type))

Definition at line 52 of file multicore.cpp.

◆ CACHELINE_CALLOC

#define CACHELINE_CALLOC (   name,
  type,
  size 
)     name = (type*) nrn_cacheline_calloc((void**) &name, size, sizeof(type))

Definition at line 54 of file multicore.cpp.

Function Documentation

◆ nof_worker_threads()

std::size_t nof_worker_threads ( )

Definition at line 1048 of file multicore.cpp.

◆ nrn_allow_busywait()

int nrn_allow_busywait ( int  b)

Definition at line 1032 of file multicore.cpp.

◆ nrn_fast_imem_alloc()

void nrn_fast_imem_alloc ( )

Definition at line 377 of file multicore.cpp.

◆ nrn_get_thread_partition()

Object** nrn_get_thread_partition ( int  it)

Definition at line 921 of file multicore.cpp.

◆ nrn_how_many_processors()

int nrn_how_many_processors ( )

Definition at line 1038 of file multicore.cpp.

◆ nrn_mk_table_check()

void nrn_mk_table_check ( void  )

Definition at line 781 of file multicore.cpp.

◆ nrn_multithread_job() [1/2]

void nrn_multithread_job ( neuron::model_sorted_token const &  cache_token,
worker_job_with_token_t  job 
)

Definition at line 855 of file multicore.cpp.

◆ nrn_multithread_job() [2/2]

void nrn_multithread_job ( worker_job_t  job)

Definition at line 836 of file multicore.cpp.

◆ nrn_onethread_job()

void nrn_onethread_job ( int  i,
void *(*)(NrnThread *)  job 
)

Definition at line 875 of file multicore.cpp.

◆ nrn_thread_error()

void nrn_thread_error ( const char *  s)

Definition at line 297 of file multicore.cpp.

◆ nrn_thread_memblist_setup()

void nrn_thread_memblist_setup ( )

Definition at line 629 of file multicore.cpp.

◆ nrn_thread_partition()

void nrn_thread_partition ( int  it,
Object sl 
)

Definition at line 899 of file multicore.cpp.

◆ nrn_thread_table_check()

void nrn_thread_table_check ( neuron::model_sorted_token const &  sorted_token)

Definition at line 807 of file multicore.cpp.

◆ nrn_threads_create()

void nrn_threads_create ( int  n,
bool  parallel 
)

Definition at line 303 of file multicore.cpp.

◆ nrn_threads_free()

void nrn_threads_free ( void  )

Definition at line 386 of file multicore.cpp.

◆ nrn_use_busywait()

void nrn_use_busywait ( int  b)

Definition at line 1009 of file multicore.cpp.

◆ nrn_user_partition()

int nrn_user_partition ( )

Definition at line 940 of file multicore.cpp.

◆ nrn_wait_for_threads()

void nrn_wait_for_threads ( )

Definition at line 891 of file multicore.cpp.

◆ nulljob()

static void* nulljob ( NrnThread nt)
static

Definition at line 75 of file multicore.cpp.

◆ reorder_secorder()

void reorder_secorder ( )

Definition at line 661 of file multicore.cpp.

◆ spDestroy()

void spDestroy ( char *  eMatrix)

Definition at line 533 of file spalloc.cpp.

◆ thread_memblist_setup()

static void thread_memblist_setup ( NrnThread _nt,
int *  mlcnt,
void **  vmap 
)
static

Definition at line 457 of file multicore.cpp.

Variable Documentation

◆ allow_busywait_

int allow_busywait_
static

Definition at line 73 of file multicore.cpp.

◆ busywait_

int busywait_
static

Definition at line 62 of file multicore.cpp.

◆ busywait_main_

int busywait_main_
static

Definition at line 63 of file multicore.cpp.

◆ diam_changed

int diam_changed
extern

Definition at line 55 of file cabcode.cpp.

◆ nrn_inthread_

int nrn_inthread_

Definition at line 79 of file multicore.cpp.

◆ nrn_mk_transfer_thread_data_

void(* nrn_mk_transfer_thread_data_) () ( )

Definition at line 60 of file multicore.cpp.

◆ nrn_multisplit_setup_

void(* nrn_multisplit_setup_) () ( )
extern

Definition at line 50 of file treeset.cpp.

◆ nrn_nthread

int nrn_nthread

Definition at line 57 of file multicore.cpp.

◆ nrn_threads

NrnThread * nrn_threads

Definition at line 58 of file multicore.cpp.

◆ secorder

Section** secorder
extern

Definition at line 82 of file solve.cpp.

◆ section_count

int section_count
extern

Definition at line 81 of file solve.cpp.

◆ table_check_

std::vector<std::pair<int, NrnThreadMembList*> > table_check_
static

Definition at line 72 of file multicore.cpp.

◆ v_structure_change

int v_structure_change
extern

Definition at line 65 of file treeset.cpp.