-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13473 from bangerth/is_mpi_type
- Loading branch information
Showing
5 changed files
with
172 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
New: There is now a template variable Utilities::MPI::is_mpi_type that | ||
can be used to query whether a data type is a natively supported MPI | ||
type. | ||
<br> | ||
(Wolfgang Bangerth, 2022/03/01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <deal.II/base/mpi.h> | ||
|
||
#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<char> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<signed short> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<signed int> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<signed long> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<signed long long> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<signed char> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<unsigned char> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<unsigned short> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<unsigned int> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<unsigned long int> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<unsigned long long> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<float> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<double> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<long double> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<bool> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<std::complex<float>> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<std::complex<double>> << std::endl; | ||
deallog | ||
<< Utilities::MPI::is_mpi_type<std::complex<long double>> << std::endl; | ||
deallog << Utilities::MPI::is_mpi_type<wchar_t> << std::endl; | ||
|
||
|
||
// Then also check a non-native type: | ||
struct X | ||
{}; | ||
deallog << Utilities::MPI::is_mpi_type<X> << std::endl; | ||
} | ||
|
||
|
||
int | ||
main(int argc, char *argv[]) | ||
{ | ||
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); | ||
MPILogInitAll all; | ||
|
||
test(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |