Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v6.0.0.1 #37

Merged
merged 32 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9d7f993
update PAPI lib
SerodioJ Nov 8, 2022
dfe4a92
update MANIFEST.in
SerodioJ Nov 8, 2022
f0fad52
update PAPI High Level API binding
SerodioJ Nov 8, 2022
b404c90
update setup.py
SerodioJ Nov 8, 2022
e956923
add support to convert C structs to Python objects
SerodioJ Nov 20, 2022
43f5113
move high_types to structs.py
SerodioJ Nov 20, 2022
a40fd1c
bind PAPI low leval API
SerodioJ Nov 20, 2022
f23d6c8
update PAPI wrapper header file
SerodioJ Nov 20, 2022
98afd9f
update __init__
SerodioJ Nov 20, 2022
89817ee
add new PAPI consts
SerodioJ Nov 24, 2022
c8de776
lint fix
SerodioJ Nov 24, 2022
eaade0a
fixes for raspi
SerodioJ Nov 27, 2022
d78019a
add Dockerfile
SerodioJ Nov 27, 2022
cf63058
minor fixes
SerodioJ Nov 27, 2022
587ebdb
use PAPI's official repo
SerodioJ Mar 6, 2023
136933c
update Changelog
SerodioJ Mar 6, 2023
8ce7463
update submodule
SerodioJ Feb 23, 2024
27ee0fa
update docs
SerodioJ Feb 23, 2024
84ab160
remove NumPy from dependencies
SerodioJ Feb 23, 2024
91f1238
fix library function name
SerodioJ Feb 23, 2024
59e352b
remove README.md
SerodioJ Feb 23, 2024
67a4733
lint fixes
SerodioJ Feb 23, 2024
373109e
lint fixes
SerodioJ Feb 23, 2024
5f29951
lint fixes Python 3.12
SerodioJ Feb 23, 2024
d9c6ea9
check High Level API return codes with papi_error decorator
SerodioJ Feb 26, 2024
ee55cc3
fix Dockerfile
SerodioJ Feb 26, 2024
65cb002
Improved doc (formatting, cross ref, fixes,...)
flozz Mar 5, 2024
c8cdf1a
Removed unimplemented / commented functions
flozz Mar 5, 2024
fee2492
Added unimplemented 'set_opt()' function for doc cross ref
flozz Mar 5, 2024
79af10b
Updated thread_id() to make it raise errors instead of returning C er…
flozz Mar 5, 2024
d125040
Fixed lint
flozz Mar 5, 2024
537df3e
Merge pull request #1 from flozz/v6.0.0.1-fixes
SerodioJ Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "papi"]
path = papi
url = https://bitbucket.org/icl/papi.git
url = https://github.com/icl-utk-edu/papi.git
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:20.04 as build_stage

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
python3 \
python3-pip \
libffi-dev \
&& \
rm -rf /var/lib/apt/lists/*



WORKDIR /pypapi

COPY papi papi

WORKDIR /pypapi/papi/src

ENV CFLAGS="-fPIC -Werror=format-truncation=0"
ENV PAPI_COMPONENTS="net powercap rapl"
RUN ./configure --with-components="${PAPI_COMPONENTS}" && \
make

WORKDIR /pypapi

RUN pip install cffi==1.16.0

COPY setup.py setup.py

COPY pypapi pypapi

RUN python3 pypapi/papi_build.py

RUN pip install .
3,917 changes: 2,057 additions & 1,860 deletions MANIFEST.in

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
# built documents.
#
# The short X.Y version.
version = u'5.5.1'
version = u'6.0.0'
# The full version, including alpha/beta/rc tags.
release = u'5.5.1.1'
release = u'6.0.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
86 changes: 86 additions & 0 deletions docs/consts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,92 @@ PAPI State Constants
.. autodata:: pypapi.consts.PAPI_CPU_ATTACHED


.. _consts_mask:

PAPI Mask Constants
--------------------

.. autodata:: pypapi.consts.PAPI_NATIVE_MASK
.. autodata:: pypapi.consts.PAPI_PRESET_MASK


.. _consts_option:

PAPI Option Constants
---------------------

.. autodata:: pypapi.consts.PAPI_MIN_STR_LEN
.. autodata:: pypapi.consts.PAPI_MAX_STR_LEN
.. autodata:: pypapi.consts.PAPI_2MAX_STR_LEN
.. autodata:: pypapi.consts.PAPI_HUGE_STR_LEN
.. autodata:: pypapi.consts.PAPI_MAX_INFO_TERMS


.. _consts_error:

PAPI Error Constants
--------------------

.. autodata:: pypapi.consts.PAPI_QUIET
.. autodata:: pypapi.consts.PAPI_VERB_ECONT
.. autodata:: pypapi.consts.PAPI_VERB_ESTOP


.. _consts_domain:

PAPI Domain Constants
---------------------

.. autodata:: pypapi.consts.PAPI_DOM_USER
.. autodata:: pypapi.consts.PAPI_DOM_MIN
.. autodata:: pypapi.consts.PAPI_DOM_KERNEL
.. autodata:: pypapi.consts.PAPI_DOM_OTHER
.. autodata:: pypapi.consts.PAPI_DOM_SUPERVISOR
.. autodata:: pypapi.consts.PAPI_DOM_ALL
.. autodata:: pypapi.consts.PAPI_DOM_MAX
.. autodata:: pypapi.consts.PAPI_DOM_HWSPEC


.. _consts_granularity:

PAPI Granularity Constants
--------------------------

.. autodata:: pypapi.consts.PAPI_GRN_THR
.. autodata:: pypapi.consts.PAPI_GRN_MIN
.. autodata:: pypapi.consts.PAPI_GRN_PROC
.. autodata:: pypapi.consts.PAPI_GRN_PROCG
.. autodata:: pypapi.consts.PAPI_GRN_SYS
.. autodata:: pypapi.consts.PAPI_GRN_SYS_CPU
.. autodata:: pypapi.consts.PAPI_GRN_MAX


.. _consts_locking:

PAPI Locking Mechanisms Constants
---------------------------------


.. autodata:: pypapi.consts.PAPI_USR1_LOCK
.. autodata:: pypapi.consts.PAPI_USR2_LOCK
.. autodata:: pypapi.consts.PAPI_NUM_LOCK
.. autodata:: pypapi.consts.PAPI_LOCK_USR1
.. autodata:: pypapi.consts.PAPI_LOCK_USR2
.. autodata:: pypapi.consts.PAPI_LOCK_NUM

.. _consts_flops:

PAPI FLIPS/FLOPS Constants
--------------------------

.. autodata:: pypapi.consts.PAPI_FP_INS
.. autodata:: pypapi.consts.PAPI_VEC_SP
.. autodata:: pypapi.consts.PAPI_VEC_DP
.. autodata:: pypapi.consts.PAPI_FP_OPS
.. autodata:: pypapi.consts.PAPI_SP_OPS
.. autodata:: pypapi.consts.PAPI_DP_OPS


Other PAPI Constants
--------------------

Expand Down
40 changes: 29 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,38 @@ Example usage:

::

# High Level API

from pypapi import papi_high
from pypapi import events as papi_events

# Starts some counters
papi_high.start_counters([
papi_events.PAPI_FP_OPS,
papi_events.PAPI_TOT_CYC
])
papi_high.hl_region_begin("computation")

# computation

papi_high.hl_region_end("computation")


::

# Low Level API

from pypapi import papi_low as papi
from pypapi import events

papi.library_init()

evs = papi.create_eventset()
papi.add_event(evs, events.PAPI_FP_OPS)

papi.start(evs)

# Do some computation here

# Reads values from counters and reset them
results = papi_high.read_counters() # -> [int, int]
result = papi.stop(evs)
print(result)

# Reads values from counters and stop them
results = papi_high.stop_counters() # -> [int, int]
papi.cleanup_eventset(evs)
papi.destroy_eventset(evs)


.. toctree::
Expand All @@ -33,7 +51,7 @@ Example usage:
install
papi_high
papi_low
types
structs
events
consts
exceptions
Expand Down
5 changes: 2 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ As PAPI is a C library, it must be compiled. On Ubuntu / Debian, you can
install the ``build-essential`` package.


From PYPI
From PyPI
---------

To install PyPAPI from PYPI, simply use pip::
Expand Down Expand Up @@ -33,6 +33,5 @@ Finally, execute the following command::
.. note::

you may require root permission if you want to install the package
system-wild.

system-wide.

5 changes: 5 additions & 0 deletions docs/structs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PAPI Structs
============

.. automodule:: pypapi.structs
:members:
5 changes: 0 additions & 5 deletions docs/types.rst

This file was deleted.

2 changes: 1 addition & 1 deletion papi
Submodule papi updated 946 files
2 changes: 2 additions & 0 deletions pypapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from . import events
from . import consts
from . import exceptions
from . import structs

__all__ = [
"papi_high",
"papi_low",
"events",
"consts",
"exceptions",
"structs",
]
Loading