Skip to content
Snippets Groups Projects
  1. Mar 16, 2018
    • Ben Cumming's avatar
      5fe81e83
    • Ben Cumming's avatar
      refactor git submodule support in cmake (#448) · 4c66432f
      Ben Cumming authored
      In some places our CMake scripts were attempting to check out git submodules when required, if they have not already been checked out. The code that does this was cut and pasted, and was getting unwieldy.
      
      To minimise the responsibilities of CMake, this PR
      
      removes calls to git
      introduces a function check_git_submodule that can be used to test if a git submodule is installed, and print a helpful message that informs the user how to check it out if needed.
      introduces a function add_error_target that makes a target that prints a message then quits with an error. This can be used to generate a proxy target when a problem is detected during CMake setup. This means that an error is only generated when building a target with a missing dependency, instead of an error during CMake setup.
      refactors the CMake setup for the docs and ubenches targets to use these new features.
      4c66432f
  2. Mar 15, 2018
    • Ben Cumming's avatar
      Improve TBB vs. CMake (#451) · 459d6562
      Ben Cumming authored
      This replaces the CMake templates provided by TBB with a much more sane alternative!
      
      The TBB CMake templates had a very strange workflow, that involved downloading the TBB source and compiling it, which made it impossible to configure the TBB build, and caused problems on systems without connection to the internet.
      
      We replace this with a fork of the TBB repository maintained by Github user @wjakob:
      https://github.com/wjakob/tbb
      This fork provides a sane CMakeLists.txt that can be configured from our CMake setup.
      It is added as a git submodule, so it can be downloaded with the rest of the repository, hence not requiring connection to the internet during CMake configuration.
      
      It could be extended to use a user-provided build of TBB to use instead of building it.
      
      fixes #332.
      459d6562
    • Ben Cumming's avatar
      Multithreading friendly profiler (#447) · 1e461b1b
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Replace the profiler with a simpler design that works for nested multi-threaded regions.
      
      * Replace hierarchical profiler accounting with strictly exclusive regions.
      * Make tree grouping of profile data a presentation concern.
      * Uncouple profiler semantics from Arbor classes such as `model`.
      * Add thorough documentation for the new profiler to the library documentation.
      1e461b1b
  3. Feb 28, 2018
    • Ben Cumming's avatar
      Value semantics for event_generators · aca84730
      Ben Cumming authored
      Use type erasure tricks to remove abstract base class for `event_generator`.
      
      This simplifies all the code that uses `event_generator`s (not radically, but it is simpler).
      aca84730
  4. Jan 29, 2018
  5. Jan 26, 2018
    • kabicm's avatar
      LIF neurons: CPU backend with Brunel Network miniapp (#441) · 2d4bd154
      kabicm authored
      Two main contributions:
      
      1) Implementation of LIF neuron model with no kernel and no external input (I_e=0)
      
      The input current to each neuron is therefore just the sum of all the weights of incoming spikes. We integrate in jumps dt = min(t_final - t, t_event - t), since we know the exact solution of the differential equal describing the membrane potential.
      
      2) Miniapp for simulating the Brunel network of LIF neurons. 
      
      The network consists of 2 main populations: excitatory and inhibitory populations. Each neuron from the network receives a fixed number (proportional to the size of the population) of incoming connections from both of these groups. In addition to the input from excitatory and inhibitory populations, each neuron receives a fixed number of connections from the Poisson neurons producing the Poisson-like input that is integrated into the LIF cell group so that the communication of Poisson events is bypassed. 
      2d4bd154
  6. Jan 25, 2018
  7. Jan 18, 2018
  8. Jan 15, 2018
    • Sam Yates's avatar
      Fix improper brace-initialization in unit test. (#437) · 81d8d0b5
      Sam Yates authored
      * Replace improper use of brace initialization of vectors of classes with a deleted move constructed with a sequence of `emplace_back` invocations.
      81d8d0b5
    • Ben Cumming's avatar
      Fix event-generator bugs in model (#439) · c27757f9
      Ben Cumming authored
      There were two latent bugs in the event generation part of `model`.
      
      1. A segmentation fault when initializing the `event_generators` in the `model` constructor caused by using an index variable after it had been incremented.
      2. Events generated during the first epoch were not delivered on time.
      
      The first issue was simple to fix, by ensuring that the coutning variable is incremented at the end of the loop.
      
      The second issue required refactoring the event wrangling inside `model`. Events can be introduced into a model via three sources:
      
      1. Generated by spike exchange
      2. By calling the `model::inject_events()` interface
      3. `event_generator`s attached to cells.
      
      The refactoring was required to ensure that all three sources are handled correctly. There is further opportunities for refactoring the code to make it a bit cleaner, specifically putting the wrangling code in its own type that could be tested seperately, outside `model`, but that is beyond the scope of this fix. 
      c27757f9
    • Ben Cumming's avatar
      Make cell type copyable by default (#430) · 51d09f7d
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Enable `cell` copy constructor, remove special tag type used to guard `cell` cloning.
      * Provide sane defaults for `recipe` methods.
      51d09f7d
  9. Dec 22, 2017
  10. Dec 21, 2017
    • Sam Yates's avatar
      Fix indirection in ion concentration write. (#425) · 17f7db98
      Sam Yates authored
      * Fix indirection in ion concentration write.
      * Remove second indirection in ion write assignment.
      * Extend ion write unit test to cover non-contiguous ion CV cases and verify correct ion concentration averaging.
      
      Fixes #424.
      17f7db98
  11. Dec 20, 2017
    • Ben Cumming's avatar
      Move miniapps path to 'example/' (#423) · f94f0eab
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Rename `miniapps` subdirectory to `example`.
      * Have all example executables be built under `example` in the build directory.
      * Update Travis CI to run miniapp from new path.
      f94f0eab
    • Ben Cumming's avatar
      Add granule cell mechanisms (#421) · a80df6fa
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Add three new mechanisms: `nax.mod`, `kdrmt.mod` and `kamt.mod`.
      * Add new built-in math operators to `modcc`: `min`, `max`, `abs` and `exprelr`. `exprelr` is defined as the reciprocal of the 'exprel' function, exprel(x)=x/(exp(x)-1), exprel(1)=1. This function occurs frequently in HH-style mechanisms, and having a built-in operator avoids the ad hoc `vtrap` functions found in NMODL files in the wild.
      * Split Arbor SIMD intrinsics support into AVX2- and AVX512-specific files.
      * Add unit tests for new maths operators for C++, SIMD and CUDA implementations.
      a80df6fa
  12. Dec 19, 2017
    • Sam Yates's avatar
      Reduce differences between `util::optional` and `std::optional`. (#420) · 80fe2f01
      Sam Yates authored
      Reduce differences between `util::optional` and `std::optional`.
      
      * Rename `util::nothing` to `util::nullopt`.
      * Replace `util::get()` by`util::optional::value()`.
      * Add correct move semantics to `util::optional::value()`.
      * Add `util::optional::value_or()` method.
      * Remove unused monadic functionality from `util::optional` and `util::uninitialized`.
      * Update code formatting to closer adhere to coding guidelines.
      * Add convenience ""_s string constructor for unit tests.
      * Update unit tests accordingly.
      
      Fixes #419.
      80fe2f01
  13. Dec 18, 2017
  14. Dec 16, 2017
    • Ben Cumming's avatar
      Implement cell-local event generators (#414) · 70d58166
      Ben Cumming authored
      Implement generic `event_generator`, and some common generators that should be useful to users out of the box:
      * poisson sequence                                                                                       
      * uniform regular sequence
      * from a user-prescribed sequence
      * from a `std::vector` of post synaptic events.
      
      Extend `recipe` API to provide an `recipe::event_generators(gid)` that returns a list of `event_generator`s attached to a cell with `gid`.
      
      Update the `model` class and `merge_events` method to support event generators.
      
      Fixes #401 
      70d58166
  15. Dec 11, 2017
    • Wouter Klijn's avatar
      410 rss cell bug (#411) · 1bd65e13
      Wouter Klijn authored
      Fix bug in `rss_cell_group`s with more than one cell with different `dt` or `start_time` values.
      Fixes #410.
      1bd65e13
  16. Dec 05, 2017
  17. Nov 30, 2017
    • Wouter Klijn's avatar
      Move miniapp sources to a miniapps directory (#408) · 3b5b0386
      Wouter Klijn authored
      Restructure the miniapp in such a way that we have to option to have multiple parallel mini-applications.
      
      Move the original miniapp directory to a miniapps directory.
      Output executable also in a nested miniapps directory.
      Update the Travis to point to the new executable location.
      3b5b0386
  18. Nov 29, 2017
    • Ben Cumming's avatar
      support ion species concentration updates (#398) · fa7d99b6
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Add querying methods to modcc ion species type to simplify code generation.
      * Add `WriteBack` type that records per-mechanism ion usage metadata.
      * Add `write_back` implementation for C and CUDA printers that adds weighted concentration
        contributions to global concentration fields.
      * Extend `uses_ion` interface to provide information about which concentration fields are modified by mechanisms.
      * Update `update_ion_symbols` lambda that is responsible for adding metadata about interactions between mechanism fields and external ion species fields, creating a write-back when the mechanism field is a state variable or an indexed variable if it is a current/reversal potential, or else an error.
      * Add `test_ca.mod` mechanism that writes calcium ion concentration for testing purposes.
      * Add back-end callbacks that initialize concentration values.
      * Update `mechanism::uses_ion()` to return information regarding mechanism ion concentration updates.
      * Add `mechanism::write_back()` method.
      * Update stimulus mechanism specialization to use new mechanism interface.
      * Update `ion` type to calculate default concentration contributions in CVs where the concentration is only partially determined by mechanisms.
      * Update `fvm_multicell` to calculate the default ion concentration weights.
      * Add unit test for ion concentration weight determination.
      
      Fixes #373 
      fa7d99b6
  19. Nov 28, 2017
    • Sam Yates's avatar
      Tidy `modcc` driver, remove optimize flag. (#404) · 998ee724
      Sam Yates authored
      * Remove optimization option (use SIMD options for vectorization).
      * Remove arbor utility library dependencies from modcc (pending separation of utility lib from arbor lib source).
      * Split target (cpu, gpu) specification from vectorization architecture (avx2, avx512).
      * Remove `Options` singleton; replace with structure local to `modcc.cpp`.
      * Tidy `modcc` option parsing and main function; allow a single invocation of `modcc` to generate code for multiple backends.
      * Rename generated sources to include backend target in filename.
      * Always run a constant simplification pass on generated procedures.
      * Remove file i/o code from `Module` and `modcc` main function; move functionality to new functions in `io` namespace. (Note: in on-going mechanism revamp, other i/o utility code will reside in the `io` namespace and subdirectory.)
      * Remove classes `ConstantFolderVisitor` and `ExpressionClassifierVisitor` that are no longer used.
      * Modify CMakeLists.txt files, `backends/*/fvm.cpp` to reflect the new filenames of generated sources.
      * Small formatting changes in `modcc` source to reflect coding guidelines (incomplete).
      998ee724
    • Sam Yates's avatar
      Fix binary operator parentheses bug. (#400) · 67721f02
      Sam Yates authored
      Fixes #399.
      
      Update `test_printers.cpp`:
      * Fix compilation and scope management issues, and re-include in CMakeLists.txt.
      * Update to use `verbose_print` (run-time verbosity).
      * Apply expected output tests to `CPrinter` and `CUDAPrinter` outputs.
      
      Address binary operation rendering issue:
      * Move C-style expression rendering common to `CPrinter` and `CUDAPrinter` to a specialized `Visitor`, `CExprRenderer`.
      * Use operator associativity to determine need for parentheses around sub-expressions of a binary expression.
      67721f02
  20. Nov 20, 2017
    • Ben Cumming's avatar
      Fix GPU event delivery bugs (#394) · 8566655c
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Properly iterate over all event queues in the case where a cell group has more than once cell (triggered in e.g. GPU miniapp).
      * Update GPU unit test to use the new `cell_group::advance()` interface.
      8566655c
    • Ben Cumming's avatar
      modcc now enforces derivatives only on state variables (#392) · 87a52776
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Derivatives should only appear on the left hand side of expressions that describe the time evolution of state variables. Without this check `modcc` segfaulted when processing a derivative expression of a non-state variable.
      
      * Specialize the semantic analysis of `DerivativeExpression` to enforce that derivatives are only applied to state variables.
      87a52776
  21. Nov 16, 2017
    • Ben Cumming's avatar
      Move event wrangling from cell_group to model (#390) · c76c0520
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Remove `cell_group::enqueue_events` interface: `cell_group::advance` is given the events to deliver in the next epoch directly.
      * Implement event lane merging in `model` with stand-alone `merge_events` function.
      * Ensure event-delivery order is preserved across differing domain decompositions by performing a lexicographic sort over all of the `postsynaptic_spike_event` fields: fixes #385. 
                                                                                                               
      Fixes #378.
      c76c0520
    • Sam Yates's avatar
      Add custom streambuf for indented output. (#391) · 2fe61d04
      Sam Yates authored
      These classes aim to provide an alternative to `TextBuffer` in `modcc` printers.
      
      * Implement a streambuf wrapper `prefixbuf` that prepends a prefix string to each line.
      * Adds stream manipulators `setprefix`, `indent`, `popindent`, `settab` for manipulating the prefix in a `prefixbuf`.
      * Provide a wrapper stream `pfxstringstream` around `std::stringbuf` with `std::ostringstream` semantics.
      
      As implemented, a prefix string set with the `setprefix` is applied to the underlying streambuf, and is not a property of the stream. This behaviour may be surprising, so consider storing this prefix with the stream as a possible enhancement.
      2fe61d04
  22. Nov 14, 2017
    • Ben Cumming's avatar
      Use Nernst equation to calculate reversal potentials (#387) · 256c5421
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Replace constant values for ion species reversal potentials taken from HH model with values that are updated on each time step via the Nernst equation.
      
      * Implement Nernst equation in multicore and gpu back-ends.
      * Extend interface of `ion` type to proved a method `update_reversal_potential` which calls the back-end nernst routine.
      * Add `valency` and default concentration values to the ion species.
      * Add interface for resetting ion species state (for restarting simulations).
      
      Fixes #376 
      256c5421
  23. Nov 09, 2017
    • Ben Cumming's avatar
      Convert currents to current densities in FVM (#381) · bca33966
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Update the FVM formulation to use current densities instead of currents.
      
      Modifications to modcc:
      * Update printers to store and use weights for point process mechanisms,
      * Scale ion species current contributions by area proportion, similarly to contributions to the accumulated current.
      
      Changes to FVM code:
      * Update weights calculation for density and point processes mechanisms:
          * density channels use relative proportion of CV area, i.e. "density",
          * point processes use the reciprocal of the CV area to convert to a density.
      * Add `cv_area` parameter for matrix constructor, which is used by matrix assembly to convert current densities to currents.
      * Update stimulus implementations (gpu and cpu backends) to contribute current densities.
      
      Other changes:
      * Update unit tests to use new interfaces.
      * Update units section in LaTeX docs.
      
      Fixes #374.
      bca33966
  24. Nov 08, 2017
  25. Nov 07, 2017
  26. Nov 03, 2017
    • Ben Cumming's avatar
      Optimise host-side event wrangling [8] (#369) · 0726685c
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Optimize host-side postsynaptic event queues:
      
      * Have communicator store stage local postsynaptic events per cell instead of per cell group.
      * Pass (by reference) the relevant subrange of vectors of per-cell events to the cell group `enqueue_events` method.
      * Identify calls to cell group `enqueue_events` and `advance` with an integration epoch identification allowing the use of an efficient thread-safe data structure for the cell group event stores.
      * Perform merge of new events and currently stored events not for delivery in current epoch in parallel across cells in `mc_cell_group::enqueue_events`.
      * Store one event binner object per cell in `mc_cell_group` to avoid hash table lookup overheads in the `binning_kind::following` case, and simplifying the `event_binner` class.
      * Add convenience time comparison functional object `event_time_less`.
      
      Fixes #368.
      0726685c
  27. Nov 02, 2017
    • Sam Yates's avatar
      Add mechanism parameter setting/new implementation. (#377) · b7623d13
      Sam Yates authored
      Fixes #350 
      
      * Replace parameter_list with mechanism_spec.
      * Add prototype for mechanism parameter schema checking.
      * Allow mechanism weights to be set after construction.
      * Combine range parameters on density mechanisms by linear contribution in CVs.
      * Cable segment electrical parameters are now member variables.
      * Publish mechanism parameter information through new method `mechanism::field_info`; note this will be replaced/improved in upcoming dynamic mechanism catalog work.
      * Access mechanism parameter scalars and range data via `mechanism::field_view_ptr` and `mechanism::field_value_ptr` methods.
      * Allow mechanism 'global' parameters to be set via a method of specializing mechanisms (and giving them corresponding aliases).
      * Extend recipe interface to allow querying of per-cell-kind global information for use by cell group implementations.
      * Add unit tests for above - note that linear density mechanism parameter test is tightly coup...
      b7623d13
  28. Nov 01, 2017
  29. Oct 02, 2017
    • Ben Cumming's avatar
      Add micro-benchmark for event delivery setup (#359) · 1c86fdb2
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Add a micro-benchmark that illustrates scaling issues with event-setup on cell groups with many cells.
      
      The benchmark also illustrates some alternative approaches that are significant optimizations over the current approach.
      
      Fixes #357.
      1c86fdb2
  30. Sep 28, 2017
    • Sam Yates's avatar
      Rename NestMC references, names etc. to Arbor. (#363) · d9f38b2a
      Sam Yates authored
      * Use ARB_ and arb_ as variable prefixes in place of NMC_ and nmc_.
      * Replace references to 'NestMC' and 'NEST MC' to refer instead to Arbor.
      * Use 'arbor' as the sim name in generated validation data.
      * Reflow long-line paragraphs in `tests/ubench/README.md`.
      * Change names of CUDA mechanism and CUDA kernel libraries to include arbor name.
      d9f38b2a
    • Sam Yates's avatar
      Change nest::mc namespaces to arb (#362) · d9f99489
      Sam Yates authored
      Change nest::mc namespaces to arb
      d9f99489