Loading src/TNL/Communicators/CMakeLists.txt +3 −1 Original line number Diff line number Diff line SET( headers MpiCommunicator.h NoDistrCommunicator.h ) MpiDefs.h NoDistrCommunicator.h ) INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Communicators ) src/TNL/Communicators/MpiCommunicator.h +42 −35 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <TNL/String.h> #include <TNL/Logger.h> #include <TNL/Communicators/MpiDefs.h> #include <TNL/Config/ConfigDescription.h> #include <TNL/Exceptions/MPISupportMissing.h> namespace TNL { namespace Communicators { Loading Loading @@ -138,8 +140,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Get_rank(); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif }; Loading @@ -149,8 +150,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Get_size(); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif }; Loading Loading @@ -185,7 +185,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::COMM_WORLD.Barrier();; #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif }; Loading @@ -196,8 +196,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Isend((void*) data, count, MPIDataType(data) , dest, 0); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif } Loading @@ -208,8 +207,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Irecv((void*) data, count, MPIDataType(data) , src, 0); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif } Loading @@ -219,9 +217,8 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::Request::Waitall(length, reqs); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif }; template< typename T > Loading @@ -231,7 +228,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::COMM_WORLD.Bcast((void*) &data, count, MPIDataType(data), root); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif } Loading @@ -241,9 +238,14 @@ class MpiCommunicator int count, const MPI_Op &op ) { #ifdef HAVE_MPI MPI::COMM_WORLD.Allreduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op); #else throw Exceptions::MPISupportMissing(); #endif }; template< typename T > static void Reduce( T* data, T* reduced_data, Loading @@ -251,9 +253,14 @@ class MpiCommunicator MPI_Op &op, int root) { #ifdef HAVE_MPI MPI::COMM_WORLD.Reduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op,root); #else throw Exceptions::MPISupportMissing(); #endif }; static void writeProlog( Logger& logger ) { if( isDistributed() ) Loading src/TNL/Communicators/MpiDefs.h 0 → 100644 +15 −0 Original line number Diff line number Diff line /*************************************************************************** MpiCommunicator.h - description ------------------- begin : 2005/04/23 copyright : (C) 2005 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #pragma once #ifndef HAVE_MPI enum MPI_Op { MPI_SUM, MPI_MAX }; #endif No newline at end of file src/TNL/Communicators/NoDistrCommunicator.h +1 −2 Original line number Diff line number Diff line Loading @@ -11,11 +11,10 @@ #pragma once #include <TNL/Logger.h> #include <TNL/Communicators/MpiDefs.h> #ifdef HAVE_MPI #include <mpi.h> #else enum MPI_Op { MPI_SUM, MPI_MAX }; #endif namespace TNL { Loading src/TNL/Exceptions/CMakeLists.txt +2 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ SET( headers CudaBadAlloc.h CudaRuntimeError.h CudaSupportMissing.h MICBadAlloc.h MICSupportMissing.h ) MICSupportMissing.h MPISupportMissing.h ) INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Exceptions ) Loading
src/TNL/Communicators/CMakeLists.txt +3 −1 Original line number Diff line number Diff line SET( headers MpiCommunicator.h NoDistrCommunicator.h ) MpiDefs.h NoDistrCommunicator.h ) INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Communicators )
src/TNL/Communicators/MpiCommunicator.h +42 −35 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <TNL/String.h> #include <TNL/Logger.h> #include <TNL/Communicators/MpiDefs.h> #include <TNL/Config/ConfigDescription.h> #include <TNL/Exceptions/MPISupportMissing.h> namespace TNL { namespace Communicators { Loading Loading @@ -138,8 +140,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Get_rank(); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif }; Loading @@ -149,8 +150,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Get_size(); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif }; Loading Loading @@ -185,7 +185,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::COMM_WORLD.Barrier();; #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif }; Loading @@ -196,8 +196,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Isend((void*) data, count, MPIDataType(data) , dest, 0); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif } Loading @@ -208,8 +207,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); return MPI::COMM_WORLD.Irecv((void*) data, count, MPIDataType(data) , src, 0); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); return 0; throw Exceptions::MPISupportMissing(); #endif } Loading @@ -219,9 +217,8 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::Request::Waitall(length, reqs); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif }; template< typename T > Loading @@ -231,7 +228,7 @@ class MpiCommunicator TNL_ASSERT_TRUE(IsInitialized(), "Fatal Error - MPI communicator is not inicialized"); MPI::COMM_WORLD.Bcast((void*) &data, count, MPIDataType(data), root); #else TNL_ASSERT_TRUE(false, "Fatal Error - MPI in not compiled"); throw Exceptions::MPISupportMissing(); #endif } Loading @@ -241,9 +238,14 @@ class MpiCommunicator int count, const MPI_Op &op ) { #ifdef HAVE_MPI MPI::COMM_WORLD.Allreduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op); #else throw Exceptions::MPISupportMissing(); #endif }; template< typename T > static void Reduce( T* data, T* reduced_data, Loading @@ -251,9 +253,14 @@ class MpiCommunicator MPI_Op &op, int root) { #ifdef HAVE_MPI MPI::COMM_WORLD.Reduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op,root); #else throw Exceptions::MPISupportMissing(); #endif }; static void writeProlog( Logger& logger ) { if( isDistributed() ) Loading
src/TNL/Communicators/MpiDefs.h 0 → 100644 +15 −0 Original line number Diff line number Diff line /*************************************************************************** MpiCommunicator.h - description ------------------- begin : 2005/04/23 copyright : (C) 2005 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #pragma once #ifndef HAVE_MPI enum MPI_Op { MPI_SUM, MPI_MAX }; #endif No newline at end of file
src/TNL/Communicators/NoDistrCommunicator.h +1 −2 Original line number Diff line number Diff line Loading @@ -11,11 +11,10 @@ #pragma once #include <TNL/Logger.h> #include <TNL/Communicators/MpiDefs.h> #ifdef HAVE_MPI #include <mpi.h> #else enum MPI_Op { MPI_SUM, MPI_MAX }; #endif namespace TNL { Loading
src/TNL/Exceptions/CMakeLists.txt +2 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ SET( headers CudaBadAlloc.h CudaRuntimeError.h CudaSupportMissing.h MICBadAlloc.h MICSupportMissing.h ) MICSupportMissing.h MPISupportMissing.h ) INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Exceptions )