Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana_Grid_MpiTraits.hpp
Go to the documentation of this file.
1/****************************************************************************
2 * Copyright (c) 2018-2023 by the Cabana authors *
3 * All rights reserved. *
4 * *
5 * This file is part of the Cabana library. Cabana is distributed under a *
6 * BSD 3-clause license. For the licensing terms see the LICENSE file in *
7 * the top-level directory. *
8 * *
9 * SPDX-License-Identifier: BSD-3-Clause *
10 ****************************************************************************/
11
16#ifndef CABANA_GRID_MPITRAITS_HPP
17#define CABANA_GRID_MPITRAITS_HPP
18
19#include <Kokkos_Core.hpp>
20
21#include <mpi.h>
22
23namespace Cabana
24{
25namespace Grid
26{
27
28//---------------------------------------------------------------------------//
31template <typename T>
32struct MpiTraits;
33
35template <>
36struct MpiTraits<char>
37{
39 static MPI_Datatype type() { return MPI_CHAR; }
40};
41
43template <>
44struct MpiTraits<int>
45{
47 static MPI_Datatype type() { return MPI_INT; }
48};
49
51template <>
52struct MpiTraits<long>
53{
55 static MPI_Datatype type() { return MPI_LONG; }
56};
57
59template <>
60struct MpiTraits<float>
61{
63 static MPI_Datatype type() { return MPI_FLOAT; }
64};
65
67template <>
68struct MpiTraits<double>
69{
71 static MPI_Datatype type() { return MPI_DOUBLE; }
72};
73
74//---------------------------------------------------------------------------//
75
76} // namespace Grid
77} // namespace Cabana
78
79#endif // end CABANA_GRID_MPITRAITS_HPP
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
static MPI_Datatype type()
MPI char type.
Definition Cabana_Grid_MpiTraits.hpp:39
static MPI_Datatype type()
MPI double type.
Definition Cabana_Grid_MpiTraits.hpp:71
static MPI_Datatype type()
MPI float type.
Definition Cabana_Grid_MpiTraits.hpp:63
static MPI_Datatype type()
MPI int type.
Definition Cabana_Grid_MpiTraits.hpp:47
static MPI_Datatype type()
MPI long type.
Definition Cabana_Grid_MpiTraits.hpp:55
Definition Cabana_Grid_MpiTraits.hpp:32