Commit e9d8f0b9 by David Moxey

Fix warning arising from CommDataType

1 parent 5c6d11eb
......@@ -82,27 +82,59 @@ int CommDataTypeGetSize(CommDataType dt)
#endif
}
/// Type trait mapping an int to MPI_INT
template <> CommDataType CommDataTypeTraits<int>::type = MPI_INT;
/// Type trait mapping an unsigned int to MPI_UNSIGNED
template <> CommDataType CommDataTypeTraits<unsigned>::type = MPI_UNSIGNED;
/// Type trait mapping a long int to MPI_LONG
template <> CommDataType CommDataTypeTraits<long>::type = MPI_LONG;
/// Type trait mapping an unsigned long int to MPI_UNSIGNED_LONG
template <>
CommDataType CommDataTypeTraits<unsigned long>::type = MPI_UNSIGNED_LONG;
/// Type trait mapping a long long int to MPI_LONG_LONG
template <> CommDataType CommDataTypeTraits<long long>::type = MPI_LONG_LONG;
/// Type trait mapping an unsigned long long int to MPI_UNSIGNED_LONG_LONG
template <>
CommDataType CommDataTypeTraits<unsigned long long>::type =
MPI_UNSIGNED_LONG_LONG;
/// Type trait mapping a float to MPI_FLOAT
template <> CommDataType CommDataTypeTraits<float>::type = MPI_FLOAT;
/// Type trait mapping a double to MPI_DOUBLE
template <> CommDataType CommDataTypeTraits<double>::type = MPI_DOUBLE;
/// Type trait mapping a long double to MPI_LONG_DOUBLE
template <>
CommDataType CommDataTypeTraits<long double>::type = MPI_LONG_DOUBLE;
template<> CommDataType &CommDataTypeTraits<int>::GetDataType()
{
static CommDataType type = MPI_INT;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED;
return type;
}
template<> CommDataType &CommDataTypeTraits<long>::GetDataType()
{
static CommDataType type = MPI_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned long>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<long long>::GetDataType()
{
static CommDataType type = MPI_LONG_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned long long>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED_LONG_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<float>::GetDataType()
{
static CommDataType type = MPI_FLOAT;
return type;
}
template<> CommDataType &CommDataTypeTraits<double>::GetDataType()
{
static CommDataType type = MPI_DOUBLE;
return type;
}
template<> CommDataType &CommDataTypeTraits<long double>::GetDataType()
{
static CommDataType type = MPI_LONG_DOUBLE;
return type;
}
}
}
......@@ -82,13 +82,9 @@ int CommDataTypeGetSize(CommDataType);
template <class T> class CommDataTypeTraits
{
LIB_UTILITIES_EXPORT static CommDataType type;
public:
static CommDataType &GetDataType()
{
return type;
}
LIB_UTILITIES_EXPORT static CommDataType &GetDataType();
static void *GetPointer(T &val)
{
return &val;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!