Skip to content

Commit 46707e8

Browse files
committed
Take into account system modules in autodetect
1 parent 9c5345a commit 46707e8

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

reframe/frontend/autodetect.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import tempfile
1111

1212
import reframe as rfm
13+
import reframe.core.runtime as runtime
1314
import reframe.utility.osext as osext
1415
from reframe.core.exceptions import ConfigError
1516
from reframe.core.logging import getlogger
16-
from reframe.core.runtime import runtime
1717
from reframe.core.schedulers import Job
1818
from reframe.utility.cpuinfo import cpuinfo
1919

@@ -60,7 +60,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
6060
def _subschema(fragment):
6161
'''Create a configuration subschema.'''
6262

63-
full_schema = runtime().site_config.schema
63+
full_schema = runtime.runtime().site_config.schema
6464
return {
6565
'$schema': full_schema['$schema'],
6666
'defs': full_schema['defs'],
@@ -125,7 +125,7 @@ def _emit_script(job, env):
125125
)
126126
topo_info = {}
127127
try:
128-
prefix = runtime().get_option('general/0/remote_workdir')
128+
prefix = runtime.runtime().get_option('general/0/remote_workdir')
129129
with _copy_reframe(prefix) as dirname:
130130
with osext.change_dir(dirname):
131131
job = Job.create(part.scheduler,
@@ -148,7 +148,7 @@ def _emit_script(job, env):
148148

149149

150150
def detect_topology():
151-
rt = runtime()
151+
rt = runtime.runtime()
152152
detect_remote_systems = rt.get_option('general/0/remote_detect')
153153
topo_prefix = os.path.join(os.getenv('HOME'), '.reframe/topology')
154154
for part in rt.system.partitions:
@@ -200,12 +200,18 @@ def detect_topology():
200200
if not found_procinfo:
201201
# No topology found, try to auto-detect it
202202
getlogger().debug(f'> no topology file found; auto-detecting...')
203+
temp_modules = rt.system.preload_environ.modules
203204
if _is_part_local(part):
205+
temp_modules += part.local_env.modules
204206
# Unconditionally detect the system for fully local partitions
205-
part.processor._info = cpuinfo()
207+
with runtime.temp_environment(modules=temp_modules):
208+
part.processor._info = cpuinfo()
209+
206210
_save_info(topo_file, part.processor.info)
207211
elif detect_remote_systems:
208-
part.processor._info = _remote_detect(part)
212+
with runtime.temp_environment(modules=temp_modules):
213+
part.processor._info = _remote_detect(part)
214+
209215
if part.processor.info:
210216
_save_info(topo_file, part.processor.info)
211217

reframe/utility/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,10 @@ def __add__(self, other):
13911391
if not isinstance(other, collections.abc.Sequence):
13921392
return NotImplemented
13931393

1394-
return SequenceView(self.__container + other)
1394+
if isinstance(other, SequenceView):
1395+
return SequenceView(self.__container + other.__container)
1396+
else:
1397+
return SequenceView(self.__container + other)
13951398

13961399
def __iadd__(self, other):
13971400
return NotImplemented

0 commit comments

Comments
 (0)