Skip to content
Snippets Groups Projects
Commit 7ff2181f authored by René Fritze's avatar René Fritze Committed by Tobias Leibner
Browse files

[test/factory] handle broken ALUgrid behaviour with non-default comms

parent 78338e34
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,10 @@ public:
const Common::Configuration config = Common::Configuration(),
MPIHelper::MPICommunicator mpi_comm = MPIHelper::getCommunicator())
{
if (is_alugrid<GridType>::value && mpi_comm != MPIHelper::getCommunicator()) {
DUNE_THROW(InvalidStateException,
"Alugrid either ignores, or outright fails with non-world comes when used here");
}
if (CubeType::static_id() == type)
return call_create<CubeType>(config, mpi_comm);
else if (DgfType::static_id() == type)
......@@ -161,6 +165,11 @@ public:
const Common::Configuration config = Common::Configuration(),
MPIHelper::MPICommunicator mpi_comm = MPIHelper::getCommunicator())
{
if (is_alugrid<GridType>::value && mpi_comm != MPIHelper::getCommunicator()) {
DUNE_THROW(InvalidStateException,
"Alugrid either ignores, or outright fails with non-world comes when used here");
}
if (CubeType::static_id() == type)
return call_create<CubeType>(config, mpi_comm);
else if (available().empty())
......
......@@ -27,7 +27,7 @@ GTEST_TEST(GridProvider_{{name}}, layers)
MPI_Comm split_comm;
MPI_Comm_split(MPI_COMM_WORLD, world_rank, world_rank, &split_comm);
{% if "cube" in type or "UGGrid" in type %}
{% if "ALU" in type or "UGGrid" in type %}
// uggrid + alu cube grids cannot handle non-default comms
EXPECT_THROW(ProviderFactory::create(config, split_comm), Dune::InvalidStateException);
return;
......
......@@ -109,7 +109,7 @@ struct grid_name<ALUGrid<dim, dim, cube, conforming, Comm>>
// not optimal
template<int dim, int dimworld, ALU3dGridElementType elType, class Comm>
template <int dim, int dimworld, ALU3dGridElementType elType, class Comm>
struct grid_name<ALU3dGrid<dim, dimworld, elType, Comm>>
{
static std::string value()
......
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