Skip to content
Closed
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
16 changes: 11 additions & 5 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,21 +1039,27 @@ def check_performance(self):
return

with os_ext.change_dir(self._stagedir):
# first check and print all values with references
value = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better call this perf_values. I'd also change a bit the comment to "Evaluate all performance variables first, so as to log them, then assert them".

for tag, expr in self.perf_patterns.items():
value = evaluate(expr)
value[tag] = evaluate(expr)
key = '%s:%s' % (self._current_partition.fullname, tag)
try:
ref, low_thres, high_thres = self.reference[key]
self._perf_logger.info(
'value: %s, reference: %s' %
(value, self.reference[key])
'%s, value: %s, reference: %s' %
(tag, value[tag], self.reference[key])
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the logging, I suggest waiting for #213 to be merged (perhaps today).

ref, low_thres, high_thres = self.reference[key]
except KeyError:
raise SanityError(
"tag `%s' not resolved in references for `%s'" %
(tag, self._current_partition.fullname)
)
evaluate(assert_reference(value, ref, low_thres, high_thres))
for tag, expr in self.perf_patterns.items():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to go over the perf_patterns again here. Just over the evaluated perf_values.

Also, leave a blank line after the previous for loop.

key = '%s:%s' % (self._current_partition.fullname, tag)
ref, low_thres, high_thres = self.reference[key]
evaluate(assert_reference(value[tag], ref, low_thres,
high_thres))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't understand very well the purpose of this nested loop here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a nested loop. I needed to move the evaluation to an additional loop. The reason was that if one of the early reference comparison throw the assert the other values were not written to the log file. In this way first all values are written and then the comparison is performed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, for some reason I overlooked the alignment! I see what you are trying to do.


def _copy_to_outputdir(self):
"""Copy checks interesting files to the output directory."""
Expand Down