Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 8ce46a7

Browse files
committed
Merge branch 'master' into magkanar/fix_pdata
2 parents a33bcec + c1093ba commit 8ce46a7

5 files changed

Lines changed: 37 additions & 30 deletions

File tree

.github/workflows/test-as-submodule.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
- name: Install apt packages
4343
if: startsWith(matrix.os, 'ubuntu')
4444
run: |
45+
sudo apt-get update
4546
sudo apt-get install bison cython3 flex libfl-dev libopenmpi-dev \
4647
ninja-build openmpi-bin python3-dev python3-numpy python3-pytest \
4748
python3-pytest-cov
@@ -54,7 +55,8 @@ jobs:
5455
GITHUB_PR_BODY: ${{ github.event.pull_request.body }}
5556
run: |
5657
nrn_branch=`echo "${GITHUB_PR_BODY}" | grep "^CI_BRANCHES" \
57-
| awk -v FS="(NEURON_BRANCH=|,)" '{print $2}'`
58+
| awk -v FS="NEURON_BRANCH=" '{print $2}'` \
59+
| awk -v FS="," '{print $1}'
5860
if [ -z "$nrn_branch" ]; then
5961
nrn_branch=master
6062
fi

.gitlab-ci.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ variables:
1313
NMODL_BRANCH:
1414
description: Branch of NMODL to build CoreNEURON against (NMODL_COMMIT and NMODL_TAG also possible)
1515
value: master
16+
SPACK_BRANCH:
17+
description: Branch of BlueBrain Spack to use for the CI pipeline
18+
value: develop
19+
SPACK_DEPLOYMENT_SUFFIX:
20+
description: Extra path component used when finding deployed software. Set to something like `pulls/1497` use software built for https://github.com/BlueBrain/spack/pull/1497. You probably want to set SPACK_BRANCH to the branch used in the relevant PR if you set this.
21+
value: ''
1622

1723
# Set up Spack
1824
spack_setup:
1925
extends: .spack_setup_ccache
2026
variables:
27+
CORENEURON_COMMIT: ${CI_COMMIT_SHA}
2128
# Enable fetching GitHub PR descriptions and parsing them to find out what
2229
# branches to build of other projects.
2330
PARSE_GITHUB_PR_DESCRIPTIONS: "true"
@@ -26,18 +33,12 @@ simulation_stack:
2633
stage: .pre
2734
# Take advantage of GitHub PR description parsing in the spack_setup job.
2835
needs: [spack_setup]
29-
variables:
30-
CORENEURON_BRANCH: $CI_COMMIT_BRANCH
31-
MODELS_COMMON_BRANCH: $MODELS_COMMON_BRANCH
32-
NEURON_BRANCH: $NEURON_BRANCH
33-
PYNEURODAMUS_BRANCH: $PYNEURODAMUS_BRANCH
34-
REPORTINGLIB_BRANCH: $REPORTINGLIB_BRANCH
35-
SPACK_BRANCH: $SPACK_BRANCH
36-
SYNAPSETOOL_BRANCH: $SYNAPSETOOL_BRANCH
3736
trigger:
3837
project: hpc/sim/blueconfigs
3938
# CoreNEURON CI status depends on the BlueConfigs CI status.
4039
strategy: depend
40+
variables:
41+
SPACK_ENV_FILE_URL: $SPACK_SETUP_COMMIT_MAPPING_URL
4142

4243
# Performance seems to be terrible when we get too many jobs on a single node.
4344
.build:
@@ -82,22 +83,20 @@ build:coreneuron:mod2c:nvhpc:acc:
8283
extends: [.build, .spack_nvhpc]
8384
variables:
8485
SPACK_PACKAGE: coreneuron
85-
# +report pulls in a lot of dependencies and the tests fail.
8686
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
87-
SPACK_PACKAGE_SPEC: +gpu+openmp+tests~legacy-unit~report build_type=RelWithDebInfo
87+
SPACK_PACKAGE_SPEC: +gpu+openmp+tests~legacy-unit build_type=RelWithDebInfo
8888

8989
# Build CoreNEURON with Unified Memory on GPU
9090
build:coreneuron:mod2c:nvhpc:acc:unified:
9191
extends: [.build, .spack_nvhpc]
9292
variables:
9393
SPACK_PACKAGE: coreneuron
94-
# +report pulls in a lot of dependencies and the tests fail.
9594
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
96-
SPACK_PACKAGE_SPEC: +gpu+unified+openmp+tests~legacy-unit~report build_type=RelWithDebInfo
95+
SPACK_PACKAGE_SPEC: +gpu+unified+openmp+tests~legacy-unit build_type=RelWithDebInfo
9796

9897
.build_coreneuron_nmodl:
9998
extends: [.build]
100-
before_script:
99+
variables:
101100
# NEURON depends on py-mpi4py, most of whose dependencies are pulled in by
102101
# nmodl%gcc, with the exception of MPI, which is pulled in by
103102
# coreneuron%{nvhpc,intel}. hpe-mpi is an external package anyway, so
@@ -106,26 +105,23 @@ build:coreneuron:mod2c:nvhpc:acc:unified:
106105
# means that in the NEURON step an existing py-mpi4py%gcc can be used.
107106
# Otherwise a new py-mpi4py with hpe-mpi%{nvhpc,intel} will be built.
108107
# TODO: fix this more robustly so we don't have to play so many games.
109-
- SPACK_PACKAGE_DEPENDENCIES="${SPACK_PACKAGE_DEPENDENCIES}^hpe-mpi%gcc"
110-
- !reference [.spack_build, before_script]
108+
SPACK_PACKAGE_DEPENDENCIES: ^hpe-mpi%gcc
111109

112110
build:coreneuron:nmodl:nvhpc:omp:
113111
extends: [.build_coreneuron_nmodl, .spack_nvhpc]
114112
variables:
115113
SPACK_PACKAGE: coreneuron
116-
# +report pulls in a lot of dependencies and the tests fail.
117114
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
118-
SPACK_PACKAGE_SPEC: +nmodl+openmp+gpu+tests~legacy-unit~report~sympy build_type=RelWithDebInfo
115+
SPACK_PACKAGE_SPEC: +nmodl+openmp+gpu+tests~legacy-unit~sympy build_type=RelWithDebInfo
119116
needs: ["build:nmodl"]
120117

121118
build:coreneuron:nmodl:nvhpc:acc:
122119
extends: [.build_coreneuron_nmodl, .spack_nvhpc]
123120
variables:
124121
SPACK_PACKAGE: coreneuron
125-
# +report pulls in a lot of dependencies and the tests fail.
126122
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
127123
# Sympy + OpenMP target offload does not currently work with NVHPC
128-
SPACK_PACKAGE_SPEC: +nmodl~openmp+gpu+tests~legacy-unit~report+sympy build_type=RelWithDebInfo
124+
SPACK_PACKAGE_SPEC: +nmodl~openmp+gpu+tests~legacy-unit+sympy build_type=RelWithDebInfo
129125
needs: ["build:nmodl"]
130126

131127
build:coreneuron:mod2c:intel:

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNORE_UNKNOWN_PRAGMA_FLAGS}")
433433
# =============================================================================
434434
add_subdirectory(coreneuron)
435435

436+
if(CORENRN_ENABLE_GPU)
437+
get_target_property(CORENRN_LINK_LIBRARIES coreneuron INTERFACE_LINK_LIBRARIES)
438+
foreach(LIB ${CORENRN_LINK_LIBRARIES})
439+
set_property(GLOBAL APPEND_STRING PROPERTY CORENEURON_LIB_LINK_FLAGS " ${LIB}")
440+
endforeach()
441+
endif()
442+
436443
include(MakefileBuildOptions)
437444
add_subdirectory(extra)
438445

coreneuron/io/output_spikes.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ void spikevec_unlock() {
6464
mut.unlock();
6565
}
6666

67-
void local_spikevec_sort(std::vector<double>& isvect,
68-
std::vector<int>& isvecg,
69-
std::vector<double>& osvect,
70-
std::vector<int>& osvecg) {
67+
static void local_spikevec_sort(std::vector<double>& isvect,
68+
std::vector<int>& isvecg,
69+
std::vector<double>& osvect,
70+
std::vector<int>& osvecg) {
7171
osvect.resize(isvect.size());
7272
osvecg.resize(isvecg.size());
7373
// first build a permutation vector
@@ -92,7 +92,7 @@ void local_spikevec_sort(std::vector<double>& isvect,
9292

9393
#if NRNMPI
9494

95-
void sort_spikes(std::vector<double>& spikevec_time, std::vector<int>& spikevec_gid) {
95+
static void sort_spikes(std::vector<double>& spikevec_time, std::vector<int>& spikevec_gid) {
9696
double lmin_time = std::numeric_limits<double>::max();
9797
double lmax_time = std::numeric_limits<double>::min();
9898
if (!spikevec_time.empty()) {
@@ -154,7 +154,7 @@ void sort_spikes(std::vector<double>& spikevec_time, std::vector<int>& spikevec_
154154
/** Split spikevec_time and spikevec_gid by populations
155155
* Add spike data with population name and gid offset tolibsonatareport API
156156
*/
157-
void output_spike_populations(
157+
static void output_spike_populations(
158158
const std::vector<std::pair<std::string, int>>& population_name_offset) {
159159
// Write spikes with default population name and offset
160160
if (population_name_offset.empty()) {
@@ -198,8 +198,9 @@ void output_spike_populations(
198198
* \todo : MPI related code should be factored into nrnmpi.c
199199
* Check spike record length which is set to 64 chars
200200
*/
201-
void output_spikes_parallel(
201+
static void output_spikes_parallel(
202202
const char* outpath,
203+
const char* filename,
203204
const std::vector<std::pair<std::string, int>>& population_name_offset) {
204205
std::stringstream ss;
205206
ss << outpath << "/out.dat";
@@ -210,7 +211,7 @@ void output_spikes_parallel(
210211
remove(fname.c_str());
211212
}
212213
#ifdef ENABLE_SONATA_REPORTS
213-
sonata_create_spikefile(outpath);
214+
sonata_create_spikefile(outpath, filename);
214215
output_spike_populations(population_name_offset);
215216
sonata_write_spike_populations();
216217
sonata_close_spikefile();
@@ -253,7 +254,7 @@ void output_spikes_parallel(
253254
}
254255
#endif
255256

256-
void output_spikes_serial(const char* outpath) {
257+
static void output_spikes_serial(const char* outpath) {
257258
std::stringstream ss;
258259
ss << outpath << "/out.dat";
259260
std::string fname = ss.str();
@@ -288,7 +289,7 @@ void output_spikes(const char* outpath,
288289
}
289290
#if NRNMPI
290291
if (corenrn_param.mpi_enable && nrnmpi_initialized()) {
291-
output_spikes_parallel(outpath, population_name_offset);
292+
output_spikes_parallel(outpath, "out", population_name_offset);
292293
} else
293294
#endif
294295
{

coreneuron/mechanism/membfunc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ extern double nrn_ghk(double v, double ci, double co, double z);
120120
nrn_pragma_omp(end declare target)
121121
extern void hoc_register_prop_size(int, int, int);
122122
extern void hoc_register_dparam_semantics(int type, int, const char* name);
123+
extern void hoc_reg_ba(int, mod_f_t, int);
123124

124125
struct DoubScal {
125126
const char* name;

0 commit comments

Comments
 (0)