Skip to content
Snippets Groups Projects
  1. Jul 26, 2018
  2. Jul 25, 2018
    • Benjamin Cumming's avatar
      Remove `memory::array` from `arb::tree` (#547) · af5fe62a
      Benjamin Cumming authored
      This small refactor simplifies the interface and implementation of the `tree` type.
      * use `std::vector` instead of `memory::array` for internal storage in `arb::tree`
      * return a `util::range` intstead of a view for `tree::children(int)`
      * remove unused functionality for changing the root of a tree.
    • noraabiakar's avatar
      fix profiler (#548) · 177cce0d
      noraabiakar authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Add initialize method to the profiler to set up the needed threading parameters given a simulation's task system.
      177cce0d
  3. Jul 24, 2018
    • noraabiakar's avatar
      task_system as part of an execution_context (#537) · 7a6c1031
      noraabiakar authored and Benjamin Cumming's avatar Benjamin Cumming committed
      - Task system is no longer a single system private to the implementation of the threading backend and used everywhere. A separate task_system can be used (with a specified number of threads) for every simulation.
      - arb::execution_context is the interface to task_system  and the previously defined distributed_context
      - TBB and serial support has been removed. Cthreads is the only threading backend available. 
      7a6c1031
  4. Jul 20, 2018
  5. Jul 19, 2018
    • noraabiakar's avatar
      Cthreads: implement task queue per thread with task stealing (#528) · 4d63988a
      noraabiakar authored and Sam Yates's avatar Sam Yates committed
      Cthreads classes:
      - Notification queue : Manages tasks: tries or forces popping and pushing tasks.  
      - Task system : manages the notifications queues; controls which queue to pop from/push to; controls spinning on queues if necessary; manages creating/joining threads. Is a singleton.
      - Task group : manages synchronization on a group of tasks. 
      
      Operation: 
      - Each thread has an associated queue
      - Task system _tries to_ push tasks in one of the available queues. If it is unable to acquire a lock on a queue, it tries the next in a round robin fashion. After it loops all queues if it still hasn't successfully pushed the task, it spins on a single queue until lock is acquired and task is pushed. 
      - Task system _tries to_ pop a task from the calling thread's queue. If it is unable to acquire the lock, it tries to steal the task from another thread's queue, in a round robin loop. If it is still unable to pop a task, it spins on its the c...
      4d63988a
  6. Jul 13, 2018
    • noraabiakar's avatar
      fix to compile bench without mpi (#533) · bbe99176
      noraabiakar authored and Benjamin Cumming's avatar Benjamin Cumming committed
      bbe99176
    • Sam Yates's avatar
      Feature/lib install target part 4 (#531) · d6af0c4d
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      All example code and validation tests no longer require access to private include directories. This provides the minimal requirement for an installable target
      
      Note that it is still not possible to separately build mechanisms from NMODL with just the public includes, and there is not yet any package configuration file creation for use with CMake or pkg-config.
      
      * Replace `hw::node_info` with `proc_allocation`, describing local resources for the purposes of domain decomposition.
      * Group processor counting and gpu counting implementation under `node_info.cpp`.
      * Remove `domain_decomposition` dependency from `cell_group_factory.hpp` so we can use the latter to test for backend support for a cell kind.
      * Add `arb::cell_kind_implementation()` which performs the mapping from cell kind and backend kind to a `cell_group_ptr`-producing function (this will then become the site for custom cell group kind mapping support in future work).
      * Move headers for aux library ...
      d6af0c4d
  7. Jul 10, 2018
  8. Jul 06, 2018
    • Sam Yates's avatar
      Remove NDEBUG tests in memory utils. (#523) · 0c9906bd
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Fixes #182.
      0c9906bd
    • Sam Yates's avatar
      Migrate source/build to c++14 ... · 3ee79191
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Migrate source/build to c++14                                                                                                                    (#522)
      
      * Update `CMakeLists.txt` for C++14 option.
      * Update to gcc 6 minimum.
      * Update travis CI from gcc-5 to gcc-6
      * Use `std::..._t` style type traits, replacing `util::` aliases.
      * Use `std::cbegin`, `std::cend`, and `std::make_unique`, replacing `util::` versions.
      * Remove `DEDUCED_RETURN_TYPE` macros.
      * Remove redundant return type specifications.
      * Use correct ADL for `begin` and `end` in (almost all) the range utilities.
      * Remove redundant `mechinfo` ctor (aggregate initialization suffices).
      * Use lambda capture initializers where appropriate.
      * Use generic `std::equal_to`.
      * Use variable templates for `math::infinity` and `math::pi`.
      * Remove `enum_hash` workaround.
      * Use `""s` string literals where we were using our own `""_s` construction.
      * Use generic lambda for recursive lambda instead of `std::function` wrapper.
      * Use generic lambda for generic arithmetic tests.
      
      Fixes #358.
      3ee79191
    • Sam Yates's avatar
      Fix GPU breakage in last PR (#520) · 26eda785
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Who broke the build? Sam did!
      26eda785
  9. Jul 05, 2018
    • Sam Yates's avatar
      Test for xlC and refuse to build with it. (#519) · 775fe807
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Fixes issue #517.
      
      Deprecate the IBM xlC compiler.
      xlC generates code that is an order of a magnitude slower than gcc, while generating spurious warnings, and requiring hacks and workarounds to pass all tests.
      Supporting it makes no sense.
      
      * Add test and fatal error for xlC detection in CheckCompilerXLC.cmake.
      * Move xlC 13 misdetection work around to CheckCompilerXLC.cmake.
      * Remove xlC-specific compatibility workarounds from code.
      775fe807
    • Sam Yates's avatar
      Feature/lib install target part 3 (#518) · 40612fa7
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      This time we're moving `recipe.hpp` and `simulation.hpp`, plus the requirements they bring.
      
      Code changes:
      * Pimplize `simulation`.
      * Consolidate arbor exceptions: all non-cell kind specific exceptions that might be expected to reach user code now have consistent messages and fit in an exception hierarchy based at `arb::arbor_exception`. Internal errors throw an `arb::arbor_internal_error` exception.
      * Renamed `postsynaptic_spike_event` to `spike_event`. (Note: `pse_vector` name is unchanged.)
      * Repurposed `pprintf` and moved it into `strprintf.h` — further consolidation is a TODO.
      * Made a generic `util::to_string` to avoid redundancy of `operator<<` overloads and other `to_string` definitions. Defaults to ADL `to_string`, `std::to_string`, and finally tries using `operator<<`.
      40612fa7
  10. Jul 03, 2018
    • Sam Yates's avatar
      Move cell description types to public includes. (#508) · a1894edc
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Further work to public install target.
      
      * Move SIMD classes, cell description classes, simple sampler to public include.
      * Rename `cell` to `mc_cell`, `segment` to `mc_segment`, and remove `_description` from cell description class names and includes.
      * Move `compartment_model` out of `mc_cell` interface and use only in `fvm_layout.cpp`.
      * (Provisionally) remove area/volume methods on `mc_cell` and `mc_segment`.
      a1894edc
  11. Jun 25, 2018
    • Sam Yates's avatar
      Feature/lib install target part i (#506) · ad1c78ab
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      CMake and build refactoring
      
      *   Use CUDA as first-class language (leading to CMake 3.9 minimum version requirement).
      
      *   Use 'modern CMake' interface libraries for compiler options, include file and library dependency tracking. Interface library targets:
          * `arbor-deps`: compiler options and library requirements for the `libarbor.a` static library, as governed by configure-time options and environment.
          * `arbor-private-headers`: include path for non-installed headers, as required by unit tests and arbor itself.
          * `arbor-aux`: helper classes and utilities used across tests and examples.
          * `ext-json`, `ext-tclap`, `ext-tbb`, `ext-benchmark`, `ext-sphinx_rtd_theme`: externally maintained software that we include (directly or via submodule) in the `ext/` subdirectory.
       
      *   Single static library `libarbor.a` includes all built-in modules and CUDA objects.
      
      *   Simply configuration options:
          *  `ARB_WITH_TRACE`, `ARB_AUTORUN_MODCC_ON_CHA...
      ad1c78ab
  12. Jun 22, 2018
    • Benjamin Cumming's avatar
      Benchmark cell type (#500) · 6ba39a92
      Benjamin Cumming authored
      Add a new cell type, and corresponding cell_group implementation, for benchmarking the simulator library architecture.
      
      Add an benchmark_cell_group, where each cell in the group
      
      generates a spike train prescribed by a time_seq
      takes a prescribed time interval per cell to perform the cell_group::advance method.
      With this cell type, one can easily build arbitrary networks with prescribed spiking and cell update overheads.
      A miniapp that uses this cell type to build a benchmark model is implemented in example/bench.
      
      Fixes #493
      Fixes #501
      6ba39a92
  13. Jun 07, 2018
    • Benjamin Cumming's avatar
      profile multicore mechanism state and current calls individually (#492) · 5e65a939
      Benjamin Cumming authored
      The built in profiler generates timings for state and current for individual multicore mechanisms.
      
      Modcc generates and PE(advance_integrate_{state,current}_X) profiler calls (along with corresponding PL() for calls to multicore mechanism nrn_state and nrn_current API calls.
      
      No timings are made for the gpu back end, which is not properly supported by the current profiling tools.
  14. Jun 04, 2018
    • noraabiakar's avatar
      Simd partition by constraint (#494) · 64171e43
      noraabiakar authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Changes have been made to the simd implementation of mechansim functions: 
      
      - The node_index array (array of indices that specifies for each mechanism the CVs where it is present), is now partitioned into 4 arrays according to the constraint on each simd_vector in node_index:
          1. contiguous array: contains the indices of all simd_vectors in node_index where the elements in simd_vector are contiguous
          2. constant array: contains the indices of all simd_vectors in node_index where the elements in simd_vector are identical
          3. independent array: contains the indices of all simd_vectors in node_index where the elements in simd_vector are independent (no repetitions) but not contiguous 
          4. none array: contains the indices of all simd_vectors in node_index where the none of the above constraints apply
      
          When mechanism functions are executed, they loop over each of the 4 arrays separately. This allows for optimizations in every category. 
      
      - The modcc...
      64171e43
    • Benjamin Cumming's avatar
      generalize time sequences (#496) · 3082607f
      Benjamin Cumming authored
      Changes to libarbor
      -------------------------
      
      Time sequences were added in `src/time_sequence.hpp`:
      - added new `time_seq` type that implements a type-erasure interface for the
        concept of a time sequence generator.
      - added poisson, regular and vector-backed implementations of the time sequence
        concept.
      
      Event generators:
      - The poisson, regular and vector-backed implementations of the event generator
        concept were refactored to use the.
      
      Cell groups:
      - Removed the `dss_cell_group` and `rss_cell_group` and associated types.
      - Added a generic spike source cell  that generates a sequence of spikes
        at time points specified by a `time_seq`. Using this approach, an
        additional `cell_group` specialization is not required for each type of
        sequence, and user-defined sequences can be used with minimal overhead.
      
      Unit tests
      ------------
      
      - Added unit tests for `time_seq`.
      - Simplified `event_generator` unit tests, because much of the testing
        of the sequences was moved to the `time_seq` tests.
      - Added unit tests for `spike_source_cell_group`.
      
      Changes to miniapp
      -------------------------
      
      - simplified the miniapp by removing the command line options for using an input spike chain from file.
      - updated the miniapp recipe to use `spike_source` cell group instead of `dss_cell_group`.
  15. Jun 01, 2018
    • Benjamin Cumming's avatar
      Runtime distributed context (#485) · 5fde0b00
      Benjamin Cumming authored and Sam Yates's avatar Sam Yates committed
      Move from choosing the distributed communication model from a compile time choice (the old `arb::communication::communication_policy` type) to a run time decision.
      
      * Add `arb::distributed_context` class that provides the required interface for distributed communication implementations, using type-erasure to provide value semantics.
      * Add two implementations for the distributed context: `arb::mpi_context` and `arb::local_context`.
      * Allow distribution over a user-supplied MPI communicator by providing it as an argument to `arb::mpi_context`.
      * Add `mpi_error` exception type to wrap MPI errors.
      * Move contents of the `arb::communication` namespace to the `arb` namespace.
      * Add preprocessor for-each utility `ARB_PP_FOREACH`.
      * Rewrite all examples and tests to use the new distributed context interface.
      * Add documentation for distributed context class and semantics, and update documentation for load balancer and simulation classes accordingly.
      
      Fixes #472
      5fde0b00
  16. May 15, 2018
  17. May 11, 2018
  18. May 09, 2018
    • Benjamin Cumming's avatar
      CUDA back end for the new mechanism infrastructure (#487) · e0f0b5d7
      Benjamin Cumming authored and Sam Yates's avatar Sam Yates committed
      Completes CUDA printing in modcc.
      * Add CudaPrinter visitor, overriding CPrinter.
      * Add `ostream` `operator<<` overloads for `arb::gpu::shared_state` and `device_view` for debugging.
      * Fix GPU back-end bugs.
      e0f0b5d7
    • Sam Yates's avatar
      Mechanism Refactor: multicore and simd (#484) · 68135148
      Sam Yates authored
      First commit of two for mechanism refactor work (refer to PR #484 and PR #483).
      
      FVM/mechanism code:
      * Refactor mechanism data structures to decouple backend-specific implementations and mechanism metadata.
      * Add mechanism catalogue for managing mechanism metadata and concrete implementation prototypes.
      * Add fingerprint-checking to mechanism metadata and implementations to confirm they come from the same NMODL source (fingerprint is not yet computed, but tests are in place).
      * Split FVM discretization work out from FVM integrator code.
      * Use abstract base class over backend-templated FVM integrator class `fvm_lowered_cell_impl` to allow separate compilation of `mc_cell_group` and to remove the dummy backend code.
      * Add a new FVM-specific scalar type `fvm_index_type` that is an alias for `int` to replace
      `fvm_size_type` in fvm layouts and mechanisms. This was chosen as an alternative
      to making `unsigned` versions of all our SIMD implementation classes.
      * Exte...
      68135148
  19. Apr 11, 2018
    • Ben Cumming's avatar
      Domain decomposition and simulation C++ API docs (#471) · 4c742a57
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Add two new documentation pages for the C++ API
      
      * Add domain decomposition page that covers `domain_decomposition`, `node_info` and `partition_load_balance`.
      * Add simulation page that describes `arb::simulation` API interface.
      * Fix some small typos elsewhere in the docs.
      * Use `std::move` when adding spike callbacks to `arb::simulation` (useful if callbacks are stateful).
      4c742a57
    • Ben Cumming's avatar
      Fix support for Keplar (K20 & K80) GPUs. (#470) · 6b659a39
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Fixes issue #467 
      
      * Add GPU synchronization points where required for Kepler to coordinate CPU access of managed memory.
      * Use hand-rolled double precision atomic addition for Kelper targets.
      * Replace `ARB_WITH_CUDA` build option with `ARB_GPU_MODEL` option that takes one of 'none', 'K20', 'K80' or 'P100', and set up source-code defines accoringly.
      * Clean up of redundant compiler flags and defines no longer required now that the project uses separate compilation for CUDA sources.
      6b659a39
  20. Apr 06, 2018
  21. Apr 05, 2018
    • Ben Cumming's avatar
      Add C++ docs for recipe (#461) · bc6fcffd
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Add some C++ API documentation.
      
      * Create C++ API section in docs.
      * Document `arb::recipe`: both a class reference along with more explanatory text and best practices guide.
      * Add some class documentation of basic types required to understand recipe definition.
      * Some in-code comment clean up.
      * Change `arb::cell_kind` from a vanilla enum to a scoped enum.
      bc6fcffd
  22. Mar 29, 2018
    • Ben Cumming's avatar
      rename class 'model' to 'simulation' (#462) · 2b2044a6
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      The name `arb::model` did not clearly describe the role of the class, while `arb::simulation` better captures that this is an instantiation of a model for the purpose of running a simulation, as distinct from the description of a model represented by an `arb::recipe` instance.
      
      * Rename sources `model.{hpp,cpp}` to `simulation.{hpp,cpp}`.
      * Rename class `arb::model` to `arb::simulation`.
      * Update docs and tests to suit.
      2b2044a6
    • Ben Cumming's avatar
      merge all SIMD docs into a single topic (#463) · 3d83af5b
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Put all the SIMD docs in a single topic, to simplify the documentation tree.
      3d83af5b
  23. Mar 27, 2018
    • Ben Cumming's avatar
      Installation Guide (#459) · 0cf65a4c
      Ben Cumming authored
      Added an installation guide to the Read The Docs
      Removed the outdated build/install information from README.md
      Link from README to Read The Docs
      Updated the splash page for Read The Docs
      0cf65a4c
    • Ben Cumming's avatar
      wrap warp intrinsics to fix depricated warnings (#456) · 7e6ea389
      Ben Cumming authored
      CUDA 9 introduced new, fine-grained, thread synchronization primitives.
      In doing so, it introduced new forms of the warp intrinsics like __shfl_up, depricating the old symbols in the process.
      
      It will be a while before we can use 9 as the default minimum, so we have to support compilers that expect the new and old behavior.
      
      There are two options: wrap the intrinsics in question, or pass nvcc a flag to not issue warnings about depricated symbols. I go for the approach of wrapping, because I would rather keep the compiler warning turned on.
      
      Fixes #379.
      7e6ea389
  24. Mar 26, 2018
    • Sam Yates's avatar
      Add padded allocator for aligned and padded vectors. (#460) · 581c4ef3
      Sam Yates authored
      Padded vectors with run-time padding/alignment guarantees will form the basis of the storage class for the new CPU and SIMD generated mechanisms.
      
      * Add `padded_allocator` that aligns and pads allocations.
      * Make microbenchmark for `default_construct_adaptor` that overrides the allocator construct() to default- instead of value-initialization on values.
      * Add `with_instrumented_malloc` class for tracking malloc, realloc, etc. calls.
      * Add unit tests for `padded_allocator`.
      581c4ef3
  25. Mar 20, 2018