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

Commit 102ebde

Browse files
Nicolas Cornuiomaganaris
andauthored
Use new libsonatareport (#757)
Co-authored-by: Ioannis Magkanaris <iomagkanaris@gmail.com>
1 parent 956bde6 commit 102ebde

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ jobs:
5454
GITHUB_PR_BODY: ${{ github.event.pull_request.body }}
5555
run: |
5656
nrn_branch=`echo "${GITHUB_PR_BODY}" | grep "^CI_BRANCHES" \
57-
| awk -v FS="(NEURON_BRANCH=|,)" '{print $2}'`
57+
| awk -v FS="NEURON_BRANCH=" '{print $2}'` \
58+
| awk -v FS="," '{print $1}'
5859
if [ -z "$nrn_branch" ]; then
5960
nrn_branch=master
6061
fi

.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ simulation_stack:
3434
REPORTINGLIB_BRANCH: $REPORTINGLIB_BRANCH
3535
SPACK_BRANCH: $SPACK_BRANCH
3636
SYNAPSETOOL_BRANCH: $SYNAPSETOOL_BRANCH
37+
LIBSONATAREPORT_BRANCH: $LIBSONATAREPORT_BRANCH
38+
NEURODAMUS_CORE_BRANCH: $NEURODAMUS_CORE_BRANCH
39+
NEURODAMUS_HIPPOCAMPUS_BRANCH: $NEURODAMUS_HIPPOCAMPUS_BRANCH
40+
NEURODAMUS_MOUSIFY_BRANCH: $NEURODAMUS_MOUSIFY_BRANCH
41+
NEURODAMUS_NEOCORTEX_BRANCH: $NEURODAMUS_NEOCORTEX_BRANCH
42+
NEURODAMUS_THALAMUS_BRANCH: $NEURODAMUS_THALAMUS_BRANCH
43+
3744
trigger:
3845
project: hpc/sim/blueconfigs
3946
# CoreNEURON CI status depends on the BlueConfigs CI status.

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
{

0 commit comments

Comments
 (0)