Skip to content
Snippets Groups Projects
  1. Oct 10, 2018
    • Sam Yates's avatar
      Add installable CMake config for arbor (#616) · 7ade5c26
      Sam Yates authored and Benjamin Cumming's avatar Benjamin Cumming committed
      Fixes #612.
      
      * Fix issues with permissions on directories created at install time (at least for CMake 3.11+).
      * Add CMake export guff to various targets and install an `arbor-config.cmake` for consumption by other CMake-based projects.
      7ade5c26
  2. Sep 07, 2018
  3. Sep 05, 2018
  4. Aug 29, 2018
  5. 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
  6. 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
  7. 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
  8. May 09, 2018
    • 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.
      * Extend `cable1d_neuron` global data to encompass: mechanism catalogue; default ion concentrations and charges; global temperature (only for Nernst); initial membrane potential.
      
      Modcc:
      * Collect printer sources in modcc under `printer/`.
      * Move common functionality across printers into `printer/printerutil.{hpp,cpp}`.
      * Add string to file I/O implemented in routines read_all and write_all in `io/bulkio.hpp`.
      * Implement indent-friendly source code generation via a `std::streambuf` filter `io::prefixbuf` defined in `io/prefixbuf.hpp`, together with manipulators and a corresponding std::ostream-derived wrapper.
      * Rewrite printers to use new infrastructure: cpu target incorporates SIMD printing options; CUDA printer at this point produces only stubs for CUDA kernel wrappers.
      * Modify SIMD printing command line options for modcc: `-s` enables explicit vectorization using the SIMD classes;  `-S <N>` allows a specific data width to be prescribed.
      * Fix problem in `test_ca.mod` with uninitialized ion current.
      * Add infrastructure support to allow future pre-computation of SIMD index conflict cases for (hopefully) faster scatters and updates.
      * Simplify `IndexedVariable` expressions in the AST, making data source explicit via a `sourceKind` enum, and leaving the indexing method and index names up to the printers.
      * Allow state variables in the AST to 'shadow' an ion concentration — these are assigned in the
      generated `write_ions` method.
      
      SIMD classes:
      * Add `simd_cast` operation between SIMD value types of the same width, and with `std::array`. (Note: this was tested and used in an early development version of the code, but not in this version. It was still a lacuna in the original SIMD wrappers, so it has been left in.)
      * Restructure SIMD gather/scatter API to use a `simd::indirect` expression,  which encapsulates a pointer and SIMD offset.
      * Add `simd::index_constraint` scoped enum to describe knowledge of contention in indirect indices, so that we can branch on this to the appropriate implementation.
      * Add SIMD concrete implementation routines `reduce_add` for horizontal reduction and `element0` for access to first lane scalar value.
      * Add SIMD value method `sum()` that exposes implementation `reduce_add`.
      * Add SIMD concrete implementation routine `compound_indexed_add` that provides the implementation for `indirect(p, simd_indices) += simd_value` construction.
      * Fix SIMD `implbase` bug where some static methods were using the `implbase` fall-back functions instead of the derived class specialized implementations.
      * Move SIMD mathematical functions into friend routines of `simd_impl` in order to resolve implicit conversions from scalars in mixed SIMD-scalar operations.
      * Use a templated `tag` class to dispatch on SIMD concrete implementation types, to avoid problems with incomplete types in method signatures.
      * Remove old SIMD intrinsics.
      
      CMake infrastructure:
      * Downcase some variables in `CMakeLists.txt` files to  distinguish them visually from CMake keywords and variables.
      * Split arbor modcc vectorization option (now `ARB_VECTORIZE`) and target-architecture optimization (now `ARB_ARCH`).
      * For `arbor` and `arbormech` targets, and in particular not the `modcc` target, use `ARB_ARCH` to generate corresponding target-appropriate binaries, including, for example, appropriate SIMD support.
      * Extend `CompilerOptions.cmake` to map as best as able between the various target architecture names (we use the gcc names) and the correct option to pass to the compiler based on the compiler and platform.
      * Add work-around for misidentification by CMake of XL C as Clang.
      * As a temporary work-around, include `arbormech` library twice on link line to resolve circular arbor–arbormech dependencies.
      
      Unit tests:
      * Extend repertoire of generic sequence equality/near equality testing support  in `common.hpp`.
      * Add warning suppression for icc for the malloc instrumentation code.
      * SIMD unit tests for indirect expressions, compound indirect add, reduction.
      * Make some exact tests into floating point 'near' tests when comparing computed areas and lengths in swc and fvm layout tests, to account for compiler (e.g. icc) performing semantically inequivalent floating point operation reordering or fusion at `-O3`.
      * Split out some of the CUDA tests into separate .cpp/.cu files for  separate-compilation purposes.
      
      Other:
      * The `padded_allocator` has been modified to propagate alignment/padding on move and copy (these semantics make their use much easier and safer in the multicore mechanism instantiation code).
      * Map/table searching utilities in `util/maputil.hpp`.
      * Fixes for correct sequence type categorization and `begin/end` ADL.
      * Fixes for type guards for range methods that take universal references.
      * Removal of some redundant code in range utilities through the use of universal references.
      * Add new range view `reverse_view` for ranges delineated by bidirectional iterators.
      * Add single argument form of `make_span` to count up from zero, and associated helper `count_along` that gives a span that indexes a supplied container.
      * Moved `prefixbuf` to `modcc` source.
      * Make sequence positive and negative tests in algorithms generic.
      * Add `private`-subverting helper code/macro to `tests/unit/common.hpp` to reduce the number of public testing-only interfaces in the library code.
      * Add virtual destructors for virtual base classes.
      * Add new arb::math:: functions: `next_pow2` for unsigned integral types, `round_up` to round a number away from zero to next largest magnitude multiple.
      * New `index_into` implementation that supports bidirectional access (moved to `util::` namespace).
      * Fix problem in `test_ca.mod` with uninitialized ion current.
      * Rework dangerous `memory::array(Iter, Iter)` constructor to be less dangerous (and do the expected thing).
      * Allow ranges to be constructed from other ranges if the iterators are compatible.
      68135148
  9. Mar 16, 2018
    • Sam Yates's avatar
      SIMD wrappers for Arbor generated mechanisms. (#450) · 2dff9c41
      Sam Yates authored
      This provides a bunch of SIMD intrinsic wrappers as a precursor to the SIMD printers.
      
      The aim is that the SIMD printer can be agnostic regarding the particular vector architecture.
      
      The design is based rather loosely on the proposal P0214R6 for C++ Parallelism TS 2. The transcendental function implementations are adapted from the existing SIMD architecture-specific code, which in turn are based on the Cephes library algorithms.
      
      The custom CSS for the html documentation have been tweaked.
      2dff9c41
    • 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
  10. 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
  11. Dec 20, 2017
    • 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. Aug 24, 2017
    • Ben Cumming's avatar
      Basic Sphinx Documentation (#328) · 610fd857
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Adds support for building documentation with Sphinx from reStructuredText-formatted files in the `doc` subdirectory. Automatic building has been verified with ReadTheDocs.
      
      * Add basic documentation to the `doc` path.
      * Use a git submodule and associated CMake to pull in ReadTheDocs theme at configuration time.
      610fd857
  13. Aug 18, 2017
    • Ben Cumming's avatar
      Better TBB CMake integration (#331) · 6dce9fa4
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      * Add support for CMake scripts provided by TBB.
      * Update required cmake version to 3.0.
      
      * hack to get linking to work on Cray PE
      
      * improve comments and remove redundant include in CMakeLists
      
      * firewall the tbb cmake files
      
      * tbb threading back end to_string includes version number
      6dce9fa4
    • Ben Cumming's avatar
      Refactor domain decomposition for arbitrary gid distribution. (#326) · cba9d458
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      Changes to `domain_decomposition`:
        * `domain_decomposition` performs two pass load balancing in constructor:
            1. first pass performs global load balance,
            2. second pass distributes cells locally between cpu and gpu cell_groups.
          The current logic for this is very simple and naive, and will be replaced with a load balancer which returns a lighter domain decomposition description in a follow up pull request.
        * Provides a simple `group_description` type that contains gid, `cell_kind` and target backend information for `cell_group_factory`.
      
      Changes to `communicator`:
        * Constructor takes a `domain_decomposition` and recipe.
        * The interface for adding connections and constructing connection table has been removed, as this is now performed within the constructor.
        * Construction is more complicated, as connections are partitioned by source gid which requires multiple passes over the connection information in the recipe.
        * `make_event_queues` updated: spikes and connections are now partitioned by source domain, and an optimization dynamically chooses to iterate over either connection or spike list, whichever is shorter.
        * The `exchange` method now sorts `local_spikes` before global gather to facilitate the optimized spike/connection searching.
      
      Changes to `miniapp`:
        * Automatically use gpu if available and compiled with gpu support.
        * Banner prints out useful information about number of cores, gpus and ranks.
        * Remove -g cell group size flag.
      
      Changes to `cell_group`:
        * `cell_group` interface take a list of gid values instead of a range.
        * Updated internal `cell_group` logic to convert between gid and local indices: use a vector for local index to gid map, and a hash table for gid to local index in `cell_group` implementations that need this lookup.
      
      changes to unit tests
        * tests for the domain decomposition
        * tests for the communicator that test ring and all2all networks
      cba9d458
  14. Jun 15, 2017
  15. Mar 06, 2017
    • Sam Yates's avatar
      Morphology generation with L-systems (#162) · 7f9288fb
      Sam Yates authored
      Adds a stand-alone program for the generation of random morphologies form a L-system description. The algorithm is that of Burke (1992), with some of the extensions provided by Ascoli et al. (2001).
      
      Two sets of L-system parameters have been included, corresponding to alpha motoneurons and Purkinje cells, but there is certainly something wrong with the data for the latter, and more correct numbers will probably need to be synthesized from existing Purkinje cell morphological information.
      
      Documentation for `lmorpho` is incomplete, but the command line help (`--help`) goes some way to explain the usage. In order to get output, one must specify `--swc` or `--pvec` (or both) to emit SWC files or the structural parent vectors. Coarser discretization can be obtained with the `--segment` option.
      
      Some minor modifications have been included in other parts of the source repo:
      * Added copy constructor for `TextBuffer` in `modcc/textbuffer.hpp`, required to keep cl...
      7f9288fb
  16. Dec 13, 2016
    • Ben Cumming's avatar
      Bug/issue#20 (#123) · fbe3f45a
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      This PR addresses two issues that were closely related:
      * correctly accounting for the current contribution of density mechanisms to CVs at branch points, where the density mechnanism is not present on all branches. This was discussed in issue #20.
      * adding support for weighting of current densities calculated from density mechanism. This is required to weight the current contribution to CVs in issue #20.
      
      ## small updates
      
      * update CMake rules for finding libunwind, because it broke for some reason.
      * add `binary_find` and unit tests to the algorithms library
          * returns an iterator, as opposed to `std::binary_search`, which returns a boolean.
          * works with ranges.
      * added `subrange_view` specialization that takes a subrange specified by a pair of indexes
      * added `assign_from` to range utils
          * a helper function that returns a proxy type that can be copied into a container
          * evaluate a range and store contents in a container, with minimal verbosity in user cod...
      fbe3f45a
  17. Nov 25, 2016
    • Ben Cumming's avatar
      Bug/issue#97 (#102) · db5a7362
      Ben Cumming authored and Sam Yates's avatar Sam Yates committed
      This addresses all of the compiler warnings and errors for xlc when compiled at -O0. There are still compiler bugs when compiling with higher optimization levels, however they are more challenging.
      
      * Ignore the incorrect `-Wno-missing-braces` warnings (similarly to Clang).
      * Remove `-qhalt=e flag` inserted by CMake.
      * Remove redundant comparison of char to EOF in lexer.
      * The XLC compiler was crashing inexplicably on one call of the following method:
         ```void run(..., const std::vector<float>& excl={}) {...}```
        This was fixed by not having a default value for the last argument.
      * Add some curly braces to silence warning for dangling else.
      
      fixes #97
      db5a7362
  18. 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 algori...
      97e17b18
  19. Oct 27, 2016
  20. Aug 24, 2016
    • Benjamin Cumming's avatar
      improve support for vectorization in CMake · 5271e619
      Benjamin Cumming authored
      * the user can specify one of {none,AVX,AVX2,KNL} as
        targets for vectorization
      * if modcc is available in PATH it will be used, which
        makes cross compilation easier
      * a new flag USE_OPTIMIZED_KERNELS can be set to
        generate optimized kernels from the modcc compiler
        (equivalent to adding -O flag to modcc)
      5271e619
  21. Jul 09, 2016
  22. Jul 08, 2016
    • Benjamin Cumming's avatar
      fix cmake to find TBB installed from source · 5343f3f7
      Benjamin Cumming authored
      there was a problem with the FindTBB script for cmake where it cmake was
      not looking in paths specified by the environment variable LIBRARY_PATH,
      which meant that it was not finding the TBB library files when TBB had
      been installed from source and configured with tbbvars.sh
      5343f3f7
  23. Jul 06, 2016
  24. Jun 22, 2016
  25. Jun 11, 2016
    • Sam Yates's avatar
      Infrastructure for compiler-specific options · 034b17bb
      Sam Yates authored
      * Add file cmake/CompilerOptions.cmake for setting up compiler
        specific options
      * Disable 'missing-braces' warning on Clang
      * Avoid defect in g++ 4.9.2 standard library that omits move
        constructor for `stdd::ifstream`
      * Remove signed/unsigned warning in test_optional.cpp
      034b17bb