Skip to content

Commit 6cdb6af

Browse files
authored
Merge pull request #168 from vkarak/bugfix/documentation_check_info
Update documentation on the 'check_info' logging attribute
2 parents 8b7a651 + 07064bb commit 6cdb6af

File tree

2 files changed

+58
-35
lines changed

2 files changed

+58
-35
lines changed

docs/running.rst

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -412,30 +412,37 @@ By default, the output in ``reframe.log`` looks like the following:
412412

413413
.. code-block:: none
414414
415-
[2017-10-24T21:19:04] info: reframe: [----------] started processing example7_check (Matrix-vector mult
416-
iplication example with Cuda)
417-
[2017-10-24T21:19:04] info: reframe: [ SKIP ] skipping daint:mc
418-
[2017-10-24T21:19:04] info: reframe: [ RUN ] example7_check on daint:gpu using PrgEnv-cray
419-
[2017-10-24T21:19:04] debug: example7_check: setting up the environment
420-
[2017-10-24T21:19:04] debug: example7_check: loading environment for partition daint:gpu
421-
[2017-10-24T21:19:05] debug: example7_check: loading environment PrgEnv-cray
422-
[2017-10-24T21:19:05] debug: example7_check: setting up paths
423-
[2017-10-24T21:19:05] debug: example7_check: setting up the job descriptor
424-
[2017-10-24T21:19:05] debug: example7_check: job scheduler backend: nativeslurm
425-
[2017-10-24T21:19:05] debug: example7_check: setting up performance logging
426-
[2017-10-24T21:19:05] debug: example7_check: compilation started
427-
[2017-10-24T21:19:06] debug: example7_check: compilation stdout:
428-
429-
[2017-10-24T21:19:06] debug: example7_check: compilation stderr:
430-
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed
431-
in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
432-
433-
[2017-10-24T21:19:06] debug: example7_check: compilation finished
434-
[2017-10-24T21:19:09] debug: example7_check: spawned job (jobid=4163846)
435-
[2017-10-24T21:19:21] debug: example7_check: spawned job finished
436-
[2017-10-24T21:19:21] debug: example7_check: copying interesting files to output directory
437-
[2017-10-24T21:19:21] debug: example7_check: removing stage directory
438-
[2017-10-24T21:19:21] info: reframe: [ OK ] example7_check on daint:gpu using PrgEnv-cray
415+
[2018-03-01T20:03:13] info: reframe: [ RUN ] example7_check on daint:gpu using PrgEnv-cray
416+
[2018-03-01T20:03:13] debug: example7_check: entering stage: setup
417+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: loading environment for the current partition
418+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: modulecmd python show daint-gpu
419+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: modulecmd python load daint-gpu
420+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: loading test's environment
421+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: modulecmd python show cudatoolkit
422+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: modulecmd python load cudatoolkit
423+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: setting up paths
424+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: setting up the job descriptor
425+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: job scheduler backend: local
426+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: setting up performance logging
427+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: entering stage: compile
428+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: copying /users/karakasv/Devel/reframe/tutorial/src to stage directory (/users/karakasv/Devel/reframe/stage/gpu/example7_check/PrgEnv
429+
-cray)
430+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: symlinking files: []
431+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: Staged sourcepath: /users/karakasv/Devel/reframe/stage/gpu/example7_check/PrgEnv-cray/example_matrix_vector_multiplication_cuda.cu
432+
[2018-03-01T20:03:13] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: nvcc -O3 -I/users/karakasv/Devel/reframe/stage/gpu/example7_check/PrgEnv-cray /users/karakasv/Devel/reframe/s
433+
tage/gpu/example7_check/PrgEnv-cray/example_matrix_vector_multiplication_cuda.cu -o /users/karakasv/Devel/reframe/stage/gpu/example7_check/PrgEnv-cray/./example7_check
434+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: compilation stdout:
435+
436+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: compilation stderr:
437+
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
438+
439+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: compilation finished
440+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: entering stage: run
441+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: executing OS command: sbatch /users/karakasv/Devel/reframe/stage/gpu/example7_check/PrgEnv-cray/example7_check_daint_gpu_PrgEnv-cray
442+
.sh
443+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: spawned job (jobid=6224537)
444+
[2018-03-01T20:03:14] debug: example7_check on daint:gpu using PrgEnv-cray: entering stage: wait
445+
439446
440447
Each line starts with a timestamp, the level of the message (``info``, ``debug`` etc.), the context in which the framework is currently executing (either ``reframe`` or the name of the current test and, finally, the actual message.
441448

@@ -459,7 +466,7 @@ The default configuration looks as follows:
459466
'reframe.log' : {
460467
'level' : 'DEBUG',
461468
'format' : '[%(asctime)s] %(levelname)s: '
462-
'%(testcase_name)s: %(message)s',
469+
'%(check_info)s: %(message)s',
463470
'append' : False,
464471
},
465472
@@ -500,9 +507,9 @@ The configurable properties of a log record handler are the following:
500507
If ReFrame is not in the context of regression test, ``reframe`` will be printed.
501508
* ``check_jobid``: Prints the job or process id of the job or process associated with currently executing regression test.
502509
If a job or process is not yet created, ``-1`` will be printed.
503-
* ``testcase_name``: Print the name of the test case that is currently executing.
504-
Test case is essentially a tuple consisting of the test name, the current system and partition and the current programming environment.
505-
This format string prints out like ``<test-name>@<partition> using <environ>``.
510+
* ``check_info``: Print live information of the currently executing check.
511+
By default this field has the form ``<check_name> on <current_partition> using <current_environment>``.
512+
It can be configured on a per test basis by overriding the :func:`info <reframe.core.pipeline.RegressionTest.info>` method in your regression test.
506513

507514
* ``datefmt`` (default: ``'%FT%T'``) The format that will be used for outputting timestamps (i.e., the ``%(asctime)s`` field).
508515
Acceptable formats must conform to standard library's `time.strftime() <https://docs.python.org/3.6/library/time.html#time.strftime>`__ function.
@@ -513,21 +520,26 @@ The configurable properties of a log record handler are the following:
513520
If set for a ``filename.log`` handler entry, the resulting log file name will be ``filename_<timestamp>.log``.
514521
This property is ignored for the standard output/error handlers.
515522

523+
.. note::
524+
.. versionchanged:: 2.10
525+
The ``testcase_name`` logging attribute was replaced with the ``check_info``, which is now also configurable
526+
527+
516528
Performance Logging
517529
^^^^^^^^^^^^^^^^^^^
518530

519531
ReFrame supports additional logging for performance tests specifically, in order to record historical performance data.
520532
For each performance test, a log file of the form ``<test-name>.log`` is created under the ReFrame's `log directory <#configuring-reframe-directories>`__ where the test's performance is recorded.
521-
The default format used for this file is ``'[%(asctime)s] %(testcase_name)s (jobid=%(check_jobid)s): %(message)s'`` and ReFrame always appends to this file.
533+
The default format used for this file is ``'[%(asctime)s] %(check_info)s (jobid=%(check_jobid)s): %(message)s'`` and ReFrame always appends to this file.
522534
Currently, it is not possible for users to configure performance logging.
523535

524536
The resulting log file looks like the following:
525537

526538
.. code-block:: none
527539
528-
[2017-12-01T15:31:20] example7_check@daint:gpu using PrgEnv-cray (jobid=649790): value: 47.797996, reference: (50.0, -0.1, 0.1)
529-
[2017-12-01T15:31:24] example7_check@daint:gpu using PrgEnv-gnu (jobid=649791): value: 49.048228, reference: (50.0, -0.1, 0.1)
530-
[2017-12-01T15:31:24] example7_check@daint:gpu using PrgEnv-pgi (jobid=649792): value: 48.575334, reference: (50.0, -0.1, 0.1)
540+
[2018-03-01T20:01:20] reframe 2.10: example7_check on daint:gpu using PrgEnv-pgi (jobid=6224525): value: 49.637615, reference: (50.0, -0.1, 0.1)
541+
[2018-03-01T20:01:20] reframe 2.10: example7_check on daint:gpu using PrgEnv-cray (jobid=6224523): value: 49.931819, reference: (50.0, -0.1, 0.1)
542+
[2018-03-01T20:01:21] reframe 2.10: example7_check on daint:gpu using PrgEnv-gnu (jobid=6224524): value: 49.428855, reference: (50.0, -0.1, 0.1)
531543
532544
The interpretation of the performance values depends on the individual tests.
533545
The above output is from the CUDA performance test we presented in the `tutorial <tutorial.html#writing-a-performance-test>`__, so the value refers to the achieved Gflop/s.

reframe/core/pipeline.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,21 @@ def info(self):
636636
637637
This method is used by the front-end to print the status message during
638638
the test's execution.
639+
This function is also called to provide the message for the
640+
``check_info`` `logging attribute <running.html#logging>`__.
641+
By default, it returns a message reporting the test name, the current
642+
partition and the current programming environment that the test is
643+
currently executing on.
644+
645+
:returns: a string with an informational message about this test
646+
647+
.. note ::
648+
When overriding this method, you should pay extra attention on how
649+
you use the :class:`RegressionTest`'s attributes, because this
650+
method may be called at any point of the test's lifetime.
651+
652+
.. versionadded:: 2.10
639653
640-
:returns: a string with an informational message containing the test
641-
name, the current partition and the current programming environment
642-
that the test is currently executing on.
643654
"""
644655
ret = self.name
645656
if self.current_partition:

0 commit comments

Comments
 (0)