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

Commit cfefe0a

Browse files
authored
Clear spike vectors after writing or transferring to NEURON (#380)
1 parent e9a7b19 commit cfefe0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

coreneuron/io/output_spikes.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,10 @@ void output_spikes_serial(const char* outpath) {
268268

269269
void output_spikes(const char* outpath, const std::string& population_name) {
270270
// try to transfer spikes to NEURON. If successfull, don't write out.dat
271-
if (all_spikes_return(spikevec_time, spikevec_gid))
271+
if (all_spikes_return(spikevec_time, spikevec_gid)) {
272+
clear_spike_vectors();
272273
return;
274+
}
273275
#if NRNMPI
274276
if (nrnmpi_initialized()) {
275277
output_spikes_parallel(outpath, population_name);
@@ -279,6 +281,7 @@ void output_spikes(const char* outpath, const std::string& population_name) {
279281
#else
280282
output_spikes_serial(outpath);
281283
#endif
284+
clear_spike_vectors();
282285
}
283286

284287
void clear_spike_vectors() {

0 commit comments

Comments
 (0)