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

Commit 12272f8

Browse files
pramodkolupton
andauthored
Support for shared libraries in GPU execution (python launch support) (#795)
* coreneuron and mechanism library can be built as shared and it enables launching coreneuron on GPU via python * update MOD2C and NMODL fixes to handle GLOBAL variables See BlueBrain/mod2c/pull/78 See BlueBrain/nmodl/pull/904 * removed acc/openmp global annotations for celsius, pi and secondorder and they don't need to be copied on GPU * Pass Memb_list* as an argument for all common prototypes in order to support global variables via argument * free ml->instance if not empty * add link to libscopmath in neuron as well * nrn_ghk is now declared inline. * homegrown present table to avoid dynamic loading + acc_deviceptr limitations * use -gpu=nordc and make #pragma acc routine seq functions inline * drop -lscopmath as its folded in elsewhere * random123 header reorganisation * try and cleanup CLI11 handling. * try and consolidate build logic * some CORENEURON_ -> CORENRN_ for consistency. * export OpenACC flags to NEURON separately as well as part of the whole ... -lcoreneuron ... link line. * libcoreneuron.so -> libcorenrnmech.so, try and fix static builds * do not enable OpenMP in shared/OpenACC builds. * add rpaths inside nrnivmodl-core. * accept a private destructor function pointer from generated mechanisms * drop ${TEST_EXEC_PREFIX} that was causing simple tests to be executed on many ranks. * CORENEURON_GPU_DEBUG: add environment variable that enables cnrn_target_* debug messages. fixes #141 Co-authored-by: Olli Lupton <[email protected]>
1 parent d6507e2 commit 12272f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1287
-845
lines changed

.gitlab-ci.yml

+126-74
Original file line numberDiff line numberDiff line change
@@ -81,127 +81,179 @@ build:nmodl:
8181
SPACK_PACKAGE_COMPILER: gcc
8282

8383
# Build CoreNEURON
84-
build:coreneuron:mod2c:nvhpc:acc:
85-
extends: [.build, .spack_nvhpc]
86-
variables:
87-
SPACK_PACKAGE: coreneuron
88-
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
89-
SPACK_PACKAGE_SPEC: +gpu+openmp+tests~legacy-unit build_type=RelWithDebInfo
90-
91-
# Build CoreNEURON with Unified Memory on GPU
92-
build:coreneuron:mod2c:nvhpc:acc:unified:
93-
extends: [.build, .spack_nvhpc]
94-
variables:
95-
SPACK_PACKAGE: coreneuron
96-
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
97-
SPACK_PACKAGE_SPEC: +gpu+unified+openmp+tests~legacy-unit build_type=RelWithDebInfo
98-
99-
.build_coreneuron_nmodl:
84+
.build_coreneuron:
10085
extends: [.build]
10186
variables:
87+
SPACK_PACKAGE: coreneuron
10288
# NEURON depends on py-mpi4py, most of whose dependencies are pulled in by
10389
# nmodl%gcc, with the exception of MPI, which is pulled in by
10490
# coreneuron%{nvhpc,intel}. hpe-mpi is an external package anyway, so
10591
# setting its compiler is just changing how it is labelled in the
10692
# dependency graph and not changing which installation is used, but this
10793
# means that in the NEURON step an existing py-mpi4py%gcc can be used.
10894
# Otherwise a new py-mpi4py with hpe-mpi%{nvhpc,intel} will be built.
95+
# caliper: papi%nvhpc does not build; use the caliper from the deployment
10996
# TODO: fix this more robustly so we don't have to play so many games.
110-
SPACK_PACKAGE_DEPENDENCIES: ^hpe-mpi%gcc
97+
SPACK_PACKAGE_DEPENDENCIES: ^hpe-mpi%gcc ^caliper%gcc+cuda cuda_arch=70
11198

112-
build:coreneuron:nmodl:nvhpc:omp:
113-
extends: [.build_coreneuron_nmodl, .spack_nvhpc]
99+
# TODO: improve coverage by switching an Intel build to be statically linked
100+
# TODO: improve coverage by switching an Intel build to RelWithDebInfo
101+
# TODO: improve coverage by enabling +openmp on an Intel build
102+
build:coreneuron:mod2c:intel:shared:debug:
103+
extends: [.build_coreneuron, .spack_intel]
114104
variables:
115-
SPACK_PACKAGE: coreneuron
116-
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
117-
SPACK_PACKAGE_SPEC: +nmodl+openmp+gpu+tests~legacy-unit~sympy build_type=RelWithDebInfo
105+
SPACK_PACKAGE_SPEC: +caliper~gpu~legacy-unit~nmodl~openmp+shared+tests~unified build_type=Debug
106+
107+
build:coreneuron:nmodl:intel:debug:legacy:
108+
extends: [.build_coreneuron, .spack_intel]
118109
needs: ["build:nmodl"]
110+
variables:
111+
SPACK_PACKAGE_SPEC: +caliper~gpu~legacy-unit+nmodl~openmp~shared~sympy+tests~unified build_type=Debug
119112

120-
build:coreneuron:nmodl:nvhpc:acc:
121-
extends: [.build_coreneuron_nmodl, .spack_nvhpc]
113+
# Disable caliper to improve coverage
114+
build:coreneuron:nmodl:intel:shared:debug:
115+
extends: [.build_coreneuron, .spack_intel]
116+
needs: ["build:nmodl"]
122117
variables:
123-
SPACK_PACKAGE: coreneuron
124-
# See https://github.com/BlueBrain/CoreNeuron/issues/518 re: build_type
125-
# Sympy + OpenMP target offload does not currently work with NVHPC
126-
SPACK_PACKAGE_SPEC: +nmodl~openmp+gpu+tests~legacy-unit+sympy build_type=RelWithDebInfo
118+
SPACK_PACKAGE_DEPENDENCIES: ^hpe-mpi%gcc
119+
SPACK_PACKAGE_SPEC: ~caliper~gpu~legacy-unit+nmodl~openmp+shared+sympy+tests~unified build_type=Debug
120+
121+
# Not linked to a NEURON build+test job, see
122+
# https://github.com/BlueBrain/CoreNeuron/issues/594
123+
build:coreneuron:mod2c:nvhpc:acc:debug:unified:
124+
extends: [.build_coreneuron, .spack_nvhpc]
125+
variables:
126+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit~nmodl+openmp~shared+tests+unified build_type=Debug
127+
128+
# Shared + OpenACC + OpenMP host threading has problems
129+
build:coreneuron:mod2c:nvhpc:acc:shared:
130+
extends: [.build_coreneuron, .spack_nvhpc]
131+
variables:
132+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit~nmodl~openmp+shared+tests~unified build_type=RelWithDebInfo
133+
134+
build:coreneuron:nmodl:nvhpc:acc:debug:legacy:
135+
extends: [.build_coreneuron, .spack_nvhpc]
127136
needs: ["build:nmodl"]
137+
variables:
138+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit+nmodl~openmp~shared~sympy+tests~unified build_type=Debug
128139

129-
build:coreneuron:mod2c:intel:
130-
extends: [.build, .spack_intel]
140+
build:coreneuron:nmodl:nvhpc:acc:shared:
141+
extends: [.build_coreneuron, .spack_nvhpc]
142+
needs: ["build:nmodl"]
131143
variables:
132-
SPACK_PACKAGE: coreneuron
133-
SPACK_PACKAGE_SPEC: +tests~legacy-unit build_type=Debug
144+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit+nmodl~openmp+shared+sympy+tests~unified build_type=RelWithDebInfo
134145

135-
build:coreneuron:nmodl:intel:
136-
extends: [.build_coreneuron_nmodl, .spack_intel]
146+
build:coreneuron:nmodl:nvhpc:omp:legacy:
147+
extends: [.build_coreneuron, .spack_nvhpc]
148+
needs: ["build:nmodl"]
137149
variables:
138-
SPACK_PACKAGE: coreneuron
139-
SPACK_PACKAGE_SPEC: +nmodl+tests~legacy-unit build_type=Debug
150+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit+nmodl+openmp~shared~sympy+tests~unified build_type=RelWithDebInfo
151+
152+
build:coreneuron:nmodl:nvhpc:omp:debug:
153+
extends: [.build_coreneuron, .spack_nvhpc]
140154
needs: ["build:nmodl"]
155+
variables:
156+
SPACK_PACKAGE_SPEC: +caliper+gpu~legacy-unit+nmodl+openmp~shared+sympy+tests~unified build_type=Debug
141157

142158
# Build NEURON
143-
build:neuron:mod2c:nvhpc:acc:
159+
build:neuron:mod2c:intel:shared:debug:
160+
extends: [.build_neuron, .spack_intel]
161+
needs: ["build:coreneuron:mod2c:intel:shared:debug"]
162+
163+
build:neuron:nmodl:intel:debug:legacy:
164+
extends: [.build_neuron, .spack_intel]
165+
needs: ["build:coreneuron:nmodl:intel:debug:legacy"]
166+
167+
build:neuron:nmodl:intel:shared:debug:
168+
extends: [.build_neuron, .spack_intel]
169+
needs: ["build:coreneuron:nmodl:intel:shared:debug"]
170+
171+
build:neuron:mod2c:nvhpc:acc:shared:
144172
extends: [.build_neuron, .spack_nvhpc]
145-
needs: ["build:coreneuron:mod2c:nvhpc:acc"]
173+
needs: ["build:coreneuron:mod2c:nvhpc:acc:shared"]
146174

147-
build:neuron:nmodl:nvhpc:omp:
175+
build:neuron:nmodl:nvhpc:acc:debug:legacy:
148176
extends: [.build_neuron, .spack_nvhpc]
149-
needs: ["build:coreneuron:nmodl:nvhpc:omp"]
177+
needs: ["build:coreneuron:nmodl:nvhpc:acc:debug:legacy"]
150178

151-
build:neuron:nmodl:nvhpc:acc:
179+
build:neuron:nmodl:nvhpc:acc:shared:
152180
extends: [.build_neuron, .spack_nvhpc]
153-
needs: ["build:coreneuron:nmodl:nvhpc:acc"]
181+
needs: ["build:coreneuron:nmodl:nvhpc:acc:shared"]
154182

155-
build:neuron:mod2c:intel:
156-
extends: [.build_neuron, .spack_intel]
157-
needs: ["build:coreneuron:mod2c:intel"]
183+
build:neuron:nmodl:nvhpc:omp:legacy:
184+
extends: [.build_neuron, .spack_nvhpc]
185+
needs: ["build:coreneuron:nmodl:nvhpc:omp:legacy"]
158186

159-
build:neuron:nmodl:intel:
160-
extends: [.build_neuron, .spack_intel]
161-
needs: ["build:coreneuron:nmodl:intel"]
187+
build:neuron:nmodl:nvhpc:omp:debug:
188+
extends: [.build_neuron, .spack_nvhpc]
189+
needs: ["build:coreneuron:nmodl:nvhpc:omp:debug"]
162190

163191
# Test CoreNEURON
164-
test:coreneuron:mod2c:nvhpc:acc:
192+
test:coreneuron:mod2c:intel:shared:debug:
193+
extends: [.ctest]
194+
needs: ["build:coreneuron:mod2c:intel:shared:debug"]
195+
196+
test:coreneuron:nmodl:intel:debug:legacy:
197+
extends: [.ctest]
198+
needs: ["build:coreneuron:nmodl:intel:debug:legacy"]
199+
200+
test:coreneuron:nmodl:intel:shared:debug:
201+
extends: [.ctest]
202+
needs: ["build:coreneuron:nmodl:intel:shared:debug"]
203+
204+
test:coreneuron:mod2c:nvhpc:acc:debug:unified:
165205
extends: [.ctest, .gpu_node]
166-
needs: ["build:coreneuron:mod2c:nvhpc:acc"]
206+
needs: ["build:coreneuron:mod2c:nvhpc:acc:debug:unified"]
167207

168-
test:coreneuron:mod2c:nvhpc:acc:unified:
208+
test:coreneuron:mod2c:nvhpc:acc:shared:
169209
extends: [.ctest, .gpu_node]
170-
needs: ["build:coreneuron:mod2c:nvhpc:acc:unified"]
210+
needs: ["build:coreneuron:mod2c:nvhpc:acc:shared"]
171211

172-
test:coreneuron:nmodl:nvhpc:omp:
212+
test:coreneuron:nmodl:nvhpc:acc:debug:legacy:
173213
extends: [.ctest, .gpu_node]
174-
needs: ["build:coreneuron:nmodl:nvhpc:omp"]
214+
needs: ["build:coreneuron:nmodl:nvhpc:acc:debug:legacy"]
175215

176-
test:coreneuron:nmodl:nvhpc:acc:
216+
test:coreneuron:nmodl:nvhpc:acc:shared:
177217
extends: [.ctest, .gpu_node]
178-
needs: ["build:coreneuron:nmodl:nvhpc:acc"]
218+
needs: ["build:coreneuron:nmodl:nvhpc:acc:shared"]
179219

180-
test:coreneuron:mod2c:intel:
181-
extends: [.ctest]
182-
needs: ["build:coreneuron:mod2c:intel"]
220+
test:coreneuron:nmodl:nvhpc:omp:legacy:
221+
extends: [.ctest, .gpu_node]
222+
needs: ["build:coreneuron:nmodl:nvhpc:omp:legacy"]
183223

184-
test:coreneuron:nmodl:intel:
185-
extends: [.ctest]
186-
needs: ["build:coreneuron:nmodl:intel"]
224+
test:coreneuron:nmodl:nvhpc:omp:debug:
225+
extends: [.ctest, .gpu_node]
226+
needs: ["build:coreneuron:nmodl:nvhpc:omp:debug"]
187227

188228
# Test NEURON
189-
test:neuron:mod2c:nvhpc:acc:
229+
test:neuron:mod2c:intel:shared:debug:
230+
extends: [.test_neuron]
231+
needs: ["build:neuron:mod2c:intel:shared:debug"]
232+
233+
test:neuron:nmodl:intel:debug:legacy:
234+
extends: [.test_neuron]
235+
needs: ["build:neuron:nmodl:intel:debug:legacy"]
236+
237+
test:neuron:nmodl:intel:shared:debug:
238+
extends: [.test_neuron]
239+
needs: ["build:neuron:nmodl:intel:shared:debug"]
240+
241+
test:neuron:mod2c:nvhpc:acc:shared:
190242
extends: [.test_neuron, .gpu_node]
191-
needs: ["build:neuron:mod2c:nvhpc:acc"]
243+
needs: ["build:neuron:mod2c:nvhpc:acc:shared"]
192244

193-
test:neuron:nmodl:nvhpc:omp:
245+
test:neuron:nmodl:nvhpc:acc:debug:legacy:
194246
extends: [.test_neuron, .gpu_node]
195-
needs: ["build:neuron:nmodl:nvhpc:omp"]
247+
needs: ["build:neuron:nmodl:nvhpc:acc:debug:legacy"]
196248

197-
test:neuron:nmodl:nvhpc:acc:
249+
test:neuron:nmodl:nvhpc:acc:shared:
198250
extends: [.test_neuron, .gpu_node]
199-
needs: ["build:neuron:nmodl:nvhpc:acc"]
251+
needs: ["build:neuron:nmodl:nvhpc:acc:shared"]
200252

201-
test:neuron:mod2c:intel:
202-
extends: [.test_neuron]
203-
needs: ["build:neuron:mod2c:intel"]
253+
test:neuron:nmodl:nvhpc:omp:legacy:
254+
extends: [.test_neuron, .gpu_node]
255+
needs: ["build:neuron:nmodl:nvhpc:omp:legacy"]
204256

205-
test:neuron:nmodl:intel:
206-
extends: [.test_neuron]
207-
needs: ["build:neuron:nmodl:intel"]
257+
test:neuron:nmodl:nvhpc:omp:debug:
258+
extends: [.test_neuron, .gpu_node]
259+
needs: ["build:neuron:nmodl:nvhpc:omp:debug"]

0 commit comments

Comments
 (0)