96struct MatrixPartitionerRuntime
101 eMatrixPartitionerType t;
104 MatrixPartitionerRuntime(params prm = params())
106#
if defined(ARCCORE_ALINA_HAVE_PARMETIS)
107 eMatrixPartitionerType::parmetis
114 if (!prm.erase(
"type"))
115 ARCCORE_ALINA_PARAM_MISSING(
"type");
118 case eMatrixPartitionerType::merge: {
120 handle =
static_cast<void*
>(
new R(prm));
122#ifdef ARCCORE_ALINA_HAVE_PARMETIS
123 case eMatrixPartitionerType::parmetis: {
125 handle =
static_cast<void*
>(
new R(prm));
129 throw std::invalid_argument(
"Unsupported partition type");
133 ~MatrixPartitionerRuntime()
136 case eMatrixPartitionerType::merge: {
138 delete static_cast<R*
>(handle);
140#ifdef ARCCORE_ALINA_HAVE_PARMETIS
141 case eMatrixPartitionerType::parmetis: {
143 delete static_cast<R*
>(handle);
151 bool is_needed(
const matrix& A)
const
154 case eMatrixPartitionerType::merge: {
156 return static_cast<const R*
>(handle)->is_needed(A);
158#ifdef ARCCORE_ALINA_HAVE_PARMETIS
159 case eMatrixPartitionerType::parmetis: {
161 return static_cast<const R*
>(handle)->is_needed(A);
165 throw std::invalid_argument(
"Unsupported partition type");
169 std::shared_ptr<matrix> operator()(
const matrix& A,
unsigned block_size = 1)
const
172 case eMatrixPartitionerType::merge: {
174 return static_cast<const R*
>(handle)->
operator()(A, block_size);
176#ifdef ARCCORE_ALINA_HAVE_PARMETIS
177 case eMatrixPartitionerType::parmetis: {
179 return static_cast<const R*
>(handle)->
operator()(A, block_size);
183 throw std::invalid_argument(
"Unsupported partition type");