Skip to content
Snippets Groups Projects
Select Git revision
  • fa7ea4582e769d735ebb2023bf877c6000687c40
  • master default protected
  • tut_ring_allen
  • docs_furo
  • docs_reorder_cable_cell
  • docs_graphviz
  • docs_rtd_dev
  • ebrains_mirror
  • doc_recat
  • docs_spike_source
  • docs_sim_sample_clar
  • docs_pip_warn
  • github_template_updates
  • docs_fix_link
  • cv_default_and_doc_clarification
  • docs_add_numpy_req
  • readme_zenodo_05
  • install_python_fix
  • install_require_numpy
  • typofix_propetries
  • docs_recipe_lookup
  • v0.10.0
  • v0.10.1
  • v0.10.0-rc5
  • v0.10.0-rc4
  • v0.10.0-rc3
  • v0.10.0-rc2
  • v0.10.0-rc
  • v0.9.0
  • v0.9.0-rc
  • v0.8.1
  • v0.8
  • v0.8-rc
  • v0.7
  • v0.6
  • v0.5.2
  • v0.5.1
  • v0.5
  • v0.4
  • v0.3
  • v0.2.2
41 results

py_simulation.rst

Blame
  • user avatar
    akuesters authored and Ben Cumming committed
    Update documentation for Python.
    
        splits the conceptual model ideas from the C++ docs into their own section
        has C++ and Python docs for recipes, domain decomposition, etc.
    
    fixes #667
    
    Added the following documentation (structure):
    
    GETTING STARTED:
    
        Installing Arbor/Requirements/Optional Requirements/Python
        Installing Arbor/Building and Installing Arbor/Python Front End
    
    MODEL BASICS:
    
        Overview
        Common Types
        Recipes
        Domain Decomposition
        Simulations
    
    PYTHON:
    
        Overview
        Common Types
        Recipes
        Domain Decomposition
        Simulations
    
    DEVELOPERS:
    
        Python Profiler
        Python Unit Testing
    
    GETTING STARTED has two added sections of optional requirements using python and how to build the python front end.
    
    MODEL BASICS describes Arbor's concepts in general (independent of programming language), thus general information on concepts in C++ API was moved here/ added.
    
    PYTHON describes Arbor's python frontend in the same structure as MODEL BASICS and C++ API ( needs updates as soon as features are added/changed in new python PR).
    
    DEVELOPERS section has two added sections for meter management and unit testing with python front end.
    
    Further, some corrections in existing documentation (for obvious errors, e.g. duplicate text, not ending sentences) and referencing sections were done.
    fa7ea458
    History
    py_simulation.rst 6.25 KiB

    Simulations

    A simulation is the executable form of a model.

    From recipe to simulation

    To build a simulation the following concepts are needed:

    • an :class:`arbor.recipe` that describes the cells and connections in the model;
    • an :class:`arbor.context` used to execute the simulation.

    The workflow to build a simulation is to first generate an :class:`arbor.domain_decomposition` based on the :class:`arbor.recipe` and :class:`arbor.context` describing the distribution of the model over the local and distributed hardware resources (see :ref:`pydomdec`). Then, the simulation is build using the :class:`arbor.domain_decomposition`.

    import arbor
    
    # Get hardware resources, create a context
    resources = arbor.proc_allocation()
    context = arbor.context(resources)
    
    # Initialise a recipe of user defined type my_recipe with 100 cells.
    n_cells = 100
    recipe = my_recipe(n_cells)
    
    # Get a description of the partition the model over the cores
    # (and gpu if available) on node.
    decomp = arbor.partition_load_balance(recipe, context)
    
    # Instatitate the simulation.
    sim = arbor.simulation(recipe, decomp, context)
    
    # Run the simulation for 2000 ms with time stepping of 0.025 ms
    tSim = 2000
    dt = 0.025
    sim.run(tSim, dt)

    A simulation is constructed from a recipe, and then used to update and monitor the model state.

    Simulations take the following inputs:

    • an :class:`arbor.recipe` that describes the model;
    • an :class:`arbor.domain_decomposition` that describes how the cells in the model are assigned to hardware resources;
    • an :class:`arbor.context` which is used to execute the simulation.

    Simulations provide an interface for executing and interacting with the model:

    • Advance the model state from one time to another and reset the model state to its original state before simulation was started.
    • Sample the simulation state during the execution (e.g. compartment voltage and current) and generate spike output by using an I/O interface.

    Constructor:

    Updating Model State:

    Recording spikes

    In order to analyze the simulation output spikes can be recorded.

    Types:

    I/O interface: