Loading src/TNL/Communicators/MpiCommunicator.h +15 −10 Original line number Diff line number Diff line Loading @@ -580,6 +580,11 @@ template<> struct MPITypeResolver<long double> { static inline MPI_Datatype getType(){return MPI_LONG_DOUBLE;}; }; template<> struct MPITypeResolver< bool > { static inline MPI_Datatype getType(){return MPI_C_BOOL;}; }; #endif } // namespace <unnamed> Loading src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h +8 −8 Original line number Diff line number Diff line Loading @@ -26,16 +26,16 @@ namespace DistributedMeshes { enum DistrGridIOTypes { Dummy = 0 , LocalCopy = 1, MpiIO=2 }; template<typename MeshFunctionType, template< typename MeshFunction, DistrGridIOTypes type = LocalCopy, typename Device=typename MeshFunctionType::DeviceType> typename Mesh = typename MeshFunction::MeshType, typename Device = typename MeshFunction::DeviceType > class DistributedGridIO { }; template<typename MeshFunctionType, typename Device> class DistributedGridIO<MeshFunctionType,Dummy,Device> template< typename MeshFunctionType > class DistributedGridIO< MeshFunctionType, Dummy > { bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading src/TNL/Meshes/DistributedMeshes/DistributedGridIO_MeshFunction.h +112 −100 Original line number Diff line number Diff line Loading @@ -21,16 +21,22 @@ namespace DistributedMeshes { * This variant cerate copy of MeshFunction but smaller, reduced to local entities, without overlap. * It is slow and has high RAM consumption */ template<typename MeshType, typename Device> class DistributedGridIO<Functions::MeshFunction<MeshType>,LocalCopy,Device> template< typename MeshFunction, int Dimension, typename Real, typename Device, typename Index > class DistributedGridIO< MeshFunction, LocalCopy, Meshes::Grid< Dimension, Real, Device, Index >, Device > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; typedef typename MeshFunctionType::MeshType::CoordinatesType CoordinatesType; typedef typename MeshFunctionType::MeshType::PointType PointType; typedef typename MeshFunctionType::VectorType VectorType; using MeshType = Meshes::Grid< Dimension, Real, Device, Index >; using MeshFunctionType = MeshFunction; using CoordinatesType = typename MeshFunctionType::MeshType::CoordinatesType; using PointType = typename MeshFunctionType::MeshType::PointType; using VectorType = typename MeshFunctionType::VectorType; //typedef DistributedGrid< MeshType,MeshFunctionType::getMeshDimension()> DistributedGridType; static bool save(const String& fileName, MeshFunctionType &meshFunction) Loading Loading @@ -424,11 +430,17 @@ class DistributedGridIO_MPIIOBase }; #endif template<typename MeshType> class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cuda> template< typename MeshFunction, int Dimension, typename Real, typename Index > class DistributedGridIO< MeshFunction, MpiIO, Meshes::Grid< Dimension, Real, Devices::Cuda, Index >, Devices::Cuda > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; using MeshFunctionType = MeshFunction; static bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading @@ -444,7 +456,6 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cu #endif std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; static bool load(const String& fileName,MeshFunctionType &meshFunction) Loading @@ -464,15 +475,19 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cu std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; }; template<typename MeshType> class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Host> template< typename MeshFunction, int Dimension, typename Real, typename Index > class DistributedGridIO< MeshFunction, MpiIO, Meshes::Grid< Dimension, Real, Devices::Host, Index >, Devices::Host > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; using MeshFunctionType = MeshFunction; static bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading @@ -485,7 +500,6 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Ho #endif std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; static bool load(const String& fileName,MeshFunctionType &meshFunction) Loading @@ -500,10 +514,8 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Ho std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; }; } } } } //namespace DistributedMeshes } //namespace Meshes } //namespace TNL Loading
src/TNL/Communicators/MpiCommunicator.h +15 −10 Original line number Diff line number Diff line Loading @@ -580,6 +580,11 @@ template<> struct MPITypeResolver<long double> { static inline MPI_Datatype getType(){return MPI_LONG_DOUBLE;}; }; template<> struct MPITypeResolver< bool > { static inline MPI_Datatype getType(){return MPI_C_BOOL;}; }; #endif } // namespace <unnamed> Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h +8 −8 Original line number Diff line number Diff line Loading @@ -26,16 +26,16 @@ namespace DistributedMeshes { enum DistrGridIOTypes { Dummy = 0 , LocalCopy = 1, MpiIO=2 }; template<typename MeshFunctionType, template< typename MeshFunction, DistrGridIOTypes type = LocalCopy, typename Device=typename MeshFunctionType::DeviceType> typename Mesh = typename MeshFunction::MeshType, typename Device = typename MeshFunction::DeviceType > class DistributedGridIO { }; template<typename MeshFunctionType, typename Device> class DistributedGridIO<MeshFunctionType,Dummy,Device> template< typename MeshFunctionType > class DistributedGridIO< MeshFunctionType, Dummy > { bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridIO_MeshFunction.h +112 −100 Original line number Diff line number Diff line Loading @@ -21,16 +21,22 @@ namespace DistributedMeshes { * This variant cerate copy of MeshFunction but smaller, reduced to local entities, without overlap. * It is slow and has high RAM consumption */ template<typename MeshType, typename Device> class DistributedGridIO<Functions::MeshFunction<MeshType>,LocalCopy,Device> template< typename MeshFunction, int Dimension, typename Real, typename Device, typename Index > class DistributedGridIO< MeshFunction, LocalCopy, Meshes::Grid< Dimension, Real, Device, Index >, Device > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; typedef typename MeshFunctionType::MeshType::CoordinatesType CoordinatesType; typedef typename MeshFunctionType::MeshType::PointType PointType; typedef typename MeshFunctionType::VectorType VectorType; using MeshType = Meshes::Grid< Dimension, Real, Device, Index >; using MeshFunctionType = MeshFunction; using CoordinatesType = typename MeshFunctionType::MeshType::CoordinatesType; using PointType = typename MeshFunctionType::MeshType::PointType; using VectorType = typename MeshFunctionType::VectorType; //typedef DistributedGrid< MeshType,MeshFunctionType::getMeshDimension()> DistributedGridType; static bool save(const String& fileName, MeshFunctionType &meshFunction) Loading Loading @@ -424,11 +430,17 @@ class DistributedGridIO_MPIIOBase }; #endif template<typename MeshType> class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cuda> template< typename MeshFunction, int Dimension, typename Real, typename Index > class DistributedGridIO< MeshFunction, MpiIO, Meshes::Grid< Dimension, Real, Devices::Cuda, Index >, Devices::Cuda > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; using MeshFunctionType = MeshFunction; static bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading @@ -444,7 +456,6 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cu #endif std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; static bool load(const String& fileName,MeshFunctionType &meshFunction) Loading @@ -464,15 +475,19 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Cu std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; }; template<typename MeshType> class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Host> template< typename MeshFunction, int Dimension, typename Real, typename Index > class DistributedGridIO< MeshFunction, MpiIO, Meshes::Grid< Dimension, Real, Devices::Host, Index >, Devices::Host > { public: typedef typename Functions::MeshFunction<MeshType> MeshFunctionType; using MeshFunctionType = MeshFunction; static bool save(const String& fileName, MeshFunctionType &meshFunction) { Loading @@ -485,7 +500,6 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Ho #endif std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; static bool load(const String& fileName,MeshFunctionType &meshFunction) Loading @@ -500,10 +514,8 @@ class DistributedGridIO<Functions::MeshFunction<MeshType>,MpiIO,TNL::Devices::Ho std::cout << "MPIIO can be used only with MPICommunicator." << std::endl; return false; }; }; } } } } //namespace DistributedMeshes } //namespace Meshes } //namespace TNL