Skip to content

Disentangle kernel-manager include tree #3544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
632 changes: 457 additions & 175 deletions doc/htmldoc/developer_space/guidelines/coding_guidelines_cpp.rst

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion doc/htmldoc/networks/spatially_structured_networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,6 @@ files for the ``Mask`` parent class:
.. code:: c

#include "mask.h"
#include "mask_impl.h"

The ``Mask`` class has a few methods that must be overridden:

Expand Down
2 changes: 1 addition & 1 deletion libnestutil/dict_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

// Includes from nestkernel:
#include "kernel_manager.h"
#include "nest.h"
#include "nest_datums.h"
#include "vp_manager_impl.h"

// Includes from sli:
#include "dictdatum.h"
Expand Down
6 changes: 3 additions & 3 deletions models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ set(models_sources
weight_recorder.h weight_recorder.cpp # Required by CommonSynapseProperties
cm_compartmentcurrents.h cm_compartmentcurrents.cpp
cm_tree.h cm_tree.cpp
rate_neuron_ipn.h rate_neuron_ipn_impl.h
rate_neuron_opn.h rate_neuron_opn_impl.h
rate_transformer_node.h rate_transformer_node_impl.h
rate_neuron_ipn.h
rate_neuron_opn.h
rate_transformer_node.h
weight_optimizer.h weight_optimizer.cpp
${MODELS_SOURCES_GENERATED}
)
Expand Down
4 changes: 1 addition & 3 deletions models/ac_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
#include "numerics.h"

// Includes from nestkernel:
#include "event_delivery_manager_impl.h"
#include "event_delivery_manager.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dict.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_cond_alpha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_cond_alpha_astro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_cond_alpha_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dict.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_cond_beta_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dict.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_cond_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_psc_alpha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_psc_delta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_psc_delta_clopath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/aeif_psc_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "nest_names.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/amat2_psc_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
2 changes: 0 additions & 2 deletions models/astrocyte_lr_1994.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_impl.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dictutils.h"
Expand Down
3 changes: 0 additions & 3 deletions models/bernoulli_synapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

#include "bernoulli_synapse.h"

// Includes from nestkernel:
#include "nest_impl.h"

void
nest::register_bernoulli_synapse( const std::string& name )
{
Expand Down
1 change: 0 additions & 1 deletion models/binary_neuron.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "archiving_node.h"
#include "connection.h"
#include "event.h"
#include "event_delivery_manager_impl.h"
#include "exceptions.h"
#include "kernel_manager.h"
#include "nest_timeconverter.h"
Expand Down
3 changes: 0 additions & 3 deletions models/clopath_synapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

#include "clopath_synapse.h"

// Includes from nestkernel:
#include "nest_impl.h"

void
nest::register_clopath_synapse( const std::string& name )
{
Expand Down
2 changes: 2 additions & 0 deletions models/cm_compartmentcurrents.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <stdlib.h>

#include "logging.h"
#include "logging_manager.h"
#include "ring_buffer.h"

namespace nest
Expand Down
3 changes: 0 additions & 3 deletions models/cm_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

#include "cm_default.h"

// Includes from nestkernel:
#include "nest_impl.h"

namespace nest
{
void
Expand Down
3 changes: 3 additions & 0 deletions models/cm_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/
#include "cm_tree.h"

#include "logging.h"
#include "logging_manager.h"


nest::Compartment::Compartment( const long compartment_index, const long parent_index )
: xx_( 0.0 )
Expand Down
1 change: 0 additions & 1 deletion models/cm_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
// Includes from nestkernel:
#include "exceptions.h"
#include "kernel_manager.h"
#include "universal_data_logger_impl.h"

// Includes from sli:
#include "dict.h"
Expand Down
4 changes: 0 additions & 4 deletions models/cont_delay_synapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*/

#include "cont_delay_synapse.h"
#include "cont_delay_synapse_impl.h"

// Includes from nestkernel:
#include "nest_impl.h"

void
nest::register_cont_delay_synapse( const std::string& name )
Expand Down
68 changes: 68 additions & 0 deletions models/cont_delay_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,74 @@ cont_delay_synapse< targetidentifierT >::send( Event& e, size_t t, const CommonS
template < typename targetidentifierT >
constexpr ConnectionModelProperties cont_delay_synapse< targetidentifierT >::properties;

template < typename targetidentifierT >
cont_delay_synapse< targetidentifierT >::cont_delay_synapse()
: ConnectionBase()
, weight_( 1.0 )
, delay_offset_( 0.0 )
{
}

template < typename targetidentifierT >
void
cont_delay_synapse< targetidentifierT >::get_status( DictionaryDatum& d ) const
{
ConnectionBase::get_status( d );

def< double >( d, names::weight, weight_ );
def< double >( d, names::delay, Time( Time::step( get_delay_steps() ) ).get_ms() - delay_offset_ );
def< long >( d, names::size_of, sizeof( *this ) );
}

template < typename targetidentifierT >
void
cont_delay_synapse< targetidentifierT >::set_status( const DictionaryDatum& d, ConnectorModel& cm )
{
ConnectionBase::set_status( d, cm );

updateValue< double >( d, names::weight, weight_ );

// set delay if mentioned
double delay;

if ( updateValue< double >( d, names::delay, delay ) )
{

const double h = Time::get_resolution().get_ms();

double int_delay;
const double frac_delay = std::modf( delay / h, &int_delay );

if ( frac_delay == 0 )
{
kernel().connection_manager.get_delay_checker().assert_valid_delay_ms( delay );
set_delay_steps( Time::delay_ms_to_steps( delay ) );
delay_offset_ = 0.0;
}
else
{
const long lowerbound = static_cast< long >( int_delay );
kernel().connection_manager.get_delay_checker().assert_two_valid_delays_steps( lowerbound, lowerbound + 1 );
set_delay_steps( lowerbound + 1 );
delay_offset_ = h * ( 1.0 - frac_delay );
}
}
}

template < typename targetidentifierT >
void
cont_delay_synapse< targetidentifierT >::check_synapse_params( const DictionaryDatum& syn_spec ) const
{
if ( syn_spec->known( names::delay ) )
{
LOG( M_WARNING,
"Connect",
"The delay will be rounded to the next multiple of the time step. "
"To use a more precise time delay it needs to be defined within "
"the synapse, e.g. with CopyModel()." );
}
}

} // of namespace nest

#endif // of #ifndef CONT_DELAY_SYNAPSE_H
Loading
Loading