-
Notifications
You must be signed in to change notification settings - Fork 117
[test] Add generic checks for the cscs-supported apps into hpctestlib/apps
#2084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
update reframe to 3.7.1 version
|
Hello @hurricane642, Thank you for updating!
Do see the ReFrame Coding Style Guide Comment last updated at 2021-09-01 12:12:53 UTC |
|
Can I test this patch? |
|
ok to test |
Codecov Report
@@ Coverage Diff @@
## master #2084 +/- ##
==========================================
- Coverage 86.29% 86.26% -0.03%
==========================================
Files 53 53
Lines 9571 9313 -258
==========================================
- Hits 8259 8034 -225
+ Misses 1312 1279 -33
Continue to review full report at Codecov.
|
|
Hi @hurricane642! One comment regarding the file structure. The base tests are meant to go into So when you import your base, the python import should look as |
jjotero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments on the structure before delving into the test-specifics:
- Rename the
cscs-checks/apps/lammps/lammpstocscs-checks/apps/lammps/lammps_check.pyand then use git mv if you want to. Otherwise, we'd be losing all the git history. - Delete the
__init__files that just have a version ID in there. - For each test, just replace the
__init__with the*_base.pyfiles. That intermediate step is not needed. Have a look into the other tests in the library to see how it's done there.
jjotero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better if each app is under its own directory instead of having all the python files in the same place. The reason behind this is that each test might have their own additional files that one might need for the tests, and then you don't want to have all those files mixed up in the same directory (please, have a look into hpctestlib/microbenchmarks/gpu and see how it's done in there). So in short, I would rename hpctestlib/apps/amber.py to hpctestlib/apps/amber/__init__.py (and the same for all the other apps).
jjotero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just briefly gone through the base classes for now.
I think there are a few conceptual changes to be made to the base classes. Things like the self.benchmark parameter (which referenced, but not declared in the base classes) should not be enforced from the base class. If someone wants to parameterise all these tests, they're free to do so in the base class. But if someone doesn't they should not need to define anything such as self.benchmark, because there is only one of them. Also, (and this is for the derived classes) perhaps the name variant makes more sense than benchmark.
| for key in list(self.REFERENCE_DICT): | ||
| if self.current_partition.fullname in key: | ||
| d = {self.current_partition.fullname: | ||
| self.REFERENCE_DICT[key]} | ||
| self.reference = d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that we make this set_perf_reference a different hook for both the GPU and CPU cases, simply because their references above are compacted in a different format. So move this hook into the GPU-specific class, and then create a similar one in the GPU class where you also deal with the small & large scopes of the dictionary.
This also avoids having to store another reference to this REFERENCE_DICT in the class, which is a bit confusing.
| for key in list(self.REFERENCE_DICT): | |
| if self.current_partition.fullname in key: | |
| d = {self.current_partition.fullname: | |
| self.REFERENCE_DICT[key]} | |
| self.reference = d | |
| for key, val in REFERENCE_GPU_PERFORMANCE.items(): | |
| if self.current_partition.fullname in key: | |
| self.reference = {'*': val} | |
| break | |
| else: | |
| raise ValueError( | |
| f'could not find a reference for the current ' | |
| f'partition {self.current_partition.fullname!r}' | |
| ) |
| }, | ||
| } | ||
|
|
||
| REFERENCE_CPU_PERFORMANCE_LARGE = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keys for this dictionary also must be made tuples.
| @run_after('setup') | ||
| def set_reference_dict(self): | ||
| self.REFERENCE_DICT = REFERENCE_CPU_PERFORMANCE[self.scale] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @run_after('setup') | |
| def set_reference_dict(self): | |
| self.REFERENCE_DICT = REFERENCE_CPU_PERFORMANCE[self.scale] | |
| @run_before('performance') | |
| def set_perf_reference(self): | |
| for key, val in REFERENCE_CPU_PERFORMANCE[self.scale].items(): | |
| if self.current_partition.fullname in key: | |
| self.reference = {'*': val} | |
| break | |
| else: | |
| raise ValueError( | |
| f'could not find a reference for the current ' | |
| f'partition {self.current_partition.fullname!r}' | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the keys of REFERENCE_CPU_PERFORMANCE_LARGE also must be made tuples in order for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Thank to string if self.current_partition.fullname in key: we check either substring in the string (as in case REFERENCE_CPU_PERFORMANCE_LARGE) or element in a tuple
|
Replaced by individual PRs. |
This PR contains a base for the tests and their implementation for
cscs-checkswith updated syntax and unified style. I'll be happy with your review and suggestions!