Skip to content
Snippets Groups Projects
Commit fda342f7 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge branch 'SmallImprovementsInNodePartitionedMeshReader' into 'master'

[MeL/IO/MPI_IO] Tiny improvements in NodePartitionedMeshReader

See merge request ogs/ogs!4527
parents 87e3cf1a cf0a028a
No related branches found
No related tags found
No related merge requests found
...@@ -77,8 +77,6 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::read( ...@@ -77,8 +77,6 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::read(
BaseLib::RunTime timer; BaseLib::RunTime timer;
timer.start(); timer.start();
MeshLib::NodePartitionedMesh* mesh = nullptr;
// Always try binary file first // Always try binary file first
std::string const fname_new = file_name_base + "_partitioned_msh_cfg" + std::string const fname_new = file_name_base + "_partitioned_msh_cfg" +
std::to_string(_mpi_comm_size) + ".bin"; std::to_string(_mpi_comm_size) + ".bin";
...@@ -99,7 +97,8 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::read( ...@@ -99,7 +97,8 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::read(
INFO("Reading corresponding part of mesh data from binary file {:s} ...", INFO("Reading corresponding part of mesh data from binary file {:s} ...",
file_name_base); file_name_base);
mesh = readMesh(file_name_base);
MeshLib::NodePartitionedMesh* mesh = readMesh(file_name_base);
INFO("[time] Reading the mesh took {:f} s.", timer.elapsed()); INFO("[time] Reading the mesh took {:f} s.", timer.elapsed());
...@@ -154,6 +153,8 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::readMesh( ...@@ -154,6 +153,8 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::readMesh(
const std::string fname_header = file_name_base + "_partitioned_msh_"; const std::string fname_header = file_name_base + "_partitioned_msh_";
const std::string fname_num_p_ext = std::to_string(_mpi_comm_size) + ".bin"; const std::string fname_num_p_ext = std::to_string(_mpi_comm_size) + ".bin";
// Read the config meta data from *cfg* file into struct PartitionedMeshInfo
// _mesh_info
if (!readDataFromFile( if (!readDataFromFile(
fname_header + "cfg" + fname_num_p_ext, fname_header + "cfg" + fname_num_p_ext,
static_cast<MPI_Offset>(static_cast<unsigned>(_mpi_rank) * static_cast<MPI_Offset>(static_cast<unsigned>(_mpi_rank) *
...@@ -277,9 +278,8 @@ void NodePartitionedMeshReader::readProperties( ...@@ -277,9 +278,8 @@ void NodePartitionedMeshReader::readProperties(
"Could not read the partition meta data for the mpi process {:d}", "Could not read the partition meta data for the mpi process {:d}",
_mpi_rank); _mpi_rank);
} }
DBUG("[{:d}] offset in the PropertyVector: {:d}", _mpi_rank, pvpmd->offset); DBUG("offset in the PropertyVector: {:d}", pvpmd->offset);
DBUG("[{:d}] {:d} tuples in partition.", _mpi_rank, DBUG("{:d} tuples in partition.", pvpmd->number_of_tuples);
pvpmd->number_of_tuples);
is.close(); is.close();
const std::string fname_val = file_name_base + "_partitioned_" + item_type + const std::string fname_val = file_name_base + "_partitioned_" + item_type +
...@@ -309,12 +309,10 @@ void NodePartitionedMeshReader::readDomainSpecificPartOfPropertyVectors( ...@@ -309,12 +309,10 @@ void NodePartitionedMeshReader::readDomainSpecificPartOfPropertyVectors(
std::size_t const number_of_properties = vec_pvmd.size(); std::size_t const number_of_properties = vec_pvmd.size();
for (std::size_t i(0); i < number_of_properties; ++i) for (std::size_t i(0); i < number_of_properties; ++i)
{ {
DBUG( DBUG("global offset: {:d}, offset within the PropertyVector: {:d}.",
"[{:d}] global offset: {:d}, offset within the PropertyVector: " global_offset,
"{:d}.", global_offset + pvpmd.offset * vec_pvmd[i]->number_of_components *
_mpi_rank, global_offset, vec_pvmd[i]->data_type_size_in_bytes);
global_offset + pvpmd.offset * vec_pvmd[i]->number_of_components *
vec_pvmd[i]->data_type_size_in_bytes);
// Special field data such as OGS_VERSION, IntegrationPointMetaData, // Special field data such as OGS_VERSION, IntegrationPointMetaData,
// etc., which are not "real" integration points, are copied "as is" // etc., which are not "real" integration points, are copied "as is"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment