Skip to content

Commit 12be2fe

Browse files
authored
composyx alien pluggin (#1787)
* composyx alien pluggin
1 parent 3685e44 commit 12be2fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2667
-28
lines changed

alien/ArcaneInterface/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ set(Arcane_USE_CMAKE_CONFIG TRUE)
5050
#set(Hypre_USE_CMAKE_CONFIG TRUE)
5151
#set(MTL4_USE_CMAKE_CONFIG TRUE)
5252
#set(SuperLU_USE_CMAKE_CONFIG TRUE)
53+
set(composyx_USE_CMAKE_CONFIG TRUE)
5354
set(GTest_USE_CMAKE_CONFIG TRUE)
5455
set(TBB_USE_CMAKE_CONFIG TRUE)
5556
set(MPI_USE_CMAKE_CONFIG TRUE)
@@ -160,10 +161,9 @@ logStatus("Loading components...")
160161

161162
add_subdirectory(modules/options)
162163
add_subdirectory(modules/external_packages)
163-
if(TARGET trilinos)
164-
add_subdirectory(modules/trilinos)
165-
endif()
164+
add_subdirectory(modules/trilinos)
166165
add_subdirectory(modules/hpddm)
166+
add_subdirectory(modules/composyx)
167167
add_subdirectory(modules/ifpen_solvers)
168168
add_subdirectory(modules/arcane_tools)
169169
add_subdirectory(modules/interface_c)

alien/ArcaneInterface/cmake/AlienLegacyConfig.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138
// HPDDM
139139
#cmakedefine ALIEN_USE_HPDDM
140140

141+
// COMPOSYX
142+
#cmakedefine ALIEN_USE_COMPOSYX
143+
141144
// SYCL
142145
#cmakedefine ALIEN_USE_SYCL
143146

alien/ArcaneInterface/cmake/LoadAlienPackages.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ loadPackage(NAME HTSSolver)
6868
loadPackage(NAME Trilinos)
6969
loadPackage(NAME Arpack)
7070
loadPackage(NAME HPDDM)
71+
loadPackage(NAME composyx)
7172

7273
# ----------------------------------------------------------------------------
7374
# ----------------------------------------------------------------------------
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# compilation des sources
2+
if(TARGET COMPOSYX::composyx)
3+
add_subdirectory(src)
4+
endif()
5+
6+
# on pourrait ajouter des tests etc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
if (NOT TARGET COMPOSYX::composyx)
2+
return()
3+
endif ()
4+
5+
createLibrary(alien_composyx
6+
EXPORT alien/AlienComposyxExport.h
7+
)
8+
9+
set_target_properties(alien_composyx
10+
PROPERTIES LINKER_LANGUAGE "CXX")
11+
12+
if(TARGET arcane_core)
13+
set(AXL_OPTION_GENERATION_TYPE "ALL")
14+
set(NAMESPACE_TYPE "Arcane")
15+
set(IS_WITH_ARCANE "")
16+
set(IS_WITH_MESH "NO_MESH")
17+
else()
18+
set(AXL_OPTION_GENERATION_TYPE "STRONG_OPTIONS_ONLY")
19+
set(NAMESPACE_TYPE "Arccore")
20+
set(IS_WITH_ARCANE "NO_ARCANE")
21+
set(IS_WITH_MESH "NO_MESH")
22+
endif()
23+
24+
addDirectory(alien/kernels/composyx)
25+
26+
if(TARGET arcane_core)
27+
linkLibraries(alien_composyx arcane_core arcane_std)
28+
else ()
29+
linkLibraries(alien_composyx alien_strong_options)
30+
endif()
31+
32+
linkLibraries(alien_composyx Alien::alien_core Alien::alien_semantic_ref)
33+
34+
target_include_directories(alien_composyx PUBLIC
35+
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
36+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
37+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
38+
$<INSTALL_INTERFACE:include>)
39+
40+
commit(alien_composyx)
41+
42+
install(DIRECTORY alien
43+
DESTINATION include
44+
FILES_MATCHING PATTERN "*.h"
45+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
#pragma once
9+
10+
#ifdef ALIEN_USE_COMPOSYX
11+
#include <alien/kernels/composyx/linear_solver/arcane/ComposyxLinearSolverService.h>
12+
#include <alien/kernels/composyx/linear_solver/ComposyxInternalSolver.h>
13+
#endif
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
#pragma once
9+
/*---------------------------------------------------------------------------*/
10+
/*---------------------------------------------------------------------------*/
11+
12+
#include "alien/AlienComposyxExport.h"
13+
#include <alien/AlienLegacyConfig.h>
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
addSources(alien_composyx
2+
algebra/ComposyxInternalLinearAlgebra.cc
3+
data_structure/ComposyxMatrix.cc
4+
data_structure/ComposyxVector.cc
5+
linear_solver/ComposyxInternalSolver.cc
6+
converters/SimpleCSR/Composyx_to_SimpleCSR_VectorConverter.cc
7+
converters/SimpleCSR/SimpleCSR_to_Composyx_VectorConverter.cc
8+
converters/SimpleCSR/SimpleCSR_to_Composyx_MatrixConverter.cc
9+
)
10+
11+
generateAxl(alien_composyx
12+
linear_solver/arcane/ComposyxSolver.axl
13+
AXL_OPTION_GENERATION_MODE ${AXL_OPTION_GENERATION_TYPE}
14+
NAMESPACE ${NAMESPACE_TYPE}
15+
${IS_WITH_ARCANE}
16+
${IS_WITH_MESH}
17+
INSTALL_GENERATED_FILES
18+
USER_INSTALL_PREFIX ALIEN
19+
)
20+
addSources(alien_composyx
21+
linear_solver/arcane/ComposyxSolverService.cc
22+
)
23+
24+
if(TARGET mumps)
25+
linkLibraries(alien_composyx mumps)
26+
endif()
27+
28+
if(TARGET arpack)
29+
linkLibraries(alien_composyx arpack)
30+
endif()
31+
32+
if(TARGET COMPOSYX::composyx)
33+
linkLibraries(alien_composyx COMPOSYX::composyx)
34+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
#pragma once
9+
#include <alien/utils/Precomp.h>
10+
#include <alien/core/backend/BackEnd.h>
11+
#include <arccore/message_passing/IMessagePassingMng.h>
12+
13+
/*---------------------------------------------------------------------------*/
14+
15+
class IOptionsComposyxSolver;
16+
17+
namespace Alien {
18+
19+
/*---------------------------------------------------------------------------*/
20+
21+
class MultiVectorImpl;
22+
class MatrixData;
23+
class MatrixExp;
24+
class VectorData;
25+
class VectorData;
26+
class VectorExp;
27+
class ILinearSolver;
28+
class ILinearAlgebra;
29+
30+
template<typename T> class ComposyxMatrix ;
31+
template<typename T> class ComposyxVector ;
32+
33+
template<typename T> class SimpleCSRMatrix ;
34+
template<typename T> class SimpleCSRMatrix ;
35+
36+
class Space;
37+
38+
template <class Matrix, class Vector> class IInternalLinearAlgebra;
39+
template <class Matrix, class Vector> class IInternalLinearSolver;
40+
41+
//extern IInternalLinearAlgebra<SimpleCSRMatrix<Real>, SimpleCSRMatrix<Real>>*
42+
//ComposyxSolverInternalLinearAlgebraFactory();
43+
44+
// extern IInternalLinearSolver<ComposyxMatrix<Real>, ComposyxVector<Real>>*
45+
extern ILinearSolver* ComposyxInternalLinearSolverFactory(
46+
IMessagePassingMng* p_mng, IOptionsComposyxSolver* options);
47+
48+
extern IInternalLinearAlgebra<SimpleCSRMatrix<Real>, SimpleCSRMatrix<Real>>*
49+
ComposyxInternalLinearAlgebraFactory();
50+
51+
/*---------------------------------------------------------------------------*/
52+
53+
namespace BackEnd {
54+
namespace tag {
55+
struct composyx
56+
{
57+
};
58+
}
59+
}
60+
61+
template <> struct AlgebraTraits<BackEnd::tag::composyx>
62+
{
63+
typedef ComposyxMatrix<Real> matrix_type;
64+
typedef ComposyxVector<Real> vector_type;
65+
66+
typedef SimpleCSRMatrix<Real> csr_matrix_type;
67+
typedef SimpleCSRMatrix<Real> csr_vector_type;
68+
typedef IInternalLinearAlgebra<csr_matrix_type, csr_vector_type> algebra_type;
69+
70+
// typedef IInternalLinearSolver<matrix_type, vector_type> solver_type;
71+
typedef ILinearSolver solver_type;
72+
typedef IOptionsComposyxSolver options_type;
73+
74+
static algebra_type* algebra_factory(IMessagePassingMng* p_mng = nullptr)
75+
{
76+
return ComposyxInternalLinearAlgebraFactory();
77+
}
78+
79+
static solver_type* solver_factory(IMessagePassingMng* p_mng, options_type* options)
80+
{
81+
return ComposyxInternalLinearSolverFactory(p_mng, options);
82+
}
83+
84+
static BackEndId name() { return "composyx"; }
85+
};
86+
87+
/*---------------------------------------------------------------------------*/
88+
89+
} // namespace Alien
90+
91+
/*---------------------------------------------------------------------------*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
#pragma once
9+
10+
#include <alien/utils/Precomp.h>
11+
#include <alien/AlienComposyxPrecomp.h>
12+
13+
#define BEGIN_COMPOSYXINTERNAL_NAMESPACE \
14+
namespace Alien { \
15+
namespace ComposyxInternal {
16+
#define END_COMPOSYXINTERNAL_NAMESPACE \
17+
} \
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
#include "ComposyxInternalLinearAlgebra.h"
8+
9+
#include <alien/kernels/composyx/ComposyxBackEnd.h>
10+
11+
#include <alien/core/backend/LinearAlgebraT.h>
12+
13+
#include <alien/data/Space.h>
14+
15+
#include <alien/kernels/simple_csr/SimpleCSRMatrix.h>
16+
#include <alien/kernels/simple_csr/SimpleCSRVector.h>
17+
#include <alien/kernels/simple_csr/algebra/SimpleCSRInternalLinearAlgebra.h>
18+
19+
#include <arccore/base/NotImplementedException.h>
20+
//#include <alien/kernels/composyx/data_structure/ComposyxMatrix.h>
21+
/*---------------------------------------------------------------------------*/
22+
/*---------------------------------------------------------------------------*/
23+
24+
namespace Alien {
25+
26+
/*---------------------------------------------------------------------------*/
27+
28+
//template class ALIEN_COMPOSYX_EXPORT LinearAlgebra<BackEnd::tag::composyx>;
29+
// template class ALIEN_COMPOSYX_EXPORT
30+
// LinearAlgebra<BackEnd::tag::composyx,BackEnd::tag::simplecsr> ;
31+
32+
/*---------------------------------------------------------------------------*/
33+
IInternalLinearAlgebra<SimpleCSRMatrix<Real>, SimpleCSRVector<Real>>*
34+
ComposyxSolverInternalLinearAlgebraFactory()
35+
{
36+
return new ComposyxSolverInternalLinearAlgebra();
37+
}
38+
39+
} // namespace Alien
40+
41+
/*---------------------------------------------------------------------------*/
42+
/*---------------------------------------------------------------------------*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
9+
#include <alien/AlienComposyxPrecomp.h>
10+
11+
#include <alien/kernels/composyx/ComposyxBackEnd.h>
12+
#include <alien/core/backend/IInternalLinearAlgebraT.h>
13+
14+
#include <alien/expression/solver/ILinearAlgebra.h>
15+
#include <alien/kernels/simple_csr/algebra/SimpleCSRInternalLinearAlgebra.h>
16+
17+
/*---------------------------------------------------------------------------*/
18+
/*---------------------------------------------------------------------------*/
19+
20+
namespace Alien {
21+
22+
/*---------------------------------------------------------------------------*/
23+
/*---------------------------------------------------------------------------*/
24+
25+
typedef SimpleCSRInternalLinearAlgebra ComposyxSolverInternalLinearAlgebra;
26+
27+
//typedef AlgebraTraits<BackEnd::tag::composyx>::matrix_type CSRMatrix;
28+
//typedef AlgebraTraits<BackEnd::tag::composyx>::vector_type CSRVector;
29+
30+
/*---------------------------------------------------------------------------*/
31+
/*---------------------------------------------------------------------------*/
32+
33+
} // namespace Alien
34+
35+
/*---------------------------------------------------------------------------*/
36+
/*---------------------------------------------------------------------------*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2+
//-----------------------------------------------------------------------------
3+
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4+
// See the top-level COPYRIGHT file for details.
5+
// SPDX-License-Identifier: Apache-2.0
6+
//-----------------------------------------------------------------------------
7+
8+
9+
#include <alien/utils/Precomp.h>
10+
11+
#include <alien/kernels/composyx/ComposyxBackEnd.h>
12+
#include <alien/core/backend/LinearAlgebra.h>
13+
14+
/*---------------------------------------------------------------------------*/
15+
16+
BEGIN_NAMESPACE(Alien)
17+
18+
// typedef LinearAlgebra<BackEnd::tag::hpddm,BackEnd::tag::simplecsr> ComposyxLinearAlgebra;
19+
20+
END_NAMESPACE
21+
22+
/*---------------------------------------------------------------------------*/
23+

0 commit comments

Comments
 (0)