Skip to content
Snippets Groups Projects
  • akuesters's avatar
    Python Documentation PR (#687) · fa7ea458
    akuesters authored and Benjamin Cumming's avatar Benjamin 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
cpp_simulation.rst 5.05 KiB

Simulations

From recipe to simulation

To build a simulation the following are needed:

  • An :cpp:class:`arb::recipe` that describes the cells and connections in the model.
  • An :cpp:class:`arb::context` used to execute the simulation.

The workflow to build a simulation is to first generate a :cpp:class:`arb::domain_decomposition` that describes the distribution of the model over the local and distributed hardware resources (see :ref:`cppdomdec`), then build the simulation.

#include <arbor/context.hpp>
#include <arbor/domain_decomposition.hpp>
#include <arbor/simulation.hpp>

// Get a communication context
arb::context context = make_context();

// Make a recipe of user defined type my_recipe.
my_recipe recipe;

// Get a description of the partition the model over the cores
// (and gpu if available) on node.
arb::domain_decomposition decomp = arb::partition_load_balance(recipe, context);

// Instatitate the simulation.
arb::simulation sim(recipe, decomp, context);

Class Documentation