Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/cscs-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@
'handlers': [
{
'type': 'file',
'name': 'reframe.log',
'level': 'debug',
'format': '[%(asctime)s] %(levelname)s: %(check_info)s: %(message)s', # noqa: E501
'append': False
Expand Down
6 changes: 5 additions & 1 deletion docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,13 @@ The additional properties for the ``file`` handler are the following:

.. object:: .logging[].handlers_perflog[].name

:required: Yes
:required: No

The name of the file where this handler will write log records.
If not specified, ReFrame will create a log file prefixed with ``rfm-`` in the system's temporary directory.

.. versionchanged:: 3.3
The ``name`` parameter is no more required and the default log file resides in the system's temporary directory.


.. js:attribute:: .logging[].handlers[].append
Expand Down
336 changes: 172 additions & 164 deletions docs/tutorial_basics.rst

Large diffs are not rendered by default.

189 changes: 100 additions & 89 deletions docs/tutorial_deps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,95 +76,106 @@ Here is the output when running the OSU tests with the asynchronous execution po

.. code-block:: none

[==========] Running 7 check(s)
[==========] Started on Wed Jun 3 09:00:40 2020

[----------] started processing OSUBuildTest (OSU benchmarks build test)
[ RUN ] OSUBuildTest on daint:gpu using PrgEnv-gnu
[ RUN ] OSUBuildTest on daint:gpu using PrgEnv-intel
[ RUN ] OSUBuildTest on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUBuildTest (OSU benchmarks build test)

[----------] started processing OSULatencyTest (OSU latency test)
[ RUN ] OSULatencyTest on daint:gpu using PrgEnv-gnu
[ DEP ] OSULatencyTest on daint:gpu using PrgEnv-gnu
[ RUN ] OSULatencyTest on daint:gpu using PrgEnv-intel
[ DEP ] OSULatencyTest on daint:gpu using PrgEnv-intel
[ RUN ] OSULatencyTest on daint:gpu using PrgEnv-pgi
[ DEP ] OSULatencyTest on daint:gpu using PrgEnv-pgi
[----------] finished processing OSULatencyTest (OSU latency test)

[----------] started processing OSUBandwidthTest (OSU bandwidth test)
[ RUN ] OSUBandwidthTest on daint:gpu using PrgEnv-gnu
[ DEP ] OSUBandwidthTest on daint:gpu using PrgEnv-gnu
[ RUN ] OSUBandwidthTest on daint:gpu using PrgEnv-intel
[ DEP ] OSUBandwidthTest on daint:gpu using PrgEnv-intel
[ RUN ] OSUBandwidthTest on daint:gpu using PrgEnv-pgi
[ DEP ] OSUBandwidthTest on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUBandwidthTest (OSU bandwidth test)

[----------] started processing OSUAllreduceTest_2 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-gnu
[ DEP ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-gnu
[ RUN ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-intel
[ DEP ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-intel
[ RUN ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-pgi
[ DEP ] OSUAllreduceTest_2 on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUAllreduceTest_2 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_4 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-gnu
[ DEP ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-gnu
[ RUN ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-intel
[ DEP ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-intel
[ RUN ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-pgi
[ DEP ] OSUAllreduceTest_4 on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUAllreduceTest_4 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_8 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-gnu
[ DEP ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-gnu
[ RUN ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-intel
[ DEP ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-intel
[ RUN ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-pgi
[ DEP ] OSUAllreduceTest_8 on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUAllreduceTest_8 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_16 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-gnu
[ DEP ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-gnu
[ RUN ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-intel
[ DEP ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-intel
[ RUN ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-pgi
[ DEP ] OSUAllreduceTest_16 on daint:gpu using PrgEnv-pgi
[----------] finished processing OSUAllreduceTest_16 (OSU Allreduce test)

[----------] waiting for spawned checks to finish
[ OK ] ( 1/21) OSUBuildTest on daint:gpu using PrgEnv-pgi [compile: 29.581s run: 0.086s total: 29.708s]
[ OK ] ( 2/21) OSUBuildTest on daint:gpu using PrgEnv-gnu [compile: 26.250s run: 69.120s total: 95.437s]
[ OK ] ( 3/21) OSUBuildTest on daint:gpu using PrgEnv-intel [compile: 39.385s run: 89.213s total: 129.871s]
[ OK ] ( 4/21) OSULatencyTest on daint:gpu using PrgEnv-pgi [compile: 0.012s run: 145.355s total: 154.504s]
[ OK ] ( 5/21) OSUAllreduceTest_2 on daint:gpu using PrgEnv-pgi [compile: 0.014s run: 148.276s total: 154.433s]
[ OK ] ( 6/21) OSUAllreduceTest_4 on daint:gpu using PrgEnv-pgi [compile: 0.011s run: 149.763s total: 154.407s]
[ OK ] ( 7/21) OSUAllreduceTest_8 on daint:gpu using PrgEnv-pgi [compile: 0.013s run: 151.262s total: 154.378s]
[ OK ] ( 8/21) OSUAllreduceTest_16 on daint:gpu using PrgEnv-pgi [compile: 0.010s run: 152.716s total: 154.360s]
[ OK ] ( 9/21) OSULatencyTest on daint:gpu using PrgEnv-gnu [compile: 0.014s run: 210.952s total: 220.847s]
[ OK ] (10/21) OSUBandwidthTest on daint:gpu using PrgEnv-pgi [compile: 0.015s run: 213.285s total: 220.758s]
[ OK ] (11/21) OSUAllreduceTest_4 on daint:gpu using PrgEnv-gnu [compile: 0.011s run: 215.596s total: 220.717s]
[ OK ] (12/21) OSUAllreduceTest_16 on daint:gpu using PrgEnv-gnu [compile: 0.011s run: 218.742s total: 220.651s]
[ OK ] (13/21) OSUAllreduceTest_2 on daint:gpu using PrgEnv-intel [compile: 0.013s run: 203.214s total: 206.115s]
[ OK ] (14/21) OSUAllreduceTest_8 on daint:gpu using PrgEnv-intel [compile: 0.016s run: 204.819s total: 206.078s]
[ OK ] (15/21) OSUBandwidthTest on daint:gpu using PrgEnv-gnu [compile: 0.012s run: 258.772s total: 266.873s]
[ OK ] (16/21) OSUAllreduceTest_8 on daint:gpu using PrgEnv-gnu [compile: 0.014s run: 263.576s total: 266.752s]
[ OK ] (17/21) OSULatencyTest on daint:gpu using PrgEnv-intel [compile: 0.011s run: 227.234s total: 231.789s]
[ OK ] (18/21) OSUAllreduceTest_4 on daint:gpu using PrgEnv-intel [compile: 0.013s run: 229.729s total: 231.724s]
[ OK ] (19/21) OSUAllreduceTest_2 on daint:gpu using PrgEnv-gnu [compile: 0.013s run: 286.203s total: 292.444s]
[ OK ] (20/21) OSUAllreduceTest_16 on daint:gpu using PrgEnv-intel [compile: 0.028s run: 242.030s total: 242.091s]
[ OK ] (21/21) OSUBandwidthTest on daint:gpu using PrgEnv-intel [compile: 0.013s run: 243.719s total: 247.384s]
[----------] all spawned checks have finished

[ PASSED ] Ran 21 test case(s) from 7 check(s) (0 failure(s))
[==========] Finished on Wed Jun 3 09:07:24 2020
[ReFrame Setup]
version: 3.3-dev0 (rev: cb974c13)
command: './bin/reframe -C tutorials/config/settings.py -c tutorials/deps/osu_benchmarks.py -r'
launched by: user@dom101
working directory: '/users/user/Devel/reframe'
settings file: 'tutorials/config/settings.py'
check search path: '/users/user/Devel/reframe/tutorials/deps/osu_benchmarks.py'
stage directory: '/users/user/Devel/reframe/stage'
output directory: '/users/user/Devel/reframe/output'

[==========] Running 7 check(s)
[==========] Started on Mon Oct 12 20:19:40 2020

[----------] started processing OSUBuildTest (OSU benchmarks build test)
[ RUN ] OSUBuildTest on daint:gpu using gnu
[ RUN ] OSUBuildTest on daint:gpu using intel
[ RUN ] OSUBuildTest on daint:gpu using pgi
[----------] finished processing OSUBuildTest (OSU benchmarks build test)

[----------] started processing OSULatencyTest (OSU latency test)
[ RUN ] OSULatencyTest on daint:gpu using gnu
[ DEP ] OSULatencyTest on daint:gpu using gnu
[ RUN ] OSULatencyTest on daint:gpu using intel
[ DEP ] OSULatencyTest on daint:gpu using intel
[ RUN ] OSULatencyTest on daint:gpu using pgi
[ DEP ] OSULatencyTest on daint:gpu using pgi
[----------] finished processing OSULatencyTest (OSU latency test)

[----------] started processing OSUBandwidthTest (OSU bandwidth test)
[ RUN ] OSUBandwidthTest on daint:gpu using gnu
[ DEP ] OSUBandwidthTest on daint:gpu using gnu
[ RUN ] OSUBandwidthTest on daint:gpu using intel
[ DEP ] OSUBandwidthTest on daint:gpu using intel
[ RUN ] OSUBandwidthTest on daint:gpu using pgi
[ DEP ] OSUBandwidthTest on daint:gpu using pgi
[----------] finished processing OSUBandwidthTest (OSU bandwidth test)

[----------] started processing OSUAllreduceTest_2 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_2 on daint:gpu using gnu
[ DEP ] OSUAllreduceTest_2 on daint:gpu using gnu
[ RUN ] OSUAllreduceTest_2 on daint:gpu using intel
[ DEP ] OSUAllreduceTest_2 on daint:gpu using intel
[ RUN ] OSUAllreduceTest_2 on daint:gpu using pgi
[ DEP ] OSUAllreduceTest_2 on daint:gpu using pgi
[----------] finished processing OSUAllreduceTest_2 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_4 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_4 on daint:gpu using gnu
[ DEP ] OSUAllreduceTest_4 on daint:gpu using gnu
[ RUN ] OSUAllreduceTest_4 on daint:gpu using intel
[ DEP ] OSUAllreduceTest_4 on daint:gpu using intel
[ RUN ] OSUAllreduceTest_4 on daint:gpu using pgi
[ DEP ] OSUAllreduceTest_4 on daint:gpu using pgi
[----------] finished processing OSUAllreduceTest_4 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_8 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_8 on daint:gpu using gnu
[ DEP ] OSUAllreduceTest_8 on daint:gpu using gnu
[ RUN ] OSUAllreduceTest_8 on daint:gpu using intel
[ DEP ] OSUAllreduceTest_8 on daint:gpu using intel
[ RUN ] OSUAllreduceTest_8 on daint:gpu using pgi
[ DEP ] OSUAllreduceTest_8 on daint:gpu using pgi
[----------] finished processing OSUAllreduceTest_8 (OSU Allreduce test)

[----------] started processing OSUAllreduceTest_16 (OSU Allreduce test)
[ RUN ] OSUAllreduceTest_16 on daint:gpu using gnu
[ DEP ] OSUAllreduceTest_16 on daint:gpu using gnu
[ RUN ] OSUAllreduceTest_16 on daint:gpu using intel
[ DEP ] OSUAllreduceTest_16 on daint:gpu using intel
[ RUN ] OSUAllreduceTest_16 on daint:gpu using pgi
[ DEP ] OSUAllreduceTest_16 on daint:gpu using pgi
[----------] finished processing OSUAllreduceTest_16 (OSU Allreduce test)

[----------] waiting for spawned checks to finish
[ OK ] ( 1/21) OSUBuildTest on daint:gpu using pgi [compile: 28.225s run: 0.040s total: 28.277s]
[ OK ] ( 2/21) OSUBuildTest on daint:gpu using gnu [compile: 21.495s run: 66.686s total: 88.208s]
[ OK ] ( 3/21) OSUBuildTest on daint:gpu using intel [compile: 38.376s run: 37.468s total: 75.855s]
[ OK ] ( 4/21) OSUAllreduceTest_16 on daint:gpu using pgi [compile: 0.005s run: 14.180s total: 14.197s]
[ OK ] ( 5/21) OSUAllreduceTest_16 on daint:gpu using gnu [compile: 0.008s run: 17.997s total: 18.736s]
[ OK ] ( 6/21) OSUAllreduceTest_4 on daint:gpu using pgi [compile: 0.007s run: 18.581s total: 21.528s]
[ OK ] ( 7/21) OSUAllreduceTest_2 on daint:gpu using pgi [compile: 0.005s run: 45.562s total: 49.983s]
[ OK ] ( 8/21) OSUAllreduceTest_8 on daint:gpu using pgi [compile: 0.006s run: 49.313s total: 50.789s]
[ OK ] ( 9/21) OSUAllreduceTest_8 on daint:gpu using gnu [compile: 0.006s run: 48.884s total: 51.096s]
[ OK ] (10/21) OSUAllreduceTest_4 on daint:gpu using gnu [compile: 0.007s run: 48.169s total: 51.854s]
[ OK ] (11/21) OSULatencyTest on daint:gpu using pgi [compile: 0.006s run: 53.398s total: 60.785s]
[ OK ] (12/21) OSUAllreduceTest_2 on daint:gpu using gnu [compile: 0.005s run: 56.394s total: 61.531s]
[ OK ] (13/21) OSULatencyTest on daint:gpu using gnu [compile: 0.005s run: 55.499s total: 63.628s]
[ OK ] (14/21) OSUAllreduceTest_2 on daint:gpu using intel [compile: 0.006s run: 67.665s total: 70.079s]
[ OK ] (15/21) OSUAllreduceTest_16 on daint:gpu using intel [compile: 0.005s run: 73.259s total: 73.275s]
[ OK ] (16/21) OSULatencyTest on daint:gpu using intel [compile: 0.006s run: 97.960s total: 101.936s]
[ OK ] (17/21) OSUAllreduceTest_8 on daint:gpu using intel [compile: 0.006s run: 101.123s total: 101.933s]
[ OK ] (18/21) OSUAllreduceTest_4 on daint:gpu using intel [compile: 0.007s run: 100.592s total: 102.215s]
[ OK ] (19/21) OSUBandwidthTest on daint:gpu using pgi [compile: 0.005s run: 117.530s total: 123.408s]
[ OK ] (20/21) OSUBandwidthTest on daint:gpu using gnu [compile: 0.005s run: 117.174s total: 123.765s]
[ OK ] (21/21) OSUBandwidthTest on daint:gpu using intel [compile: 0.005s run: 160.484s total: 163.680s]
[----------] all spawned checks have finished

[ PASSED ] Ran 21 test case(s) from 7 check(s) (0 failure(s))
[==========] Finished on Mon Oct 12 20:24:02 2020
Log file(s) saved in: '/tmp/rfm-m5zww8le.log'

Before starting running the tests, ReFrame topologically sorts them based on their dependencies and schedules them for running using the selected execution policy.
With the serial execution policy, ReFrame simply executes the tests to completion as they "arrive", since the tests are already topologically sorted.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial_misc_topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ ReFrame can be used also to test applications that run inside a container.
First, we need to enable the container platform support in ReFrame's configuration and, specifically, at the partition configuration level:

.. literalinclude:: ../tutorials/config/settings.py
:lines: 40-54
:lines: 38-52
:emphasize-lines: 8-13

For each partition, users can define a list of container platforms supported using the :js:attr:`container_platforms` configuration parameter.
Expand Down
19 changes: 14 additions & 5 deletions reframe/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import shutil
import sys
import socket
import tempfile
import time

import reframe
import reframe.utility.color as color
import reframe.utility.os_ext as os_ext
from reframe.core.exceptions import ConfigError, LoggingError
Expand Down Expand Up @@ -194,7 +194,12 @@ def _create_logger(site_config, handlers_group):


def _create_file_handler(site_config, config_prefix):
filename = site_config.get(f'{config_prefix}/name')
filename = os.path.expandvars(site_config.get(f'{config_prefix}/name'))
if not filename:
logfd, logfile = tempfile.mkstemp(suffix='.log', prefix='rfm-')
os.close(logfd)
filename = logfile

timestamp = site_config.get(f'{config_prefix}/timestamp')
if timestamp:
basename, ext = os.path.splitext(filename)
Expand Down Expand Up @@ -551,11 +556,15 @@ def configure_logging(site_config):
_context_logger = LoggerAdapter(_logger)


def log_files():
return [hdlr.baseFilename for hdlr in _logger.handlers
if isinstance(hdlr, logging.FileHandler)]


def save_log_files(dest):
os.makedirs(dest, exist_ok=True)
for hdlr in _logger.handlers:
if isinstance(hdlr, logging.FileHandler):
shutil.copy(hdlr.baseFilename, dest, follow_symlinks=True)
return [shutil.copy(logfile, dest, follow_symlinks=True)
for logfile in log_files()]


def getlogger():
Expand Down
2 changes: 1 addition & 1 deletion reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def nodelist(self):

.. versionadded:: 2.17

:type:`List[str]` or :type:`None`
:type: :class:`List[str]` or :class:`None`
'''
return self._nodelist

Expand Down
1 change: 0 additions & 1 deletion reframe/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
{
'type': 'file',
'name': 'reframe.log',
'level': 'debug',
'format': '[%(asctime)s] %(levelname)s: %(check_info)s: %(message)s', # noqa: E501
'append': False
Expand Down
10 changes: 9 additions & 1 deletion reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,9 +792,17 @@ def print_infoline(param, value):
sys.exit(1)
finally:
try:
log_files = logging.log_files()
if site_config.get('general/0/save_log_files'):
logging.save_log_files(rt.output_prefix)
log_files = logging.save_log_files(rt.output_prefix)

except OSError as e:
printer.error('could not save log file: %s' % e)
sys.exit(1)
finally:
if not log_files:
msg = '<no log file was generated>'
else:
msg = f'{", ".join(repr(f) for f in log_files)}'

printer.info(f'Log file(s) saved in: {msg}')
4 changes: 2 additions & 2 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
{"type": "string"}
]
}
},
"required": ["name"]
}
}
]
},
Expand Down Expand Up @@ -423,6 +422,7 @@
"logging/handlers*/*_format": "%(message)s",
"logging/handlers*/*_datefmt": "%FT%T",
"logging/handlers*/file_append": false,
"logging/handlers*/file_name": "",
"logging/handlers*/file_timestamp": false,
"logging/handlers*/filelog_append": true,
"logging/handlers*/filelog_basedir": "./perflogs",
Expand Down
1 change: 0 additions & 1 deletion tutorials/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
},
{
'type': 'file',
'name': 'reframe.log',
'level': 'debug',
'format': '[%(asctime)s] %(levelname)s: %(check_info)s: %(message)s', # noqa: E501
'append': False
Expand Down
1 change: 0 additions & 1 deletion unittests/resources/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
'handlers': [
{
'type': 'file',
'name': '.rfm_unittest.log',
'level': 'debug',
'format': (
'[%(check_job_completion_time)s] %(levelname)s: '
Expand Down
Loading