From: Wolfgang Bangerth Date: Tue, 1 Mar 2022 21:23:09 +0000 (-0700) Subject: Add a test. X-Git-Tag: v9.4.0-rc1~411^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2be6b3fd447b7feb4ef11ff856689e952a75f7b1;p=dealii.git Add a test. --- diff --git a/tests/mpi/is_mpi_type.cc b/tests/mpi/is_mpi_type.cc new file mode 100644 index 0000000000..1864c8970c --- /dev/null +++ b/tests/mpi/is_mpi_type.cc @@ -0,0 +1,67 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + +// Test the Utilities::MPI::is_mpi_type template variable. + +#include + +#include "../tests.h" + +using namespace dealii; + +void +test() +{ + deallog << std::boolalpha; + + // Verify that the following types are all supported: + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + deallog << Utilities::MPI::is_mpi_type> << std::endl; + deallog << Utilities::MPI::is_mpi_type> << std::endl; + deallog + << Utilities::MPI::is_mpi_type> << std::endl; + deallog << Utilities::MPI::is_mpi_type << std::endl; + + + // Then also check a non-native type: + struct X + {}; + deallog << Utilities::MPI::is_mpi_type << std::endl; +} + + +int +main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + MPILogInitAll all; + + test(); +} diff --git a/tests/mpi/is_mpi_type.output b/tests/mpi/is_mpi_type.output new file mode 100644 index 0000000000..3dd6a513b6 --- /dev/null +++ b/tests/mpi/is_mpi_type.output @@ -0,0 +1,21 @@ + +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::true +DEAL:0::false