defined long long and ulonglong

This commit is contained in:
Chuntao Hong 2015-05-20 11:27:50 +08:00
parent 1582180e5b
commit 181ef47053
3 changed files with 17 additions and 5 deletions

View File

@ -183,7 +183,9 @@ enum DataType {
kLong = 4, kLong = 4,
kULong = 5, kULong = 5,
kFloat = 6, kFloat = 6,
kDouble = 7 kDouble = 7,
kLongLong = 8,
kULongLong = 9
}; };
} // namespace mpi } // namespace mpi
/*! /*!

View File

@ -27,19 +27,19 @@ inline DataType GetType<unsigned char>(void) {
return kUChar; return kUChar;
} }
template<> template<>
inline DataType GetType<int32_t>(void) { inline DataType GetType<int>(void) {
return kInt; return kInt;
} }
template<> template<>
inline DataType GetType<uint32_t>(void) { inline DataType GetType<unsigned int>(void) {
return kUInt; return kUInt;
} }
template<> template<>
inline DataType GetType<int64_t>(void) { inline DataType GetType<long>(void) {
return kLong; return kLong;
} }
template<> template<>
inline DataType GetType<uint64_t>(void) { inline DataType GetType<unsigned long>(void) {
return kULong; return kULong;
} }
template<> template<>
@ -50,6 +50,14 @@ template<>
inline DataType GetType<double>(void) { inline DataType GetType<double>(void) {
return kDouble; return kDouble;
} }
template<>
inline DataType GetType<long long>(void) {
return kLongLong;
}
template<>
inline DataType GetType<unsigned long long>(void) {
return kULongLong;
}
} // namespace mpi } // namespace mpi
} // namespace engine } // namespace engine

View File

@ -110,6 +110,8 @@ inline MPI::Datatype GetType(mpi::DataType dtype) {
case kULong: return MPI::UNSIGNED_LONG; case kULong: return MPI::UNSIGNED_LONG;
case kFloat: return MPI::FLOAT; case kFloat: return MPI::FLOAT;
case kDouble: return MPI::DOUBLE; case kDouble: return MPI::DOUBLE;
case kLong: return MPI::LONG_LONG;
case kULong: return MPI::UNSIGNED_LONG_LONG;
} }
utils::Error("unknown mpi::DataType"); utils::Error("unknown mpi::DataType");
return MPI::CHAR; return MPI::CHAR;