Skip to content

Commit 7a359d6

Browse files
author
Vasileios Karakasis
committed
Changed log variable to check_job_completion_time
Also: - Fine tune documentation
1 parent 8af1098 commit 7a359d6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/running.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,17 +840,20 @@ All handlers accept the following set of attributes (keys) in their configuratio
840840
* ``format`` (default: ``'%(message)s'``): Format string for the printout of the log record.
841841
ReFrame supports all the `format strings <https://docs.python.org/3.6/library/logging.html#logrecord-attributes>`__ from Python's logging library and provides the following additional ones:
842842

843-
- ``check_completion_time``: A timestamp with the completion time of the regression test.
844-
The ``slurm`` scheduler relies on job accounting (``sacct`` command) and returns the actual termination time of the job.
845-
The rest of the schedulers report as completion time the moment the framework realizes the test has finished, as soon as the ``wait`` phase ends.
846-
The accuracy is dependent on the polling rate of the ``wait`` phase and can be lower for tests that take more time.
847-
If a job or process is not yet completed, ``None`` will be printed.
848843
- ``check_environ``: The programming environment a test is currently executing for.
849844
- ``check_info``: Print live information of the currently executing check.
850845
By default this field has the form ``<check_name> on <current_partition> using <current_environment>``.
851846
It can be configured on a per test basis by overriding the :func:`info <reframe.core.pipeline.RegressionTest.info>` method of a specific regression test.
852847
- ``check_jobid``: Prints the job or process id of the job or process associated with the currently executing regression test.
853848
If a job or process is not yet created, ``-1`` will be printed.
849+
- ``check_job_completion_time``: *[new in 2.21]* The completion time of the job spawned by this regression test.
850+
This timestamp will be formatted according to ``datefmt`` (see below).
851+
The accuracy of the timestamp depends on the backend scheduler.
852+
The ``slurm`` scheduler backend relies on job accounting and returns the actual termination time of the job.
853+
The rest of the backends report as completion time the moment when the framework realizes that the spawned job has finished.
854+
In this case, the accuracy depends on the execution policy used.
855+
If tests are executed with the serial execution policy, this is close to the real completion time, but if the asynchronous execution policy is used, it can differ significantly.
856+
If the job completion time cannot be retrieved, ``None`` will be printed.
854857
- ``check_name``: Prints the name of the regression test on behalf of which ReFrame is currently executing.
855858
If ReFrame is not in the context of regression test, ``reframe`` will be printed.
856859
- ``check_num_tasks``: The number of tasks assigned to the regression test.

reframe/core/logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ def __init__(self, logger=None, check=None):
367367
{
368368
'check_name': 'reframe',
369369
'check_jobid': '-1',
370+
'check_job_completion_time': None,
370371
'check_info': 'reframe',
371372
'check_system': None,
372373
'check_partition': None,
373374
'check_environ': None,
374375
'check_outputdir': None,
375376
'check_stagedir': None,
376377
'check_num_tasks': None,
377-
'check_completion_time': None,
378378
'check_perf_var': None,
379379
'check_perf_value': None,
380380
'check_perf_ref': None,
@@ -433,7 +433,7 @@ def _update_check_extras(self):
433433
# NOTE: All handlers use the same date format
434434
fmt = self.logger.handlers[0].formatter.datefmt
435435
ct = self.check.job.completion_time.strftime(fmt)
436-
self.extra['check_completion_time'] = ct
436+
self.extra['check_job_completion_time'] = ct
437437

438438
def log_performance(self, level, tag, value, ref,
439439
low_thres, upper_thres, unit=None, *, msg=None):

0 commit comments

Comments
 (0)