Commit 0742d2a2 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

MPI refactoring: replaced MPIDimsCreateError with std::logic_error

parent b8ae1e27
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#include <TNL/MPI/DummyDefs.h>
#include <TNL/MPI/Utils.h>
#include <TNL/MPI/Config.h>
#include <TNL/Exceptions/MPIDimsCreateError.h>

namespace TNL {
//! \brief Namespace for TNL communicators.
@@ -189,7 +188,9 @@ class MpiCommunicator
            prod *= distr[ i ];
         }
         if( prod != 0 && prod != GetSize( AllGroup ) )
            throw Exceptions::MPIDimsCreateError();
            throw std::logic_error( "The program tries to call MPI_Dims_create with wrong dimensions."
                                    "Non of the dimensions is zero and product of all dimensions does "
                                    "not fit with number of MPI processes." );
         if(sum==0) {
            for(int i=0;i<dim-1;i++)
               distr[i]=1;
+0 −28
Original line number Diff line number Diff line
/***************************************************************************
                          MPIDimsCreateError.h  -  description
                             -------------------
    begin                : Jan 30, 2019
    copyright            : (C) 2019 by Tomas Oberhuber et al.
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/* See Copyright Notice in tnl/Copyright */

#pragma once

#include <stdexcept>

namespace TNL {
namespace Exceptions {

struct MPIDimsCreateError
   : public std::runtime_error
{
   MPIDimsCreateError()
   : std::runtime_error( "The program tries to call MPI_Dims_create with wrong dimensions."
                         "Non of the dimensions is zero and product of all dimensions does not fit with number of MPI processes." )
   {}
};

} // namespace Exceptions
} // namespace TNL