Commit 1f12814c authored by gbalduzz's avatar gbalduzz
Browse files

Remove switch on MPI_Datatype

parent c03223a9
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -591,17 +591,16 @@ void MPICollectiveSum::delayedSum(T* in, std::size_t n) {

// TODO: move to .cpp file.
inline void MPICollectiveSum::resolveSums() {
  switch (current_type_) {
    case MPI_DOUBLE:
  // Note: we can not use a switch statement as MPI_Datatype is not integer on the Summit system.
  if (current_type_ == MPI_DOUBLE)
    return resolveSumsImplementation<double>();
    case MPI_FLOAT:
  else if (current_type_ == MPI_FLOAT)
    return resolveSumsImplementation<float>();
    case MPI_UNSIGNED_LONG:
  else if (current_type_ == MPI_UNSIGNED_LONG)
    return resolveSumsImplementation<unsigned long int>();
    default:
  else
    throw(std::logic_error("Type not supported."));
}
}

template <typename T>
inline void MPICollectiveSum::resolveSumsImplementation() {