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] Update test suite for DistributedVectorExporter #11173

Merged
merged 8 commits into from
Sep 20, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ KRATOS_DISTRIBUTED_TEST_CASE_IN_SUITE(DistributedVectorExporter, KratosMPICoreFa

IndexType total_size =numbering.Size();
DistributedSystemVector<double,IndexType> x(numbering);
x.SetValue(0.0);

//test exporting
std::vector<IndexType> indices_to_export;
Expand All @@ -51,10 +52,10 @@ KRATOS_DISTRIBUTED_TEST_CASE_IN_SUITE(DistributedVectorExporter, KratosMPICoreFa
if(x.GetNumbering().IsLocal(0))
Copy link
Member

Choose a reason for hiding this comment

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

I took a quick look into this, and my impression is that x is not initialized ... so it addes the 5,9,15 to a vector that may contain anything...

KRATOS_EXPECT_NEAR(x[x.GetNumbering().LocalId(0)], 5.0, 1e-14);
// TODO: These checks are failing, to be fixed by @riccardorossi
// if(x.GetNumbering().IsLocal(total_size/2))
// KRATOS_EXPECT_NEAR(x[x.GetNumbering().LocalId(total_size/2)], 9.0, 1e-14);
// if(x.GetNumbering().IsLocal(total_size-1))
// KRATOS_EXPECT_NEAR(x[x.GetNumbering().LocalId(total_size-1)], 15.0, 1e-14);
if(x.GetNumbering().IsLocal(total_size/2))
KRATOS_EXPECT_NEAR(x[x.GetNumbering().LocalId(total_size/2)], 9.0, 1e-14);
if(x.GetNumbering().IsLocal(total_size-1))
KRATOS_EXPECT_NEAR(x[x.GetNumbering().LocalId(total_size-1)], 15.0, 1e-14);
}

} // namespace Kratos::Testing