Skip to content

Commit 00e9eb1

Browse files
committed
Use tests's short name as the name of the job
1 parent fe49f64 commit 00e9eb1

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

reframe/core/pipeline.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ def _setup_paths(self):
16451645
except OSError as e:
16461646
raise PipelineError('failed to set up paths') from e
16471647

1648-
def _create_job(self, name, force_local=False, **job_opts):
1648+
def _create_job(self, job_type, force_local=False, **job_opts):
16491649
'''Setup the job related to this check.'''
16501650

16511651
if force_local:
@@ -1656,24 +1656,33 @@ def _create_job(self, name, force_local=False, **job_opts):
16561656
launcher = self._current_partition.launcher_type()
16571657

16581658
self.logger.debug(
1659-
f'Setting up job {name!r} '
1659+
f'Setting up {type} job for test {self.name!r} '
16601660
f'(scheduler: {scheduler.registered_name!r}, '
16611661
f'launcher: {launcher.registered_name!r})'
16621662
)
1663+
1664+
if job_type == 'build':
1665+
script_name = 'rfm_build.sh'
1666+
elif job_type == 'run':
1667+
script_name = 'rfm_job.sh'
1668+
else:
1669+
assert 0, "[internal error] unknown job type"
1670+
16631671
return Job.create(scheduler,
16641672
launcher,
1665-
name=name,
1673+
name=f'rfm_{self.short_name}',
1674+
script_filename=script_name,
16661675
workdir=self._stagedir,
16671676
sched_access=self._current_partition.access,
16681677
**job_opts)
16691678

16701679
def _setup_build_job(self, **job_opts):
1671-
self._build_job = self._create_job(f'rfm_build',
1672-
self.local or self.build_locally,
1673-
**job_opts)
1680+
self._build_job = self._create_job(
1681+
'build', self.local or self.build_locally, **job_opts
1682+
)
16741683

16751684
def _setup_run_job(self, **job_opts):
1676-
self._job = self._create_job(f'rfm_job', self.local, **job_opts)
1685+
self._job = self._create_job(f'run', self.local, **job_opts)
16771686

16781687
def _setup_container_platform(self):
16791688
try:

reframe/core/schedulers/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#
99

1010
import abc
11+
import os
1112
import time
1213

1314
import reframe.core.runtime as runtime
@@ -330,9 +331,11 @@ def __init__(self,
330331
self._cli_options = list(sched_options) if sched_options else []
331332
self._name = name
332333
self._workdir = workdir
333-
self._script_filename = script_filename or '%s.sh' % name
334-
self._stdout = stdout or '%s.out' % name
335-
self._stderr = stderr or '%s.err' % name
334+
self._script_filename = script_filename or f'{name}.sh'
335+
336+
basename, _ = os.path.splitext(self._script_filename)
337+
self._stdout = stdout or f'{basename}.out'
338+
self._stderr = stderr or f'{basename}.err'
336339

337340
# Backend scheduler related information
338341
self._sched_flex_alloc_nodes = sched_flex_alloc_nodes

0 commit comments

Comments
 (0)