Skip to content

Commit 45e965b

Browse files
authored
Updates to Score-P 9.x (#172)
- Makes bindings compatible to Score-P 9.0 and 9.1 - Updates C/I Tests for new Python Version - Changes Ubuntu PPA - Fixes migration to setuptools Open Issues - Pypy versions 3.8 and 3.9 breaks with setuptools. Pypy 3.7, 3.10, 3.11 are working. Should we simply remove support for it? - Tests with `Class:function` break on Python 3.13, see #171 - see #171
2 parents 3a1642a + a788059 commit 45e965b

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python: ["3.8", "3.9", "3.10", "3.11", "3.12", 'pypy-2.7', 'pypy-3.7', 'pypy-3.9', 'pypy-3.10']
14+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", 'pypy-2.7', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11']
1515
fail-fast: false
1616

1717
steps:
@@ -22,7 +22,7 @@ jobs:
2222
key: ${{ runner.os }}-pip
2323

2424
- name: Add Score-P repo
25-
run: sudo add-apt-repository ppa:andreasgocht/scorep
25+
run: sudo add-apt-repository ppa:score-p/releases
2626

2727
- name: Install Score-P
2828
run: sudo apt-get -y install scorep

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ scorep is a module that allows tracing of python scripts using [Score-P](https:/
3030
You need at least Score-P 5.0, build with `--enable-shared` and the gcc compiler plugin.
3131
Please make sure that `scorep-config` is in your `PATH` variable.
3232

33-
For Ubuntu LTS systems there is a non-official ppa of Score-P available: https://launchpad.net/~andreasgocht/+archive/ubuntu/scorep .
33+
The Score-P community provides an unofficial PPA for Ubuntu LTS systems: https://launchpad.net/~score-p/+archive/ubuntu/releases .
3434

3535
Then install the package from PyPI
3636

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 40.9.0",
3+
"setuptools >= 68.0.0",
44
]
5-
build-backend = "setuptools.build_meta:__legacy__"
5+
build-backend = "setuptools.build_meta:__legacy__"

scorep/__main__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def scorep_main(argv=None):
2121

2222
keep_files = False
2323
verbose = False
24-
no_default_threads = False
2524
no_default_compiler = False
2625
no_instrumenter = False
2726
if scorep.instrumenter.has_c_instrumenter():
@@ -40,16 +39,21 @@ def scorep_main(argv=None):
4039
keep_files = True
4140
elif elem == "--verbose" or elem == '-v':
4241
verbose = True
43-
elif "--thread=" in elem:
44-
scorep_config.append(elem)
45-
no_default_threads = True
4642
elif elem == "--nocompiler":
4743
scorep_config.append(elem)
4844
no_default_compiler = True
4945
elif elem == "--nopython":
5046
no_instrumenter = True
5147
elif elem == "--noinstrumenter":
5248
no_instrumenter = True
49+
elif elem in ["--io=runtime:posix", "--io=posix"]:
50+
print_err(f"scorep: Warning: The option '{elem}' is deprecated.")
51+
if "SCOREP_IO_POSIX" in os.environ:
52+
print_err(" Will not overwrite existing value for environment variable "
53+
f"'SCOREP_IO_POSIX={os.environ['SCOREP_IO_POSIX']}'.")
54+
else:
55+
print_err(" The environment variable 'SCOREP_IO_POSIX=true' is set and will be used.")
56+
os.environ["SCOREP_IO_POSIX"] = "true"
5357
elif "--instrumenter-type" in elem:
5458
param = elem.split("=")
5559
instrumenter_type = param[1]
@@ -64,9 +68,6 @@ def scorep_main(argv=None):
6468
else:
6569
prog_argv.append(elem)
6670

67-
if not no_default_threads:
68-
scorep_config.append("--thread=pthread")
69-
7071
if not no_default_compiler:
7172
scorep_config.append("--compiler")
7273

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
)
2828

2929

30+
install_requires= ["setuptools>=68.0.0"]
31+
3032
cmodules = []
3133
(include, _, _, _, _) = scorep.helper.generate_compile_deps([])
3234
src_folder = os.path.abspath("src")
@@ -76,23 +78,19 @@
7678
Besides this, it uses the traditional python-tracing infrastructure.
7779
""",
7880
packages=["scorep", "scorep._instrumenters"],
81+
install_requires=install_requires,
7982
ext_modules=cmodules,
8083
classifiers=[
8184
"Development Status :: 5 - Production/Stable",
8285
"Environment :: Console",
8386
"Intended Audience :: Developers",
8487
"Topic :: Software Development :: Testing",
8588
"Topic :: Software Development :: Quality Assurance",
86-
"Programming Language :: Python :: 2",
87-
"Programming Language :: Python :: 2.7",
88-
"Programming Language :: Python :: 3",
89-
"Programming Language :: Python :: 3.4",
90-
"Programming Language :: Python :: 3.5",
91-
"Programming Language :: Python :: 3.6",
92-
"Programming Language :: Python :: 3.7",
93-
"Programming Language :: Python :: 3.8",
9489
"Programming Language :: Python :: 3.9",
9590
"Programming Language :: Python :: 3.10",
91+
"Programming Language :: Python :: 3.11",
92+
"Programming Language :: Python :: 3.12",
93+
"Programming Language :: Python :: 3.13",
9694
"Programming Language :: Python :: Implementation :: CPython",
9795
"Programming Language :: Python :: Implementation :: PyPy",
9896
"Operating System :: POSIX",

test/test_scorep.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ def test_threads(scorep_env, instrumenter):
375375
@foreach_instrumenter
376376
def test_io(scorep_env, instrumenter):
377377
trace_path = get_trace_path(scorep_env)
378+
scorep_env["SCOREP_IO_POSIX"] = "true"
378379

379380
print("start")
380381
std_out, std_err = utils.call_with_scorep(
@@ -383,7 +384,6 @@ def test_io(scorep_env, instrumenter):
383384
"--nocompiler",
384385
"--instrumenter-type=" + instrumenter,
385386
"--noinstrumenter",
386-
"--io=runtime:posix",
387387
],
388388
env=scorep_env,
389389
)
@@ -397,8 +397,9 @@ def test_io(scorep_env, instrumenter):
397397
# print_regex = "STDOUT_FILENO"
398398

399399
ops = {
400-
"open": {"ENTER": "open64", "IO_CREATE_HANDLE": file_regex, "LEAVE": "open64"},
401-
"seek": {"ENTER": "lseek64", "IO_SEEK": file_regex, "LEAVE": "lseek64"},
400+
# CPython calls "int open64( const char*, int, ... )" but PyPy calls "int open( const char*, int, ... )"
401+
"open": {"ENTER": "open(64)?", "IO_CREATE_HANDLE": file_regex, "LEAVE": "open(64)?"},
402+
"seek": {"ENTER": "lseek(64)?", "IO_SEEK": file_regex, "LEAVE": "lseek(64)?"},
402403
"write": {
403404
"ENTER": "write",
404405
"IO_OPERATION_BEGIN": file_regex,
@@ -439,7 +440,7 @@ def test_io(scorep_env, instrumenter):
439440

440441
for _, details in ops.items():
441442
for event, data in details.items():
442-
regex_str = '{event:}[ ]*[0-9 ]*[0-9 ]*(Region|Handle): "{data:}"'.format(
443+
regex_str = '{event:}[ ]*[0-9 ]*[0-9 ]*(Region|Handle): ".*{data:}.*"'.format(
443444
event=event, data=data
444445
)
445446
print(regex_str)

0 commit comments

Comments
 (0)