diff --git a/doc/py_cable_cell.rst b/doc/py_cable_cell.rst index c7e49f9ee42d9ffb02e1000a88ee290ff818cbb0..ab437312c32dc3eb82ed5690de615341f1c438a3 100644 --- a/doc/py_cable_cell.rst +++ b/doc/py_cable_cell.rst @@ -4,7 +4,7 @@ Python Cable Cells ==================== The interface for specifying cell morphologies with the distribution of ion channels -and syanpses is a key part of the user interface. Arbor will have an advanced and user-friendly +and synapses is a key part of the user interface. Arbor will have an advanced and user-friendly interface for this, which is currently under construction. To allow users to experiment will multi-compartment cells, we provide some helpers diff --git a/doc/py_profiler.rst b/doc/py_profiler.rst index d18275d877e9de383a439f789c978e88d9f6f68d..1f26bb339965627893ec0b8594f33c0630d45c72 100644 --- a/doc/py_profiler.rst +++ b/doc/py_profiler.rst @@ -32,8 +32,8 @@ Checkpoints are defined by a string describing the process to be measured. .. function:: checkpoint(name, context) - Create a new checkpoint ``name`` using the the chosen execution :class:`arbor.context`. - Records the time since the last checkpoint (or the call to start if no previous checkpoints), + Create a new checkpoint ``name`` using the chosen execution :class:`arbor.context`. + Records the time since the last checkpoint (or the call to start if no previous checkpoints exist), and restarts the timer for the next checkpoint. .. function:: checkpoint_names @@ -44,12 +44,6 @@ Checkpoints are defined by a string describing the process to be measured. Returns a list of all metering times. -At any point a summary of the timing regions can be obtained by the :func:`make_meter_report`. - -.. function:: make_meter_report(meter_manager, context) - - Generate a meter report based on the :class:`meter_manager` and chosen execution :class:`arbor.context`. - For instance, the following python code will record and summarize the total time (and memory) spent: .. container:: example-code @@ -65,42 +59,49 @@ For instance, the following python code will record and summarize the total time n_cells = 100 recipe = my_recipe(n_cells) - meter_manager.checkpoint('recipe create', context) + meter_manager.checkpoint('recipe-create', context) decomp = arbor.partition_load_balance(recipe, context) - meter_manager.checkpoint('load balance', context) + meter_manager.checkpoint('load-balance', context) sim = arbor.simulation(recipe, decomp, context) - meter_manager.checkpoint('simulation init', context) + meter_manager.checkpoint('simulation-init', context) tSim = 2000 dt = 0.025 sim.run(tSim, dt) - meter_manager.checkpoint('simulation run', context) + meter_manager.checkpoint('simulation-run', context) Metering Output ------------------ -Calling :func:`make_meter_report` will generate a measurement summary, which can be printed using ``print``. +At any point a summary of the timing regions can be obtained by the :class:`meter_report`. + +.. class:: meter_report + + .. function:: meter_report(meter_manager, context) + + Summarises the performance meter results, used to print a report to screen or file. + If a distributed context is used, the report will contain a summary of results from all MPI ranks. + Take the example output from above: .. container:: example-code .. code-block:: python - print(arbor.make_meter_report(meter_manager, context)) + print(arbor.meter_report(meter_manager, context)) ->>> <arbor.meter_report>: >>> ---- meters ------------------------------------------------------------------------------- >>> meter time(s) memory(MB) >>> ------------------------------------------------------------------------------------------- ->>> recipe create 0.000 0.001 ->>> load balance 0.000 0.009 ->>> simulation init 0.026 3.604 ->>> simulation run 4.171 0.021 +>>> recipe-create 0.000 0.001 +>>> load-balance 0.000 0.009 +>>> simulation-init 0.026 3.604 +>>> simulation-run 4.171 0.021 >>> meter-total 4.198 3.634 diff --git a/python/profiler.cpp b/python/profiler.cpp index b44a58c4b5601eaebe45fb4e33ab9aed86e34606..e08b440281d3cf30bd549f036168069ec5bdfeb5 100644 --- a/python/profiler.cpp +++ b/python/profiler.cpp @@ -31,7 +31,7 @@ void register_profiler(pybind11::module& m) { }, "name"_a, "context"_a, "Create a new checkpoint. Records the time since the last checkpoint\ - (or the call to start if no previous checkpoints),\ + (or the call to start if no previous checkpoints exist),\ and restarts the timer for the next checkpoint.") .def_property_readonly("checkpoint_names", &arb::profile::meter_manager::checkpoint_names, "A list of all metering checkpoint names.")