Skip to content
Snippets Groups Projects
  1. Aug 29, 2019
    • Sam Yates's avatar
      New analysis for passive cable equation (#842) · 07a9fa2f
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      * Replace derivation of cylindrical cable equation formula with S–L approach.
      * Relate analysis of cylindrical form to Rallpack 1 in a separate section.
      * Add analysis of tapered cable case.
      * Unify discussion of cable with constant electrical properties but varying geometry.
      * Add section describing how one can well-estimate the inter-cell flux given point samples or CV means for the membrane voltage.
      07a9fa2f
  2. Aug 26, 2019
  3. 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
  4. 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
  5. Sep 21, 2017
    • Ben Cumming's avatar
      Seperable compilation of mechanism kernels on GPU (#353) · 3c283219
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Separable compilation of the CUDA kernels generated by modcc from NMODL files.
      
      CMake scripts:
      * Update the `build_modules()` helper function to cleanly handle calls to modcc that generate multiple output files.
      * Add a new library target `gpu_mechanisms` for the separately compiled CUDA kernels and the implementation of their C wrappers.
      * Reduce verbosity of compilation messages.
      
      * Simplify mechanism C++ namespace use: move everything in nest::mc::mechanisms::gpu::_mechanism-name_ into `nest::mc::gpu`, and similarly for multicore mechanism implementations, ions.
      * Remove template parameters for `value_type` and `size_type` from all of the 
      mechanism implementations, and use `fvm_value_type` and `fvm_size_type` everywhere instead.
      
      modcc changes:
      * Modify `CUDAPrinter` to keep track of 3 text buffers, one each for 
        "implementation", "interface" and "implementation interface":
      * Write the CUDA implementation interface to `X_impl.hpp`, comprising the definition of the mechanism-specific 'X_ParamParck' struct used to pass function arguments to the CUDA kernels.
      * Write the CUDA kernels and C wrappers to `X_impl.cu`.
      * Write the public C++ mechanism interface (with calls to implementation wrappers) to `X.hpp`.
      * Modify modcc driver to support multiple generated output files.
      3c283219
  6. Jan 12, 2017
    • John Biddiscombe's avatar
      CMake fixes (#137) · 71aa4b18
      John Biddiscombe authored
      * Fix CMakeLists to handle build as a subproject
      
      When several CMake generated projects are build together, it is common
      practice to have a 'superproject' CMakeLists that uses
        add_subdir(proj1)
        add_subdir(proj2)
        ...
      where each subproject is a self contained CMake based project
      (Example proj1=HPX, proj2=nestmc, proj3=another, ...)
      
      CMAKE_SOURCE_DIR always points to the top level directory which
      is the superproject dir in this case, whereas PROJECT_SOURCE_DIR
      always points to the root of the current project() in the CMakeLists
      so one shouod use PROJECT_SOURCE_DIR as this gets the relative paths
      correct.
      
      * Add option to turn off auto generation from *.mod files
      
      * Fix #134 : Change CMake WITH_OPTION to NMC_WITH_OPTION, compiler #define to NMC_HAVE_OPTION
      
      1) The user may select an option by saying NMC_WITH_XXX
      
      2) This may trigger CMake to use find_package(...) or setup some
      other variables. CMake can then set variable NMC_HAVE_XXX and add a
      what has actually been used.
      
      3) Code should use #ifdef NMC_HAVE_XXX to check for a feature
      
      Old CMake/define      New CMake                 Compiler #define
      ----------------      ---------                 ----------------
      THREADING_MODEL       NMC_THREAD_MODEL
          WITH_TBB          NMC_WITH_TBB              NMC_HAVE_TBB
          WITH_OMP          NMC_WITH_OMP              NMC_HAVE_OMP
          WITH_SERIAL       NMC_WITH_SERiAL           NMC_HAVE_SERIAL
      
      WITH_MPI              NMC_WITH_MPI              NMC_HAVE_MPI
      WITH_CUDA             NMC_WITH_CUDA             NMC_HAVE_CUDA
      WITH_GPU                                        NMC_HAVE_GPU
      WITH_ASSERTIONS       NMC_WITH_ASSERTIONS       NMC_HAVE_ASSERTIONS
      WITH_TRACE            NMC_WITH_TRACE            NMC_HAVE_TRACE
      WITH_PROFILING        NMC_WITH_PROFILING        NMC_HAVE_PROFILING
      
      Other user visible CMake vars
      -----------------------------
      VECTORIZE_TARGET            -> NMC_VECTORIZE_TARGET
      USE_OPTIIZED_KERNELS        -> NMC_USE_OPTIIZED_KERNELS
      BUILD_VALIDATION_DATA       -> NMC_BUILD_VALIDATION_DATA
      BUILD_JULIA_VALIDATION_DATA -> NMC_BUILD_JULIA_VALIDATION_DATA
      BUILD_NRN_VALIDATION_DATA   -> NMC_BUILD_NRN_VALIDATION_DATA
      VALIDATION_DATA_DIR         -> NMC_VALIDATION_DATA_DIR
      
      Variables such as NMC_THREADING_MODEL and NMC_VECTORIZE_TARGET now use
      enumerated cmake values so you can toggle between them in ccmake gui.
      SYSTEM_TYPE_CRAY/BGQ        -> NMC_SYSTEM_TYPE (Generic/Cray/BGQ)
      
      * Use generator expression for modcc path
      
      Some IDE's (like Xcode for example), override the CMake binary paths
      and add /Debug or /Release etc so rules that have hard coded paths
      to binaries will fail.
      71aa4b18
  7. Nov 14, 2016
    • Ben Cumming's avatar
      First GPU support (#77) · 97e17b18
      Ben Cumming authored
      This PR is part of the gpu feature merge. The GPU implementation is not implemented here. Instead, we focus on refactoring of the original "multicore" back end so that it is ready for adding the GPU back end.
      
      This is a big and messy change, for which I am sorry.
      
      ## build System
      
      - A `WITH_CUDA` option has been added to the main CMakeLists. This finds the CUDA toolkit, and sets CUDA compiler flags, and will build unit tests for the gpu back end.
      - The CMakeLists that generates mechanisms with modcc has been updated to generate CUDA mechanisms.
      - the library is now named `libnestmc` instead of `libcellalgo`
      - merge the external libraries that are optionally linked againts (tbb, libunwind, etc) into a single
        `EXTERNAL_LIBRARIES` list for ease of linking
      
      ## modcc
      
      - the cprinter and cudaprinter have had small changes to generate mechanism files that are compatible with the refactored library.
      
      ## algorithms
      
      - the indexes into algorithm was "rangified". An algorithm `index_into_iterator` takes two ranges as inputs to make a range that lazily generates the index of sub into super set.
      
      ## backends
      
      - made a new path `src/backends/` for backend specific type and implementation code.
      - currently:
        - complete support for the `multicore` and `gpu` backends
        - `gpu` back end is not optimized or validated
      - the back end implementations are in `src/backends`
      - a single `backend` class, `nest::mc::{multicore,gpu}::backend`, is provides all backend specific type and implementation details fro each backend
        - storage containers
        - Hines matrix assembly for FVM method
        - Hines matrix solver
        - mechanism "factory"
      
      ## lowered fvm cells
      
      - removed `fvm_cell` because this can be modelled with an `fvm_multicell` with one cell.
      - refactored to use backend type and implementation from `fvm_policy`
      - use `std::vector` instead of containers in `nest::mc::memory::` where possible when building cells.
      
      ## memory library
      
      Refactor the "memory" library, making it much simpler and better integrated into the rest of the application. However, it is still far from perfect. The `Coordinator` approach needs to be improved, most likely by putting target-specific wisdom into pointers (which could obviate the need for a `const_array_view` type.
      1. renaming and moving
         - move from `vector/` to `src/memory`
         - move into the `nest::mc` namespace, i.e. all types and functions are now in `nest::mc::memory`
         - change from camel case nameing scheme to NestMC style naming.
      2. simplification
         - remove the CRTP cruft that was used to make operator overloading work for operations like copying from one range into another, and filling a range with a constant value. These have been replaced with `memory::fill()` and `memory::copy()` helper functions. This simplified the code _a lot_, and makes code clearer in user land.
         
         ```
         // before
         vec(0, 5) = other;
         // now
         memory::copy(other, vec(0, 5));
         ```
         - add some wrappers in `src/memory/wrappers.hpp` that help with making views. These are particularly useful for passing `std::vector` through interfaces that expect a view.
      
      ## debug backtraces
      
      Added stack traces for debugging.
      - support for OSX and Linux via libunwind
      - backtraces can be generated manually `nest::mc::util::backtrace().print()`
        - creates a new file and dumps trace into file
        - prints message to `stderr` with file name and instructions on how to analyse
      - backtraces are also automatically generated when an assertion `EXPECTS` statement fails
      - a python script in `scripts/print_backtrace` pretty prints the output with file name, line number and demangled symbols
      
      ## util simplification and consolidation
      
      The `src/util.hpp` file was removed
      - much of its contents were dead code and just removed
      - useful components like `pprintf` and `make_unique` were moved into the `src/utils` path in standalone files
      There was a lot of overlap between functionality provided in `src/memory/util.hpp` and existing functions/types in the `nest::mc::util` namespace. The `memory` implementations were removed, and their `nest::mc::util` counterparts used. There is still some work remaining, namely moving the rest of the `src/memory/util.hpp` into `src/util/...`
      97e17b18
  8. Aug 25, 2016
    • Benjamin Cumming's avatar
      WIP communication testing · 8314d37c
      Benjamin Cumming authored
      * fix compile time error in src/model.hpp
      * add mpi_listener type for sensible output and error reporting
        when using MPI with Google Test.
      * add stub for communicator unit testing
      8314d37c
  9. Aug 18, 2016
  10. Aug 05, 2016
  11. Jul 01, 2016
    • Benjamin Cumming's avatar
      improved spike chain generation in minapp · fdedb831
      Benjamin Cumming authored
      * add header only library TCLAP for parsing command line arguments
          - added as git submodule
          - update CMakeLists to include headers
      * remove the ring model from miniapp
      * add support for user supplied parameters for miniapp
          - arguments for cell counts etc can be command line flags
          - or in a user-defined json input file
      * the all-to-all model supports synapses-per-cell is less than
        the total number of cells
          - in this case a random set of sources is selected
      fdedb831
  12. Jun 24, 2016
    • Benjamin Cumming's avatar
      Add MPI support to miniapp · 520d27a1
      Benjamin Cumming authored
      Added MPI support to the miniapp
      - added ring model and all-to-all model
      - started refactoring general model setup steps into a model class in
        miniapp
      - optional -DWITH_MPI to turn on MPI support
      520d27a1
  13. May 04, 2016
  14. May 02, 2016
  15. Jan 26, 2016
  16. Jan 07, 2016
  17. Dec 22, 2015
  18. Dec 13, 2015