Add C++ Implementation of precice-aste-join#156
Conversation
davidscn
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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 <david.schneider@ipvs.uni-stuttgart.de>
Co-authored-by: David Schneider <david.schneider@ipvs.uni-stuttgart.de>
Co-authored-by: David Schneider <david.schneider@ipvs.uni-stuttgart.de>
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-commithook and usedpre-commit run --allto apply all available hooks.docs/README.md.precice/tutorials/aste-turbine.