Skip to content

Commit 236e83d

Browse files
committed
clean up
move ld_prelaod generation into subsystem, as its the only one using its, and its logic
1 parent d403351 commit 236e83d

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

scorep/helper.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,6 @@ def add_to_ld_library_path(path):
5252
":" + os.environ["LD_LIBRARY_PATH"]
5353

5454

55-
def generate_ld_preload(scorep_config):
56-
"""
57-
This functions generate a string that needs to be passed to $LD_PRELOAD.
58-
After this sting is passed, the tracing needs to be restarted with this $LD_PRELOAD in env.
59-
60-
@return ld_preload string which needs to be passed to LD_PRELOAD
61-
"""
62-
63-
(_, preload, _) = call(["scorep-config"] +
64-
scorep_config + ["--user", "--preload-libs"])
65-
return preload
66-
67-
6855
def generate_compile_deps(config=[]):
6956
"""
7057
Generates the data needed for compilation.

scorep/subsystem.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import scorep.helper
88

99

10-
def gen_subsystem_lib_name():
10+
def generate_subsystem_lib_name():
1111
"""
1212
generate the name for the subsystem lib.
1313
"""
@@ -16,6 +16,19 @@ def gen_subsystem_lib_name():
1616
return mpi_lib_name
1717

1818

19+
def generate_ld_preload(scorep_config):
20+
"""
21+
This functions generate a string that needs to be passed to $LD_PRELOAD.
22+
After this sting is passed, the tracing needs to be restarted with this $LD_PRELOAD in env.
23+
24+
@return ld_preload string which needs to be passed to LD_PRELOAD
25+
"""
26+
27+
(_, preload, _) = scorep.helper.call(
28+
["scorep-config"] + scorep_config + ["--user", "--preload-libs"])
29+
return preload
30+
31+
1932
def generate_subsystem_code(config=[]):
2033
"""
2134
Generates the data needed to be preloaded.
@@ -62,7 +75,7 @@ def generate(scorep_config, keep_files=False):
6275
with open(temp_dir + "/scorep_init.c", "w") as f:
6376
f.write(scorep_adapter_init)
6477

65-
subsystem_lib_name = gen_subsystem_lib_name()
78+
subsystem_lib_name = generate_subsystem_lib_name()
6679

6780
cc = distutils.ccompiler.new_compiler()
6881
compiled_subsystem = cc.compile(
@@ -97,7 +110,7 @@ def init_environment(scorep_config=[], keep_files=False):
97110

98111
subsystem_lib_name, temp_dir = scorep.subsystem.generate(
99112
scorep_config, keep_files)
100-
scorep_ld_preload = scorep.helper.generate_ld_preload(scorep_config)
113+
scorep_ld_preload = generate_ld_preload(scorep_config)
101114

102115
scorep.helper.add_to_ld_library_path(temp_dir)
103116

0 commit comments

Comments
 (0)