Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", 'pypy-2.7', 'pypy-3.7', 'pypy-3.9', 'pypy-3.10']
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']
fail-fast: false

steps:
Expand All @@ -22,7 +22,7 @@ jobs:
key: ${{ runner.os }}-pip

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

- name: Install Score-P
run: sudo apt-get -y install scorep
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ scorep is a module that allows tracing of python scripts using [Score-P](https:/
You need at least Score-P 5.0, build with `--enable-shared` and the gcc compiler plugin.
Please make sure that `scorep-config` is in your `PATH` variable.

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

Then install the package from PyPI

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
"setuptools >= 68.0.0",
]
build-backend = "setuptools.build_meta:__legacy__"
build-backend = "setuptools.build_meta:__legacy__"
15 changes: 8 additions & 7 deletions scorep/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def scorep_main(argv=None):

keep_files = False
verbose = False
no_default_threads = False
no_default_compiler = False
no_instrumenter = False
if scorep.instrumenter.has_c_instrumenter():
Expand All @@ -40,16 +39,21 @@ def scorep_main(argv=None):
keep_files = True
elif elem == "--verbose" or elem == '-v':
verbose = True
elif "--thread=" in elem:
scorep_config.append(elem)
no_default_threads = True
elif elem == "--nocompiler":
scorep_config.append(elem)
no_default_compiler = True
elif elem == "--nopython":
no_instrumenter = True
elif elem == "--noinstrumenter":
no_instrumenter = True
elif elem in ["--io=runtime:posix", "--io=posix"]:
print_err(f"scorep: Warning: The option '{elem}' is deprecated.")
if "SCOREP_IO_POSIX" in os.environ:
print_err(" Will not overwrite existing value for environment variable "
f"'SCOREP_IO_POSIX={os.environ['SCOREP_IO_POSIX']}'.")
else:
print_err(" The environment variable 'SCOREP_IO_POSIX=true' is set and will be used.")
os.environ["SCOREP_IO_POSIX"] = "true"
elif "--instrumenter-type" in elem:
param = elem.split("=")
instrumenter_type = param[1]
Expand All @@ -64,9 +68,6 @@ def scorep_main(argv=None):
else:
prog_argv.append(elem)

if not no_default_threads:
scorep_config.append("--thread=pthread")

if not no_default_compiler:
scorep_config.append("--compiler")

Expand Down
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
)


install_requires= ["setuptools>=68.0.0"]

cmodules = []
(include, _, _, _, _) = scorep.helper.generate_compile_deps([])
src_folder = os.path.abspath("src")
Expand Down Expand Up @@ -76,23 +78,19 @@
Besides this, it uses the traditional python-tracing infrastructure.
""",
packages=["scorep", "scorep._instrumenters"],
install_requires=install_requires,
ext_modules=cmodules,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Quality Assurance",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: POSIX",
Expand Down
9 changes: 5 additions & 4 deletions test/test_scorep.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ def test_threads(scorep_env, instrumenter):
@foreach_instrumenter
def test_io(scorep_env, instrumenter):
trace_path = get_trace_path(scorep_env)
scorep_env["SCOREP_IO_POSIX"] = "true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an idea: maybe set this env also if --io=posix was specified on the command line, that smoothes the transition for Python users. scorep(-config) prints a decprecation warning, the bindings should print, that they exported SCOREP_IO_POSIX=true, the latter only if it is not yet set in the env


print("start")
std_out, std_err = utils.call_with_scorep(
Expand All @@ -383,7 +384,6 @@ def test_io(scorep_env, instrumenter):
"--nocompiler",
"--instrumenter-type=" + instrumenter,
"--noinstrumenter",
"--io=runtime:posix",
],
env=scorep_env,
)
Expand All @@ -397,8 +397,9 @@ def test_io(scorep_env, instrumenter):
# print_regex = "STDOUT_FILENO"

ops = {
"open": {"ENTER": "open64", "IO_CREATE_HANDLE": file_regex, "LEAVE": "open64"},
"seek": {"ENTER": "lseek64", "IO_SEEK": file_regex, "LEAVE": "lseek64"},
# CPython calls "int open64( const char*, int, ... )" but PyPy calls "int open( const char*, int, ... )"
"open": {"ENTER": "open(64)?", "IO_CREATE_HANDLE": file_regex, "LEAVE": "open(64)?"},
"seek": {"ENTER": "lseek(64)?", "IO_SEEK": file_regex, "LEAVE": "lseek(64)?"},
"write": {
"ENTER": "write",
"IO_OPERATION_BEGIN": file_regex,
Expand Down Expand Up @@ -439,7 +440,7 @@ def test_io(scorep_env, instrumenter):

for _, details in ops.items():
for event, data in details.items():
regex_str = '{event:}[ ]*[0-9 ]*[0-9 ]*(Region|Handle): "{data:}"'.format(
regex_str = '{event:}[ ]*[0-9 ]*[0-9 ]*(Region|Handle): ".*{data:}.*"'.format(
event=event, data=data
)
print(regex_str)
Expand Down
Loading