add timing thresholds to test codes #532
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
re: some other discussions we've been having in spack-stack#589, and possibly also related to #527 and elsewhere, here's an idea for how to start moving forward with adding timing thresholds to the NCEPLIBS-bufr test codes.
This is just an example for how to do this in one of our many test codes that I picked at random, and the same thing could be done in all of other test/intest* and test/outtest* codes as well. The idea is that we could eventually remove the extraneous 'print *,' statements for these values and instead compare each final cpu and wall time to some threshold and then just do a stop with a nonzero return inside of the code if the threshold is exceeded. Of course we'd also need to do some baseline tests to figure out what those thresholds should even be. But before doing any of that I wanted to put this out there to give you all a chance to comment, and in case you may have a better idea or know of a better or more standard way of doing this(?)
At some point we should probably set up similar timing tests on all of our utilities via the test_debufr.sh, test_sinv.sh, etc. scripts, but those would be a bit different b/c those are utilities that are used by the wider community, so we wouldn't want to embed any cpu_time or system_clock calls directly in those codes. Instead, my thinking was maybe we use the UNIX
time
command whenever we run each test of that utility inside of the associated test_(utilityname).sh script, and then check the thresholds that way within the script. But since the UNIXtime
command writes its results to stderr, we'd probably have to use something a bit kludgey along the lines of{ time ../utils/debufr $args_n 2> /dev/null; } 2> timings_n
to capture those timings and then compare them to some threshold within the script. Or maybe there's a better way to do that as well?