-
Notifications
You must be signed in to change notification settings - Fork 249
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
[HDF5] Update - 1 - Refactor HDF5File #11473
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.
👍
if(USE_MPI) | ||
target_link_libraries(KratosHDF5Core PUBLIC KratosCore KratosMPICore PRIVATE ${HDF5_C_LIBRARIES} ${KRATOS_HDF5_APPLICATION_EXTRA_LIBS}) | ||
else(USE_MPI) | ||
target_link_libraries(KratosHDF5Core PUBLIC KratosCore PRIVATE ${HDF5_C_LIBRARIES} ${KRATOS_HDF5_APPLICATION_EXTRA_LIBS}) | ||
endif(USE_MPI) |
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 recommend splitting this into a separate MPI-Extension, same as the other apps
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.
Would it be ok if I do it in a seperate PR? I think that will be cleaner, because there are some other files which also needs to go into this mpi-extension.
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.
ok for me
applications/HDF5Application/custom_processes/hdf5_xdmf_connectivities_writer_process.cpp
Outdated
Show resolved
Hide resolved
applications/HDF5Application/custom_processes/hdf5_xdmf_connectivities_writer_process.cpp
Outdated
Show resolved
Hide resolved
private: | ||
///@name Member Variables | ||
///@{ | ||
|
||
DataCommunicator const * mpDataCommunicator; |
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 not const &
?
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'm the one to blame here, but I'll stand by my opinion. Storing a const
member always messes up move and copy semantics. In this case, copy construction/assignment and move assignment doesn't make sense, but I don't see why move construction should be forbidden.
@@ -22,67 +49,9 @@ bool IsPath(const std::string& rPath) | |||
return regex_match(rPath, std::regex("(/[\\w\\(\\)]+)+")); |
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.
perhaps this can be done better with std::filesystem
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 am not sure how to do this with std::filesystem
since these paths are not actual file paths, but hdf5 paths within one hdf5 file.
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'll review this in chunks and start with hdf5_file.h
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.
hdf5_file.cpp
applications/HDF5Application/custom_utilities/data_type_utilities.h
Outdated
Show resolved
Hide resolved
@matekelemen @philbucher I applied your suggestions. Could you have a look? Thanks :D |
LGTM |
@matekelemen I changed to |
📝 Description
This PR refactors
HDF5File
. Followings changes/updates were applied.HDF5File
ctor now requiresDataCommunicator
. The python ctor still has a ctor withoutDataCommunicator
, in this case a warning is thrown. This is planned to be removed once the python side of theHDF5Application
is updated.mpi
calls are now done viaDataCommunicator
.HDF5FileSerial
andHDF5FileParallel
are removed. Everything is done now inHDF5File
array_1d<double, 4>
,array_1d<double, 6>
,array_1d<double, 9>
HDF5FileParallel
version throws an error if the dataset is existing when writing, butHDF5SerialFile
retireves the existing and changes it. The behaviour is now uniform in mpi and openmp.HDFFile
updated.Requires #11469
This closes #10728
🆕 Changelog