@@ -811,40 +811,6 @@ nest::SimulationManager::update_()
811811 gettimeofday ( &t_slice_begin_, nullptr );
812812 }
813813
814- if ( kernel ().sp_manager .is_structural_plasticity_enabled ()
815- and ( std::fmod ( Time ( Time::step ( clock_.get_steps () + from_step_ ) ).get_ms (),
816- kernel ().sp_manager .get_structural_plasticity_update_interval () )
817- == 0 ) )
818- {
819- for ( SparseNodeArray::const_iterator i = kernel ().node_manager .get_local_nodes ( tid ).begin ();
820- i != kernel ().node_manager .get_local_nodes ( tid ).end ();
821- ++i )
822- {
823- Node* node = i->get_node ();
824- node->update_synaptic_elements ( Time ( Time::step ( clock_.get_steps () + from_step_ ) ).get_ms () );
825- }
826- #pragma omp barrier
827- #pragma omp single
828- {
829- kernel ().sp_manager .update_structural_plasticity ();
830- }
831- // Remove 10% of the vacant elements
832- for ( SparseNodeArray::const_iterator i = kernel ().node_manager .get_local_nodes ( tid ).begin ();
833- i != kernel ().node_manager .get_local_nodes ( tid ).end ();
834- ++i )
835- {
836- Node* node = i->get_node ();
837- node->decay_synaptic_elements_vacant ();
838- }
839-
840- // after structural plasticity has created and deleted
841- // connections, update the connection infrastructure; implies
842- // complete removal of presynaptic part and reconstruction
843- // from postsynaptic data
844- update_connection_infrastructure ( tid );
845-
846- } // of structural plasticity
847-
848814 // Do not deliver events at beginning of first slice, nothing can be there yet
849815 // and invalid markers have not been properly set in send buffers.
850816 if ( slice_ > 0 and from_step_ == 0 )
@@ -989,6 +955,42 @@ nest::SimulationManager::update_()
989955 } // of if(wfr_is_used)
990956 // end of preliminary update
991957
958+ if ( kernel ().sp_manager .is_structural_plasticity_enabled ()
959+ and ( std::fmod ( Time ( Time::step ( clock_.get_steps () + from_step_ ) ).get_ms (),
960+ kernel ().sp_manager .get_structural_plasticity_update_interval () )
961+ == 0 ) )
962+ {
963+ #pragma omp barrier
964+ for ( SparseNodeArray::const_iterator i = kernel ().node_manager .get_local_nodes ( tid ).begin ();
965+ i != kernel ().node_manager .get_local_nodes ( tid ).end ();
966+ ++i )
967+ {
968+ Node* node = i->get_node ();
969+ node->update_synaptic_elements ( Time ( Time::step ( clock_.get_steps () + from_step_ ) ).get_ms () );
970+ }
971+ #pragma omp barrier
972+ #pragma omp single
973+ {
974+ kernel ().sp_manager .update_structural_plasticity ();
975+ }
976+ // Remove 10% of the vacant elements
977+ for ( SparseNodeArray::const_iterator i = kernel ().node_manager .get_local_nodes ( tid ).begin ();
978+ i != kernel ().node_manager .get_local_nodes ( tid ).end ();
979+ ++i )
980+ {
981+ Node* node = i->get_node ();
982+ node->decay_synaptic_elements_vacant ();
983+ }
984+
985+ // after structural plasticity has created and deleted
986+ // connections, update the connection infrastructure; implies
987+ // complete removal of presynaptic part and reconstruction
988+ // from postsynaptic data
989+ update_connection_infrastructure ( tid );
990+
991+ } // of structural plasticity
992+
993+
992994#ifdef TIMER_DETAILED
993995#pragma omp barrier
994996 if ( tid == 0 )
0 commit comments