-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add C++ Implementation of precice-aste-join #156
base: develop
Are you sure you want to change the base?
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.
We definitely need tests. A rather simple solution would be to perform the merging in the integration tests twice, one with the python version, one with the cpp version. We also need to update the website docs accordingly.
po::store(parse_command_line(argc, argv, desc), vm); | ||
|
||
if (vm.count("help")) { | ||
std::cout << desc << std::endl; |
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.
As you already mentioned in your comment, we should probably include the ASTE logger here. Should be easy to use anyway.
} catch (nlohmann::detail::type_error &) { | ||
std::cerr << "Error while parsing recovery file \"size\" is missing"; | ||
std::exit(EXIT_FAILURE); |
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 guess this is an unintentional duplication of the catch above?
} catch (nlohmann::detail::type_error &) { | ||
std::cerr << "Error while parsing recovery file \"cell_types\" is missing"; | ||
std::exit(EXIT_FAILURE); |
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 guess this is an unintentional duplication of the catch above?
/** | ||
* @brief Count the number of partitioned mesh files for given prefix | ||
* | ||
* @param prefix | ||
* @return size_t | ||
*/ |
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.
Same as above, I won't comment all the comments
return joinedMesh; | ||
} | ||
|
||
auto recoveryMerge(const std::string &prefix, std::size_t numparts, int size, const std::vector<int> &cellTypes, const std::vector<std::vector<int>> &cells) -> vtkSmartPointer<vtkUnstructuredGrid> |
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.
Looks like there is quite a lot of duplication between the partitionwiseMerge and the recoveryMerge. I would expect that the one is a subroutine of the other.
I would propose to first add tests and afterwards refactor here.
Co-authored-by: David Schneider <[email protected]>
Co-authored-by: David Schneider <[email protected]>
Co-authored-by: David Schneider <[email protected]>
Main changes of this PR
Add an C++ implementation of precice-aste-join
Due to many loops and copy operations, Python implementation is considerably slow for large meshes. This C++ implementation provides 4-8 times faster merge operations than the Python version.
What is missing?
Author's checklist
pre-commit
hook and usedpre-commit run --all
to apply all available hooks.docs/README.md
.precice/tutorials/aste-turbine
.