diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4de571e..9219de8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. **Fixed bugs:** - [hypre]: Correctly clear hypre solver errors +- [core]: Fix name clashing between `Move` and `Ref` APIs ([issue#12](https://github.com/arcaneframework/alien/issues/12)) **Changes:** - switch to mono-repo for all Alien related projects +- `move` api is now in `Alien::Move` namespace \ No newline at end of file diff --git a/plugins/hypre/tests/CMakeLists.txt b/plugins/hypre/tests/CMakeLists.txt index 697182b36..d4665961b 100644 --- a/plugins/hypre/tests/CMakeLists.txt +++ b/plugins/hypre/tests/CMakeLists.txt @@ -1,36 +1,22 @@ enable_testing() find_package(GTest REQUIRED) -add_executable(hypre_gtest_move main.cpp - move_use.cpp) - -target_link_libraries(hypre_gtest_move - PRIVATE GTest::GTest - PRIVATE Alien::alien_core Alien::alien_semantic_move - Alien::alien_hypre - ) - -add_executable(hypre_gtest_ref main.cpp +add_executable(hypre_gtest main.cpp + move_use.cpp ref_use.cpp) -target_link_libraries(hypre_gtest_ref +target_link_libraries(hypre_gtest PRIVATE GTest::GTest - PRIVATE Alien::alien_core Alien::alien_semantic_ref + PRIVATE Alien::alien_core Alien::alien_semantic_move + Alien::alien_semantic_ref Alien::alien_hypre ) include(LoadAlienTest) alien_test( - BENCH hypre_gtest_move - NAME use_solve_move - PROCS 2 - COMMAND hypre_gtest_move -) - -alien_test( - BENCH hypre_gtest_ref - NAME use_solve_ref + BENCH hypre_gtest + NAME use_solve PROCS 2 - COMMAND hypre_gtest_ref + COMMAND hypre_gtest ) diff --git a/plugins/hypre/tests/move_use.cpp b/plugins/hypre/tests/move_use.cpp index 9460c3e07..b9b1eec79 100644 --- a/plugins/hypre/tests/move_use.cpp +++ b/plugins/hypre/tests/move_use.cpp @@ -37,9 +37,9 @@ class SimpleLinearProblemFixtureMove : public ::testing::Test m_distribution = Alien::MatrixDistribution(size, size, m_pm.get()); - m_matrix = Alien::MatrixData(m_distribution); + m_matrix = Alien::Move::MatrixData(m_distribution); - m_rhs = Alien::VectorData(m_distribution.rowDistribution()); + m_rhs = Alien::Move::VectorData(m_distribution.rowDistribution()); } void SetUp() override @@ -50,7 +50,7 @@ class SimpleLinearProblemFixtureMove : public ::testing::Test int gsize = dist.globalRowSize(); { - Alien::DirectMatrixBuilder builder( + Alien::Move::DirectMatrixBuilder builder( std::move(m_matrix), Alien::DirectMatrixOptions::eResetAllocation); builder.reserve(3); // Réservation de 3 coefficients par ligne builder.allocate(); // Allocation de l'espace mémoire réservé @@ -67,7 +67,7 @@ class SimpleLinearProblemFixtureMove : public ::testing::Test } { - Alien::LocalVectorWriter v_build(std::move(m_rhs)); + Alien::Move::LocalVectorWriter v_build(std::move(m_rhs)); for (int i = 0 ; i < v_build.size() ; i++) { v_build[i] = 1.0; } @@ -77,8 +77,8 @@ class SimpleLinearProblemFixtureMove : public ::testing::Test public: Alien::MatrixDistribution m_distribution; - Alien::MatrixData m_matrix; - Alien::VectorData m_rhs; + Alien::Move::MatrixData m_matrix; + Alien::Move::VectorData m_rhs; private: std::unique_ptr m_pm; @@ -86,7 +86,7 @@ class SimpleLinearProblemFixtureMove : public ::testing::Test TEST_F(SimpleLinearProblemFixtureMove, SimpleSolve) { - Alien::VectorData x(m_matrix.distribution().rowDistribution()); + Alien::Move::VectorData x(m_matrix.distribution().rowDistribution()); auto solver = Alien::Hypre::LinearSolver(); @@ -95,7 +95,7 @@ TEST_F(SimpleLinearProblemFixtureMove, SimpleSolve) TEST_F(SimpleLinearProblemFixtureMove, ParametrizedSolve) { - Alien::VectorData x(m_matrix.distribution().rowDistribution()); + Alien::Move::VectorData x(m_matrix.distribution().rowDistribution()); auto options = Alien::Hypre::Options() .numIterationsMax(10) @@ -110,11 +110,11 @@ TEST_F(SimpleLinearProblemFixtureMove, ParametrizedSolve) TEST_F(SimpleLinearProblemFixtureMove, MultipleSolve) { - Alien::VectorData x(m_matrix.distribution().rowDistribution()); + Alien::Move::VectorData x(m_matrix.distribution().rowDistribution()); { // First call, should fail - Alien::LocalVectorWriter w(std::move(x)); + Alien::Move::LocalVectorWriter w(std::move(x)); for (int i = 0 ; i < w.size() ; i++) { w[i] = 1.0; } diff --git a/src/modules/movesemantic/include/alien/move/data/MatrixData.h b/src/modules/movesemantic/include/alien/move/data/MatrixData.h index 1f9c4e195..2a27cfdfd 100644 --- a/src/modules/movesemantic/include/alien/move/data/MatrixData.h +++ b/src/modules/movesemantic/include/alien/move/data/MatrixData.h @@ -43,192 +43,203 @@ class MatrixDistribution; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -//! Algebraic Matrix with internal multi-representation object. -class ALIEN_MOVESEMANTIC_EXPORT MatrixData : public IMatrix -{ - public: - typedef Real ValueType; - - public: - /*! @defgroup constructor Matrix Constructor - * @{ - */ - /*! Empty constructor - * - * This matrix must be associated with a \r Space before use. - */ - MatrixData(); - - /*! Build a new matrix from a Space - * - * \param space Domain (and Codomain) Space of the matrix. - * \param dist Parallel distribution. - * - * This matrix is directly ready to use. */ - [[deprecated]] MatrixData(const Space& space, const MatrixDistribution& dist); - /*! Build a new matrix from two Spaces - * - * \param row_space Domain Space of the matrix. - * \param col_space Codomain Space of the matrix. - * \param dist Parallel distribution. - * - * This matrix is directly ready to use. */ - [[deprecated]] MatrixData( - const Space& row_space, const Space& col_space, const MatrixDistribution& dist); - - /*! Build a new matrix from a size. - * - * Matlab-like interface, matrix is defined as a [0, n-1]x[0, n-1] array. - * \param size Number of rows and columns of the matrix. - * \param dist Parallel distribution. - * - * This matrix is ready to use on an anonymous Space. - */ - [[deprecated]] MatrixData(Integer size, const MatrixDistribution& dist); - /*! Build a new matrix from two sizes. - * - * Matlab-like interface, matrix is defined as a [0, n-1]x[0, m-1] array. - * \param row_size Number of rows of the matrix. - * \param col_size Number of rows of the matrix. - * \param dist Parallel distribution. - * - * This matrix is ready to use on an anonymous Space. - */ - [[deprecated]] MatrixData(Integer row_size, Integer col_size, const MatrixDistribution& dist); - - /*! Build a new matrix on `MatrixDistribution` -* -* \param dist Parallel distribution. -* -* This matrix is directly ready to use. */ - explicit MatrixData(const MatrixDistribution& dist); - - /*! Move constructor for Matrix - * - * @param matrix Matrix to move from. - */ - MatrixData(MatrixData&& matrix); - //! }@ - - /*! Destructor - * All internal data structures will be deleted. - */ - virtual ~MatrixData() {} - - /*! Move assignment - * \brief Move from Matrix - * - * @param matrix Matrix to move from. - */ - void operator=(MatrixData&& matrix); - - /*! Initialize a Matrix with a Space. - * - * @param space Domain and Codomain Space for the Matrix. - * @param dist Parallel Distribution. - */ - void init(const Space& space, const MatrixDistribution& dist); - - private: - MatrixData(const MatrixData&) = delete; - void operator=(const MatrixData&) = delete; - - public: - public: - /*! @defgroup block Block related API - * @{ */ - - void setBlockInfos(const Integer block_size); - void setBlockInfos(const Block* block); - void setBlockInfos(const VBlock* block); - - Block const* block() const; - VBlock const* vblock() const; - /*! }@ */ - - /*! Delete all internal data structures */ - void free(); - - /*! Clean all internal data structures. - * - * Internal data are cleared, not deleted. - */ - void clear(); - - /*! Handle for visitor pattern */ - void visit(ICopyOnWriteMatrix&) const; - - /*! @defgroup space Space related functions. - * @{ - */ - /*! Domain Space of the current matrix - * @return Domain Space. - * @throw FatalException if uninitialized. - * Call isNull before to avoid any problem. - */ - const ISpace& rowSpace() const; - /*! CoDomain Space of the current matrix - * @return CoDomain Space. - * @throw FatalException if uninitialized. - * Call isNull before to avoid any problem. - */ - const ISpace& colSpace() const; - /*! }@ */ - - /*! Parallel distribution of the Matrix. - * - * @return Parallel distribution of the Matrix. - */ - const MatrixDistribution& distribution() const; - - /*! @defgroup lock Protection functions. - * @{ - */ - /*! Lock Matrix with the caller. */ - void lock() {} - - /*! Unlock Matrix, making it available for others. */ - void unlock() {} - - /*! Test if a Matrix is locked. - * - * @return whether of not a matrix is already locked by someone. - */ - bool isLocked() const { return false; } - /*! }@ */ - - /*! @defgroup properties Algebraic properties management. - * - * Algebraic properties are designed to propagate high level information of matrix - * object. These properties can be passed to external solvers but are not designed to - * overload Alien's solver parameters. - * @{ */ - /*! Add a new property on this matrix */ - void setUserFeature(String feature); - /*! Check if a property is set. */ - bool hasUserFeature(String feature) const; - - /*! Alias on property "transposed" */ - bool isTransposed() const { return hasUserFeature("transposed"); } - - /*! Is this matrix composite ? */ - bool isComposite() const; - /* }@ */ - - public: - /*! @defgroup impl Internal data structure access. - * - * Access multi-representation object. - * @{ - */ - MultiMatrixImpl* impl(); - const MultiMatrixImpl* impl() const; - /*! } @ */ - - private: - std::shared_ptr m_impl; -}; +namespace Move { +//! Algebraic Matrix with internal multi-representation object. + class ALIEN_MOVESEMANTIC_EXPORT MatrixData : public IMatrix { + public: + typedef Real ValueType; + + public: + /*! @defgroup constructor Matrix Constructor + * @{ + */ + /*! Empty constructor + * + * This matrix must be associated with a \r Space before use. + */ + MatrixData(); + + /*! Build a new matrix from a Space + * + * \param space Domain (and Codomain) Space of the matrix. + * \param dist Parallel distribution. + * + * This matrix is directly ready to use. */ + [[deprecated]] MatrixData(const Space &space, const MatrixDistribution &dist); + + /*! Build a new matrix from two Spaces + * + * \param row_space Domain Space of the matrix. + * \param col_space Codomain Space of the matrix. + * \param dist Parallel distribution. + * + * This matrix is directly ready to use. */ + [[deprecated]] MatrixData( + const Space &row_space, const Space &col_space, const MatrixDistribution &dist); + + /*! Build a new matrix from a size. + * + * Matlab-like interface, matrix is defined as a [0, n-1]x[0, n-1] array. + * \param size Number of rows and columns of the matrix. + * \param dist Parallel distribution. + * + * This matrix is ready to use on an anonymous Space. + */ + [[deprecated]] MatrixData(Integer size, const MatrixDistribution &dist); + + /*! Build a new matrix from two sizes. + * + * Matlab-like interface, matrix is defined as a [0, n-1]x[0, m-1] array. + * \param row_size Number of rows of the matrix. + * \param col_size Number of rows of the matrix. + * \param dist Parallel distribution. + * + * This matrix is ready to use on an anonymous Space. + */ + [[deprecated]] MatrixData(Integer row_size, Integer col_size, const MatrixDistribution &dist); + + /*! Build a new matrix on `MatrixDistribution` + * + * \param dist Parallel distribution. + * + * This matrix is directly ready to use. */ + explicit MatrixData(const MatrixDistribution &dist); + + /*! Move constructor for Matrix + * + * @param matrix Matrix to move from. + */ + MatrixData(MatrixData &&matrix); + //! }@ + + /*! Destructor + * All internal data structures will be deleted. + */ + virtual ~MatrixData() {} + + /*! Move assignment + * \brief Move from Matrix + * + * @param matrix Matrix to move from. + */ + void operator=(MatrixData &&matrix); + + /*! Initialize a Matrix with a Space. + * + * @param space Domain and Codomain Space for the Matrix. + * @param dist Parallel Distribution. + */ + void init(const Space &space, const MatrixDistribution &dist); + + private: + MatrixData(const MatrixData &) = delete; + + void operator=(const MatrixData &) = delete; + + public: + public: + /*! @defgroup block Block related API + * @{ */ + + void setBlockInfos(const Integer block_size); + + void setBlockInfos(const Block *block); + + void setBlockInfos(const VBlock *block); + + Block const *block() const; + + VBlock const *vblock() const; + /*! }@ */ + + /*! Delete all internal data structures */ + void free(); + + /*! Clean all internal data structures. + * + * Internal data are cleared, not deleted. + */ + void clear(); + + /*! Handle for visitor pattern */ + void visit(ICopyOnWriteMatrix &) const; + + /*! @defgroup space Space related functions. + * @{ + */ + /*! Domain Space of the current matrix + * @return Domain Space. + * @throw FatalException if uninitialized. + * Call isNull before to avoid any problem. + */ + const ISpace &rowSpace() const; + + /*! CoDomain Space of the current matrix + * @return CoDomain Space. + * @throw FatalException if uninitialized. + * Call isNull before to avoid any problem. + */ + const ISpace &colSpace() const; + /*! }@ */ + + /*! Parallel distribution of the Matrix. + * + * @return Parallel distribution of the Matrix. + */ + const MatrixDistribution &distribution() const; + + /*! @defgroup lock Protection functions. + * @{ + */ + /*! Lock Matrix with the caller. */ + void lock() {} + + /*! Unlock Matrix, making it available for others. */ + void unlock() {} + + /*! Test if a Matrix is locked. + * + * @return whether of not a matrix is already locked by someone. + */ + bool isLocked() const { return false; } + /*! }@ */ + + /*! @defgroup properties Algebraic properties management. + * + * Algebraic properties are designed to propagate high level information of matrix + * object. These properties can be passed to external solvers but are not designed to + * overload Alien's solver parameters. + * @{ */ + /*! Add a new property on this matrix */ + void setUserFeature(String feature); + + /*! Check if a property is set. */ + bool hasUserFeature(String feature) const; + + /*! Alias on property "transposed" */ + bool isTransposed() const { return hasUserFeature("transposed"); } + + /*! Is this matrix composite ? */ + bool isComposite() const; + /* }@ */ + + public: + /*! @defgroup impl Internal data structure access. + * + * Access multi-representation object. + * @{ + */ + MultiMatrixImpl *impl(); + + const MultiMatrixImpl *impl() const; + /*! } @ */ + + private: + std::shared_ptr m_impl; + }; + +} // namespace Move /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/data/VectorData.h b/src/modules/movesemantic/include/alien/move/data/VectorData.h index 8c63cfb65..689e1e0a6 100644 --- a/src/modules/movesemantic/include/alien/move/data/VectorData.h +++ b/src/modules/movesemantic/include/alien/move/data/VectorData.h @@ -40,147 +40,156 @@ class VectorDistribution; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ +namespace Move { + //! Algebraic Vector with internal multi-representation object. -class ALIEN_MOVESEMANTIC_EXPORT VectorData : public IVector -{ - public: - typedef Real ValueType; - - public: - /*! @defgroup constructor Vector Constructor - * @{ - */ - /*! Empty constructor - * - * This vector must be associated with a Space before use. - */ - VectorData(); - - /*! Build a new Vector from a Space - * - * \param space Definition Space of the Vector. - * \param dist Parallel distribution. - * - * This vector is directly ready to use. - * - * \see VectorData::VectorData(const VectorDistribution&). - * */ - [[deprecated]] VectorData(const ISpace& space, const VectorDistribution& dist); - - /*! Build a new Vector from a size. - * - * Matlab-like interface, Vector is defined as a [0, n-1] array. - * \param size Number of elements of the vector. - * \param dist Parallel distribution. - * - * This vector is ready to use on an anonymous Space. - * - * \see VectorData::VectorData(const VectorDistribution&). - */ - [[deprecated]] VectorData(Integer size, const VectorDistribution& dist); - - /*! Build a new Vector from a Space - * - * \param space Definition Space of the Vector. - * \param dist Parallel distribution. - * - * This vector is directly ready to use. */ - VectorData(const VectorDistribution& dist); - - /*! Move constructor for Vector - * - * @param vector Vector to move from. - */ - VectorData(VectorData&& vector); - /*! }@ */ - - /*! Destructor - * All internal data structures will be deleted. - */ - virtual ~VectorData(); - - /*! Move assignment - * \brief Move from Vector - * - * @param matrix Vector to move from. - */ - void operator=(VectorData&& vector); - - /*! Initialize a Vector with a Space. - * - * @param space Definition Space. - * @param dist Parallel Distribution. - */ - void init(const ISpace& space, const VectorDistribution& dist); - - VectorData(const VectorData&) = delete; - void operator=(const VectorData&) = delete; - - public: - /*! @defgroup block Block related API - * @{ */ - void setBlockInfos(const Integer block_size); - // void setBlockInfos(const IBlockBuilder& block_size); - void setBlockInfos(const Block* block); - void setBlockInfos(const VBlock* block); - - const Block* block() const; - const VBlock* vblock() const; - /*! }@ */ - - /*! Delete all internal data structures */ - void free(); - - /*! Clean all internal data structures. - * - * Internal data are cleared, not deleted. - */ - void clear(); - - /*! Handle for visitor pattern */ - void visit(ICopyOnWriteVector&) const; - - /*! @defgroup space Space related functions. - * @{ - */ - /*! Domain Space of the current vector - * @return Definition Space. - * @throw FatalException if uninitialized. - * Call isNull before to avoid any problem. - */ - const ISpace& space() const; - - /*! Parallel distribution of the Vector. - * - * @return Parallel distribution of the Vector. - */ - const VectorDistribution& distribution() const; - - /*! @defgroup properties Algebraic properties management. - * - * Algebraic properties are designed to propagate high level information of matrix - * object. These properties can be passed to external solvers but are not designed to - * overload Alien's solver parameters. - * @{ */ - /*! Add a new property on this vector */ - void setUserFeature(String feature); - /*! Check if a property is set. */ - bool hasUserFeature(String feature) const; - /*! }@ */ - - public: - /*! @defgroup impl Internal data structure access. - * - * Access multi-representation object. - * @{ - */ - MultiVectorImpl* impl(); - const MultiVectorImpl* impl() const; - /*! }@ */ - - private: - std::shared_ptr m_impl; -}; + class ALIEN_MOVESEMANTIC_EXPORT VectorData : public IVector { + public: + typedef Real ValueType; + + public: + /*! @defgroup constructor Vector Constructor + * @{ + */ + /*! Empty constructor + * + * This vector must be associated with a Space before use. + */ + VectorData(); + + /*! Build a new Vector from a Space + * + * \param space Definition Space of the Vector. + * \param dist Parallel distribution. + * + * This vector is directly ready to use. + * + * \see VectorData::VectorData(const VectorDistribution&). + * */ + [[deprecated]] VectorData(const ISpace &space, const VectorDistribution &dist); + + /*! Build a new Vector from a size. + * + * Matlab-like interface, Vector is defined as a [0, n-1] array. + * \param size Number of elements of the vector. + * \param dist Parallel distribution. + * + * This vector is ready to use on an anonymous Space. + * + * \see VectorData::VectorData(const VectorDistribution&). + */ + [[deprecated]] VectorData(Integer size, const VectorDistribution &dist); + + /*! Build a new Vector from a Space + * + * \param space Definition Space of the Vector. + * \param dist Parallel distribution. + * + * This vector is directly ready to use. */ + VectorData(const VectorDistribution &dist); + + /*! Move constructor for Vector + * + * @param vector Vector to move from. + */ + VectorData(VectorData &&vector); + /*! }@ */ + + /*! Destructor + * All internal data structures will be deleted. + */ + virtual ~VectorData(); + + /*! Move assignment + * \brief Move from Vector + * + * @param matrix Vector to move from. + */ + void operator=(VectorData &&vector); + + /*! Initialize a Vector with a Space. + * + * @param space Definition Space. + * @param dist Parallel Distribution. + */ + void init(const ISpace &space, const VectorDistribution &dist); + + VectorData(const VectorData &) = delete; + + void operator=(const VectorData &) = delete; + + public: + /*! @defgroup block Block related API + * @{ */ + void setBlockInfos(const Integer block_size); + + // void setBlockInfos(const IBlockBuilder& block_size); + void setBlockInfos(const Block *block); + + void setBlockInfos(const VBlock *block); + + const Block *block() const; + + const VBlock *vblock() const; + /*! }@ */ + + /*! Delete all internal data structures */ + void free(); + + /*! Clean all internal data structures. + * + * Internal data are cleared, not deleted. + */ + void clear(); + + /*! Handle for visitor pattern */ + void visit(ICopyOnWriteVector &) const; + + /*! @defgroup space Space related functions. + * @{ + */ + /*! Domain Space of the current vector + * @return Definition Space. + * @throw FatalException if uninitialized. + * Call isNull before to avoid any problem. + */ + const ISpace &space() const; + + /*! Parallel distribution of the Vector. + * + * @return Parallel distribution of the Vector. + */ + const VectorDistribution &distribution() const; + + /*! @defgroup properties Algebraic properties management. + * + * Algebraic properties are designed to propagate high level information of matrix + * object. These properties can be passed to external solvers but are not designed to + * overload Alien's solver parameters. + * @{ */ + /*! Add a new property on this vector */ + void setUserFeature(String feature); + + /*! Check if a property is set. */ + bool hasUserFeature(String feature) const; + /*! }@ */ + + public: + /*! @defgroup impl Internal data structure access. + * + * Access multi-representation object. + * @{ + */ + MultiVectorImpl *impl(); + + const MultiVectorImpl *impl() const; + /*! }@ */ + + private: + std::shared_ptr m_impl; + }; + +} // namespace Move /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorReader.h b/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorReader.h index 941d44804..1523867a1 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorReader.h +++ b/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorReader.h @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorWriter.h b/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorWriter.h index 151f2b6b3..8b658df18 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorWriter.h +++ b/src/modules/movesemantic/include/alien/move/handlers/block/BlockVectorWriter.h @@ -26,7 +26,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/block/ProfiledBlockMatrixBuilder.h b/src/modules/movesemantic/include/alien/move/handlers/block/ProfiledBlockMatrixBuilder.h index a51f06ef1..4e4786589 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/block/ProfiledBlockMatrixBuilder.h +++ b/src/modules/movesemantic/include/alien/move/handlers/block/ProfiledBlockMatrixBuilder.h @@ -26,7 +26,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/scalar/DirectMatrixBuilder.h b/src/modules/movesemantic/include/alien/move/handlers/scalar/DirectMatrixBuilder.h index 929971530..2decb995e 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/scalar/DirectMatrixBuilder.h +++ b/src/modules/movesemantic/include/alien/move/handlers/scalar/DirectMatrixBuilder.h @@ -26,7 +26,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ @@ -39,7 +39,7 @@ class DirectMatrixBuilder : protected MoveObject using Common::DirectMatrixBuilder::ReserveFlag; using Common::DirectMatrixBuilder::ResetFlag; using Common::DirectMatrixBuilder::SymmetricFlag; - + DirectMatrixBuilder(MatrixData&& matrix, const ResetFlag reset_flag, const SymmetricFlag symmetric_flag = SymmetricFlag::eSymmetric) : MoveObject(std::move(matrix)) diff --git a/src/modules/movesemantic/include/alien/move/handlers/scalar/MatrixProfiler.h b/src/modules/movesemantic/include/alien/move/handlers/scalar/MatrixProfiler.h index 56e630fcc..e9441097b 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/scalar/MatrixProfiler.h +++ b/src/modules/movesemantic/include/alien/move/handlers/scalar/MatrixProfiler.h @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/scalar/ProfiledMatrixBuilder.h b/src/modules/movesemantic/include/alien/move/handlers/scalar/ProfiledMatrixBuilder.h index 5879c6b75..669739fc8 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/scalar/ProfiledMatrixBuilder.h +++ b/src/modules/movesemantic/include/alien/move/handlers/scalar/ProfiledMatrixBuilder.h @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorReader.h b/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorReader.h index 70c375f08..6ba58e0fe 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorReader.h +++ b/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorReader.h @@ -26,7 +26,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorWriter.h b/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorWriter.h index b9027ee6a..b446f3484 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorWriter.h +++ b/src/modules/movesemantic/include/alien/move/handlers/scalar/VectorWriter.h @@ -28,7 +28,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/include/alien/move/handlers/sub_matrix/Extraction.h b/src/modules/movesemantic/include/alien/move/handlers/sub_matrix/Extraction.h index a04ade39b..27f9eb0c7 100644 --- a/src/modules/movesemantic/include/alien/move/handlers/sub_matrix/Extraction.h +++ b/src/modules/movesemantic/include/alien/move/handlers/sub_matrix/Extraction.h @@ -37,18 +37,20 @@ class IMatrix; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -class ALIEN_EXPORT SubMatrix -{ - public: - static MatrixData Extract(const IMatrix& matrix, const ExtractionIndices& indices); +namespace Move { + + class ALIEN_EXPORT SubMatrix { + public: + static MatrixData Extract(const IMatrix &matrix, const ExtractionIndices &indices); - private: - static MatrixData extractRange(const IMatrix& matrix, const ExtractionIndices& indices); + private: + static MatrixData extractRange(const IMatrix &matrix, const ExtractionIndices &indices); - static MatrixData extractIndices( - const IMatrix& matrix, const ExtractionIndices& indices); -}; + static MatrixData extractIndices( + const IMatrix &matrix, const ExtractionIndices &indices); + }; +} /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ diff --git a/src/modules/movesemantic/src/Extraction.cc b/src/modules/movesemantic/src/Extraction.cc index 2d3c8cea8..948034828 100644 --- a/src/modules/movesemantic/src/Extraction.cc +++ b/src/modules/movesemantic/src/Extraction.cc @@ -26,7 +26,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { using namespace Arccore; diff --git a/src/modules/movesemantic/src/MatrixData.cc b/src/modules/movesemantic/src/MatrixData.cc index 3f72211d0..1cbc5c057 100644 --- a/src/modules/movesemantic/src/MatrixData.cc +++ b/src/modules/movesemantic/src/MatrixData.cc @@ -31,7 +31,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { using namespace Arccore; diff --git a/src/modules/movesemantic/src/VectorData.cc b/src/modules/movesemantic/src/VectorData.cc index 5dfb9ea07..96fa39c2c 100644 --- a/src/modules/movesemantic/src/VectorData.cc +++ b/src/modules/movesemantic/src/VectorData.cc @@ -27,7 +27,7 @@ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -namespace Alien +namespace Alien::Move { using namespace Arccore; diff --git a/src/test/tests/move_api/TestMatrixDirectBuilder.cc b/src/test/tests/move_api/TestMatrixDirectBuilder.cc index 411e1ffcc..c84339ae6 100644 --- a/src/test/tests/move_api/TestMatrixDirectBuilder.cc +++ b/src/test/tests/move_api/TestMatrixDirectBuilder.cc @@ -38,12 +38,12 @@ TEST(TestMatrixDirectBuilder, Functional) Alien::MatrixDistribution mdist( row_space, col_space, AlienTest::Environment::parallelMng()); Alien::VectorDistribution vdist(col_space, AlienTest::Environment::parallelMng()); - Alien::MatrixData A(mdist); + Alien::Move::MatrixData A(mdist); ASSERT_EQ(A.rowSpace(), row_space); ASSERT_EQ(A.colSpace(), col_space); auto tag = Alien::DirectMatrixOptions::eResetValues; { - Alien::DirectMatrixBuilder builder( + Alien::Move::DirectMatrixBuilder builder( std::move(A), tag, Alien::DirectMatrixOptions::SymmetricFlag::eUnSymmetric); builder.reserve(5); builder.allocate(); @@ -55,9 +55,9 @@ TEST(TestMatrixDirectBuilder, Functional) } // check with spmv Alien::LinearAlgebra Alg(vdist.parallelMng()); - Alien::VectorData X(vdist); + Alien::Move::VectorData X(vdist); { - Alien::LocalVectorWriter writer(std::move(X)); + Alien::Move::LocalVectorWriter writer(std::move(X)); writer[0] = 1.; writer[1] = 2.; writer[2] = 3.; @@ -65,10 +65,10 @@ TEST(TestMatrixDirectBuilder, Functional) X = writer.release(); } Alien::VectorDistribution vdist2(row_space, AlienTest::Environment::parallelMng()); - Alien::VectorData R(vdist2); + Alien::Move::VectorData R(vdist2); Alg.mult(A, X, R); { - Alien::LocalVectorReader reader(std::move(R)); + Alien::Move::LocalVectorReader reader(std::move(R)); std::cout << reader[0] << std::endl; std::cout << reader[1] << std::endl; std::cout << reader[2] << std::endl; diff --git a/src/test/tests/move_api/TestVector.cc b/src/test/tests/move_api/TestVector.cc index d83ebeca9..6d4eea91a 100644 --- a/src/test/tests/move_api/TestVector.cc +++ b/src/test/tests/move_api/TestVector.cc @@ -27,7 +27,7 @@ // Tests the default c'tor. TEST(TestVector, DefaultConstructor) { - const Alien::VectorData v; + const Alien::Move::VectorData v; ASSERT_EQ(0, v.space().size()); } @@ -36,7 +36,7 @@ TEST(TestVector, SpaceConstructor) { const Alien::Space s(10, "MySpace"); const Alien::VectorDistribution d(s, AlienTest::Environment::parallelMng()); - const Alien::VectorData v(d); + const Alien::Move::VectorData v(d); ASSERT_TRUE(s == v.space()); ASSERT_EQ(10, v.space().size()); ASSERT_EQ("MySpace", v.space().name()); @@ -46,7 +46,7 @@ TEST(TestVector, SpaceConstructor) TEST(TestVector, AnonymousConstructor) { const Alien::VectorDistribution d(10, AlienTest::Environment::parallelMng()); - const Alien::VectorData v(d); + const Alien::Move::VectorData v(d); ASSERT_TRUE(Alien::Space(10) == v.space()); ASSERT_EQ(10, v.space().size()); } @@ -55,7 +55,7 @@ TEST(TestVector, AnonymousConstructor) TEST(TestVector, RValueConstructor) { const Alien::VectorDistribution d(10, AlienTest::Environment::parallelMng()); - const Alien::VectorData v(std::move(Alien::VectorData(d))); + const Alien::Move::VectorData v(std::move(Alien::Move::VectorData(d))); ASSERT_TRUE(Alien::Space(10) == v.space()); ASSERT_EQ(10, v.space().size()); } @@ -64,11 +64,11 @@ TEST(TestVector, RValueConstructor) TEST(TestVector, Replacement) { const Alien::VectorDistribution d10(10, AlienTest::Environment::parallelMng()); - auto v = Alien::VectorData(d10); + auto v = Alien::Move::VectorData(d10); ASSERT_TRUE(Alien::Space(10) == v.space()); ASSERT_EQ(10, v.space().size()); const Alien::VectorDistribution d5(5, AlienTest::Environment::parallelMng()); - v = Alien::VectorData(d5); + v = Alien::Move::VectorData(d5); ASSERT_TRUE(Alien::Space(5) == v.space()); ASSERT_EQ(5, v.space().size()); } @@ -77,12 +77,12 @@ TEST(TestVector, Replacement) TEST(TestVector, RValueAffectation) { const Alien::VectorDistribution d10(10, AlienTest::Environment::parallelMng()); - auto v = Alien::VectorData(d10); + auto v = Alien::Move::VectorData(d10); ASSERT_TRUE(Alien::Space(10) == v.space()); ASSERT_EQ(10, v.space().size()); const Alien::VectorDistribution d5(5, AlienTest::Environment::parallelMng()); - auto v2 = Alien::VectorData(d5); + auto v2 = Alien::Move::VectorData(d5); v = std::move(v2); ASSERT_TRUE(Alien::Space(5) == v.space()); ASSERT_EQ(5, v.space().size()); -} \ No newline at end of file +} diff --git a/src/test/tests/move_api/TestVectorBuilder.cc b/src/test/tests/move_api/TestVectorBuilder.cc index 0c49df84d..b63e9414a 100644 --- a/src/test/tests/move_api/TestVectorBuilder.cc +++ b/src/test/tests/move_api/TestVectorBuilder.cc @@ -27,9 +27,9 @@ TEST(TestVectorBuilder, ReleaseTest) { auto d = Alien::VectorDistribution(3, AlienTest::Environment::parallelMng()); - Alien::VectorData v(d); + Alien::Move::VectorData v(d); { - Alien::VectorWriter writer(std::move(v)); + Alien::Move::VectorWriter writer(std::move(v)); v = writer.release(); } ASSERT_EQ(3, v.space().size()); @@ -38,9 +38,9 @@ TEST(TestVectorBuilder, ReleaseTest) TEST(TestVectorBuilder, WriterTest) { auto d = Alien::VectorDistribution(3, AlienTest::Environment::parallelMng()); - Alien::VectorData v(d); + Alien::Move::VectorData v(d); { - Alien::VectorWriter writer(std::move(v)); + Alien::Move::VectorWriter writer(std::move(v)); writer[0] = 0.; writer[1] = 1.; writer[2] = 2.; @@ -52,9 +52,9 @@ TEST(TestVectorBuilder, WriterTest) TEST(TestVectorBuilder, ReaderWriterTest) { auto d = Alien::VectorDistribution(3, AlienTest::Environment::parallelMng()); - Alien::VectorData v(d); + Alien::Move::VectorData v(d); { - Alien::VectorWriter writer(std::move(v)); + Alien::Move::VectorWriter writer(std::move(v)); writer[0] = 0.; writer[1] = 1.; writer[2] = 2.; @@ -62,7 +62,7 @@ TEST(TestVectorBuilder, ReaderWriterTest) } ASSERT_EQ(3, v.space().size()); { - Alien::LocalVectorReader reader(v); + Alien::Move::LocalVectorReader reader(v); ASSERT_EQ(0., reader[0]); ASSERT_EQ(1., reader[1]); ASSERT_EQ(2., reader[2]);