Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install NEST
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install cython
python -m pip install "cython<3.1.0"
wget https://github.com/nest/nest-simulator/archive/refs/tags/v3.8.tar.gz -O nest-simulator-3.8.tar.gz
tar xzf nest-simulator-3.8.tar.gz
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -Dwith-mpi=ON ./nest-simulator-3.8
Expand Down
9 changes: 7 additions & 2 deletions pyNN/neuron/nmodl/gif.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ VERBATIM
#include<stdio.h>
#include<math.h>

#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM

ASSIGNED {
Expand Down Expand Up @@ -199,7 +204,7 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
value = nrn_random_pick(_p_rng);
value = nrn_random_pick(RANDCAST _p_rng);
//printf("random stream for this simulation = %lf\n",value);
return value;
}else{
Expand All @@ -208,7 +213,7 @@ ENDVERBATIM
: independent of nhost or which host this instance is on
: is desired, since each instance on this cpu draws from
: the same stream
value = scop_random(1)
value = scop_random()
VERBATIM
}
ENDVERBATIM
Expand Down
7 changes: 6 additions & 1 deletion pyNN/neuron/nmodl/netstim2.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ FUNCTION invl(mean (ms)) (ms) {
}
}
VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM

FUNCTION erand() {
Expand All @@ -84,7 +89,7 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
_lerand = nrn_random_pick(_p_donotuse);
_lerand = nrn_random_pick(RANDCAST _p_donotuse);
}else{
/* only can be used in main thread */
if (_nt != nrn_threads) {
Expand Down
9 changes: 7 additions & 2 deletions pyNN/neuron/nmodl/quantal_stp.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ NET_RECEIVE(w, available, t_last (ms)) {
}

VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM

PROCEDURE setRNG() {
Expand All @@ -110,12 +115,12 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
value = nrn_random_pick(_p_rng);
value = nrn_random_pick(RANDCAST _p_rng);
//printf("random stream for this simulation = %lf\n",value);
return value;
} else {
ENDVERBATIM
value = scop_random(1)
value = scop_random()
VERBATIM
}
ENDVERBATIM
Expand Down
9 changes: 7 additions & 2 deletions pyNN/neuron/nmodl/stochastic_synapse.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ VERBATIM
#include<stdio.h>
#include<math.h>

#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif

ENDVERBATIM

Expand Down Expand Up @@ -63,12 +68,12 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
value = nrn_random_pick(_p_rng);
value = nrn_random_pick(RANDCAST _p_rng);
//printf("random stream for this simulation = %lf\n",value);
return value;
} else {
ENDVERBATIM
value = scop_random(1)
value = scop_random()
VERBATIM
}
ENDVERBATIM
Expand Down
9 changes: 7 additions & 2 deletions pyNN/neuron/nmodl/stochastic_tsodyksmarkram.mod
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ NET_RECEIVE(w, p_surv, t_surv) {
}

VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM

PROCEDURE setRNG() {
Expand All @@ -113,12 +118,12 @@ VERBATIM
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.negexp(1)
*/
value = nrn_random_pick(_p_rng);
value = nrn_random_pick(RANDCAST _p_rng);
//printf("random stream for this simulation = %lf\n",value);
return value;
} else {
ENDVERBATIM
value = scop_random(1)
value = scop_random()
VERBATIM
}
ENDVERBATIM
Expand Down
1 change: 1 addition & 0 deletions pyNN/neuron/nmodl/tsodyksmarkram.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Andrew Davison, UNIC, CNRS, 2013
ENDCOMMENT

NEURON {
THREADSAFE
POINT_PROCESS TsodyksMarkramWA
RANGE tau_rec, tau_facil, U, u0, tau_syn
POINTER wsyn
Expand Down
12 changes: 7 additions & 5 deletions pyNN/neuron/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ def load_mechanisms(path):
else:
arch_list = [platform.machine(), 'i686', 'x86_64', 'powerpc', 'umac']
for arch in arch_list:
lib_path = os.path.join(path, arch, '.libs', 'libnrnmech.so')
if os.path.exists(lib_path):
h.nrn_load_dll(lib_path)
nrn_dll_loaded.append(path)
return
path_list = ['.so', '.dylib']
for p in path_list:
lib_path = os.path.join(path, arch, f'libnrnmech{p}')
if os.path.exists(lib_path):
h.nrn_load_dll(lib_path)
nrn_dll_loaded.append(path)
return
raise IOError(
f"NEURON mechanisms not found in {path}. "
"You may need to run 'nrnivmodl' in this directory.")
Expand Down
Loading