-
Notifications
You must be signed in to change notification settings - Fork 55
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
Enhance cmesh testing #871
Conversation
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.
Thanks for the interesting contribution @Davknapp !
I like the idea very much and we should definitely consider to migrate to this testing scheme soon!
However, in my view creating three C++ classes for this rather simple logic is shooting birds with guns. I suggest to consider a refactor.
As also noted in the line attached comments I suggest to simply create one C++ iterator class which spits out one cmesh after the other. Very simple, easy to comprehend and quick to extend with lots of cmesh variants.
Here some links. Probably just implement an output iterator. One proably does not need to implement all operators. We do not need to apply sort or random access or such fancy stuff.
https://www.internalpointers.com/post/writing-custom-iterators-modern-cpp
https://www.programiz.com/cpp-programming/iterators
The goal is to be able to run tests over a sum of cmeshes. I agree, for a single set of cmeshes (for example all cmeshes that only need a communicator, or all cmeshes that get a communicator and a number of trees to generate) it will be better to implement an iterator. |
i just want to do some quick experiments
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.
Let's have a direct telco about this PR. It is pretty tedious to get an overview over the interdependence of classes you use here and how and where they are used.
This is a draft PR to discuss further needed changes of this new feature.
This branch provides a way to iterate over all of our cmeshes using googletest functionality.
It basically consists of two classes.
cmesh_creator
, a class to create cmeshes of similar type (for example all cmeshes that only need a communicator). It also holds the cmesh.cmesh_generator
, iterates over all cmesh_creators and all of the parameter-sets usable by each cmesh_creator. Overloads the+
and<
to be usable by testing::Range(start, end, step)` of the GoogleTestSuite.I implemented two examples of a
cmesh_creator
, one for cmesh-examples that only get a communicator and one for examples that get a communicator and a number of trees.Goal of this feature is to provide a way to test cmeshes, that is easily extendable by new testcases.
In the current setup one would either:
a) Add the new cmesh function to one of the existing cmesh_creators or
b) Implement a new 'cmesh_creator' and add it to the 'cmesh_generator'
As soon as this PR is merged, we would also be able to provide a MAKRO to iterate over all cmeshes and a customized assertion to check the equality of two cmeshes.
I will be happy about your opinion on this new feature!
All these boxes must be checked by the reviewers before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
The reviewer executed the new code features at least once and checked the results manually
The code follows the t8code coding guidelines
New source/header files are properly added to the Makefiles
The code is well documented
All function declarations, structs/classes and their members have a proper doxygen documentation
All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue)
Tests
Github action
The code compiles without warning in debugging and release mode, with and without MPI (this should be executed automatically in a github action)
All tests pass (in various configurations, this should be executed automatically in a github action)
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scp
to check the indentation of these files.Licence
doc/
(or already has one)