From 730847541bdc6bbcfb4b851c2761d27d39df7b25 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Tue, 29 Jul 2025 08:53:13 +0000 Subject: [PATCH] doc: added benchmark to doc --- docs/source/api/index.rst | 6 ++++-- docs/source/benchmarking.rst | 5 +++-- docs/source/index.rst | 1 + pylops_mpi/utils/__init__.py | 1 + pylops_mpi/utils/benchmark.py | 4 ++++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst index 66e1a373..f8230c9d 100644 --- a/docs/source/api/index.rst +++ b/docs/source/api/index.rst @@ -118,9 +118,11 @@ Utils local_split -.. currentmodule:: pylops_mpi.utils.dottest +.. currentmodule:: pylops_mpi.utils .. autosummary:: :toctree: generated/ - dottest \ No newline at end of file + dottest + benchmark + mark \ No newline at end of file diff --git a/docs/source/benchmarking.rst b/docs/source/benchmarking.rst index eae99dff..532fa45e 100644 --- a/docs/source/benchmarking.rst +++ b/docs/source/benchmarking.rst @@ -1,7 +1,8 @@ .. _benchmarkutility: -Benchmark Utility in PyLops-MPI -=============================== +Benchmarking +============ + PyLops-MPI users can convenienly benchmark the performance of their code with a simple decorator. :py:func:`pylops_mpi.utils.benchmark` and :py:func:`pylops_mpi.utils.mark` support various function calling patterns that may arise when benchmarking distributed code. diff --git a/docs/source/index.rst b/docs/source/index.rst index e044cd9b..3afc5da7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -76,6 +76,7 @@ class and implementing the ``_matvec`` and ``_rmatvec``. self installation.rst gpu.rst + benchmarking.rst .. toctree:: :maxdepth: 2 diff --git a/pylops_mpi/utils/__init__.py b/pylops_mpi/utils/__init__.py index df8d8b0e..7f91a785 100644 --- a/pylops_mpi/utils/__init__.py +++ b/pylops_mpi/utils/__init__.py @@ -1,4 +1,5 @@ # isort: skip_file +from .benchmark import * from .dottest import * from .deps import * diff --git a/pylops_mpi/utils/benchmark.py b/pylops_mpi/utils/benchmark.py index 2e7be83d..54ee81ef 100644 --- a/pylops_mpi/utils/benchmark.py +++ b/pylops_mpi/utils/benchmark.py @@ -1,3 +1,7 @@ +__all__ = ["benchmark", + "mark", + ] + import functools import logging import os