Skip to content
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

[Core][MPI] Minor fix in STL IO in MPI write #11656

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions kratos/input_output/stl_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ void StlIO::WriteEntityBlockMPI(
<< "Model part contained " << converted_num_degenerate_geometries
<< " geometries with area = 0.0, skipping these geometries." << std::endl;

// Getting number of entities
std::size_t number_of_entities = rThisEntities.size();
number_of_entities = rDataCommunicator.SumAll(number_of_entities);

// Retrieve rank and pass to rank 0
if (rThisEntities.size() > 0) {
if (number_of_entities > 0) {
const int rank = rDataCommunicator.Rank();
const int tag = 0;
if (rank == 0) {
Expand Down Expand Up @@ -278,8 +282,12 @@ void StlIO::WriteGeometryBlockMPI(
<< "Model part contained " << converted_num_degenerate_geometries
<< " geometries with area = 0.0, skipping these geometries." << std::endl;

// Getting number of entities
std::size_t number_of_geometries = rThisGeometries.size();
number_of_geometries = rDataCommunicator.SumAll(number_of_geometries);

// Retrieve rank and pass to rank 0
if (rThisGeometries.size() > 0) {
if (number_of_geometries > 0) {
const int rank = rDataCommunicator.Rank();
const int tag = 0;
if (rank == 0) {
Expand Down