Skip to content

[HDF5] Update - 7 - ModelPartIO#11490

Merged
sunethwarna merged 29 commits intomasterfrom
hdf5/update/model_part_io
Aug 12, 2025
Merged

[HDF5] Update - 7 - ModelPartIO#11490
sunethwarna merged 29 commits intomasterfrom
hdf5/update/model_part_io

Conversation

@sunethwarna
Copy link
Member

@sunethwarna sunethwarna commented Aug 18, 2023

📝 Description
Updates ModelPartIO and PartitionedModelPartIO to new features. The ParitionedModelPartIO will be moved to mpi_extension in a future PR.

🆕 Changelog

  • Updates ModelPartIO and ParitionedModelPartIO

@sunethwarna sunethwarna changed the base branch from master to hdf5/update/properties_io August 29, 2023 13:27
@sunethwarna sunethwarna self-assigned this Sep 4, 2023
@sunethwarna sunethwarna marked this pull request as ready for review September 4, 2023 13:50
@sunethwarna sunethwarna requested a review from a team as a code owner September 4, 2023 13:50
Base automatically changed from hdf5/update/properties_io to master June 20, 2025 20:05
@sunethwarna
Copy link
Member Author

This is ready for your review @matekelemen :)

auto& r_local_nodes = r_communicator.LocalMesh().Nodes();
auto& r_ghost_nodes = r_communicator.GhostMesh().Nodes();

for (auto& p_node : rModelPart.Nodes().GetContainer()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes

I hope PointerVectorSet::GetContainer is going away, so it'd be best to think ahead and use iterators instead.

Suggested change
for (auto& p_node : rModelPart.Nodes().GetContainer()) {
for (auto it_node=rModelPart.Nodes().ptr_begin(); it_node!=rModelPart.Nodes().ptr_end(); ++it_node) {
const auto& rp_node = *it_node;

}

std::tuple<unsigned, unsigned> PartitionedModelPartIO::StartIndexAndBlockSize(std::string const& rPath) const
void PartitionedModelPartIO::SetCommunicator(ModelPart& rModelPart) const
Copy link
Contributor

@matekelemen matekelemen Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function does way more than simply setting a member variable. Ideally, the function's name should reflect this, but at the very least it should be documented.

Comment on lines +101 to 104
if (mpFile->GetTotalProcesses() == 1) {
KRATOS_ERROR << "Using PartitionedModelPartIO with single process file access." << std::endl;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this actually a problem?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It hangs (used to, haven't checked recently).

Comment on lines +122 to +124
block_for_each(r_nodes, [my_pid](auto& rNode) {
rNode.FastGetSolutionStepValue(PARTITION_INDEX) = my_pid;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this include the ghost nodes? If yes, then we're doing unnecessary communication here.

@sunethwarna sunethwarna requested a review from matekelemen June 24, 2025 13:49
@sunethwarna sunethwarna merged commit 61ab01f into master Aug 12, 2025
10 checks passed
@sunethwarna sunethwarna deleted the hdf5/update/model_part_io branch August 12, 2025 11:39
@github-project-automation github-project-automation bot moved this from In progress to Done in HDF5Application Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants