From d23a13b81ee01c665d4219b18713f839d498ad9c Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Fri, 12 Jan 2024 15:34:08 +0100 Subject: [PATCH 1/3] Take into account `use_login_shell` value in autodetection script --- reframe/frontend/autodetect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reframe/frontend/autodetect.py b/reframe/frontend/autodetect.py index 8616811817..2d70d0be06 100644 --- a/reframe/frontend/autodetect.py +++ b/reframe/frontend/autodetect.py @@ -136,7 +136,10 @@ def _emit_script_for_source(job, env): './bootstrap.sh', './bin/reframe --detect-host-topology=topo.json' ] - job.prepare(commands, env, trap_errors=True) + job.prepare( + commands, env, trap_errors=True, + login=runtime.runtime().get_option('general/0/use_login_shell') + ) def _emit_script_for_pip(job, env): commands = [ @@ -147,7 +150,10 @@ def _emit_script_for_pip(job, env): 'reframe --detect-host-topology=topo.json', 'deactivate' ] - job.prepare(commands, env, trap_errors=True) + job.prepare( + commands, env, trap_errors=True, + login=runtime.runtime().get_option('general/0/use_login_shell') + ) getlogger().info( f'Detecting topology of remote partition {part.fullname!r}: ' From 465b617fbaf067f10f0234b23763fbb8b65d7c7a Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 31 Jan 2024 23:24:53 +0100 Subject: [PATCH 2/3] Remove duplication --- reframe/frontend/autodetect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reframe/frontend/autodetect.py b/reframe/frontend/autodetect.py index 2d70d0be06..bf020807ba 100644 --- a/reframe/frontend/autodetect.py +++ b/reframe/frontend/autodetect.py @@ -131,6 +131,8 @@ def _is_part_local(part): def _remote_detect(part): + use_login_shell = runtime.runtime().get_option('general/0/use_login_shell') + def _emit_script_for_source(job, env): commands = [ './bootstrap.sh', @@ -138,7 +140,7 @@ def _emit_script_for_source(job, env): ] job.prepare( commands, env, trap_errors=True, - login=runtime.runtime().get_option('general/0/use_login_shell') + login=use_login_shell ) def _emit_script_for_pip(job, env): @@ -152,7 +154,7 @@ def _emit_script_for_pip(job, env): ] job.prepare( commands, env, trap_errors=True, - login=runtime.runtime().get_option('general/0/use_login_shell') + login=use_login_shell ) getlogger().info( From c48a32aeb7b9cbca30450b1de2f81dbb416a4ebf Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 31 Jan 2024 23:26:12 +0100 Subject: [PATCH 3/3] Coding style fixes --- reframe/frontend/autodetect.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/reframe/frontend/autodetect.py b/reframe/frontend/autodetect.py index bf020807ba..507e127b3b 100644 --- a/reframe/frontend/autodetect.py +++ b/reframe/frontend/autodetect.py @@ -138,10 +138,7 @@ def _emit_script_for_source(job, env): './bootstrap.sh', './bin/reframe --detect-host-topology=topo.json' ] - job.prepare( - commands, env, trap_errors=True, - login=use_login_shell - ) + job.prepare(commands, env, trap_errors=True, login=use_login_shell) def _emit_script_for_pip(job, env): commands = [ @@ -152,10 +149,7 @@ def _emit_script_for_pip(job, env): 'reframe --detect-host-topology=topo.json', 'deactivate' ] - job.prepare( - commands, env, trap_errors=True, - login=use_login_shell - ) + job.prepare(commands, env, trap_errors=True, login=use_login_shell) getlogger().info( f'Detecting topology of remote partition {part.fullname!r}: '