47 #include <ginkgo/ginkgo.hpp> 49 #include <device_guard.hpp> 50 #include <exception_helpers.hpp> 52 #include <mpi_datatype.hpp> 53 #include <scatter.hpp> 58 #define metis_indextype idx_t 60 #define metis_indextype gko::int32 64 #define MINIMAL_OVERLAP 2 86 std::shared_ptr<gko::Executor>
executor = gko::ReferenceExecutor::create();
97 partition_regular = 0x0,
98 partition_regular2d = 0x4,
99 partition_metis = 0x1,
100 partition_zoltan = 0x2,
101 partition_custom = 0x3
145 direct_solver_cholmod = 0x0,
146 direct_solver_umfpack = 0x5,
147 direct_solver_ginkgo = 0x1,
148 iterative_solver_ginkgo = 0x2,
149 iterative_solver_dealii = 0x3,
153 local_solver_settings::iterative_solver_ginkgo;
274 bool put_all_local_residual_norms =
true;
275 bool enable_global_simple_tree =
false;
276 bool enable_decentralized_leader_election =
false;
277 bool enable_global_check =
true;
278 bool enable_accumulate =
false;
280 bool enable_global_check_iter_offset =
false;
282 enum local_convergence_crit {
283 residual_based = 0x0,
287 local_convergence_crit convergence_crit =
288 local_convergence_crit::solution_based;
302 Settings(std::string executor_string =
"reference")
303 : executor_string(executor_string)
318 template <
typename ValueType,
typename IndexType>
328 gko::size_type global_size = 0;
333 gko::size_type oned_laplacian_size = 0;
338 gko::size_type local_size = 0;
343 gko::size_type local_size_x = 0;
348 gko::size_type local_size_o = 0;
353 gko::size_type overlap_size = 0;
358 gko::size_type num_subdomains = 1;
431 ValueType current_residual_norm = -1.0;
436 ValueType min_residual_norm = -1.0;
442 std::vector<std::tuple<int, int, int, std::string, std::vector<ValueType>>>
449 std::vector<std::tuple<int, std::vector<std::tuple<int, int>>,
450 std::vector<std::tuple<int, int>>, int,
int>>
458 std::vector<std::vector<ValueType>> global_residual_vector_out;
459 std::vector<ValueType> local_residual_vector_out;
460 std::vector<ValueType> local_converged_iter_count;
461 std::vector<ValueType> local_converged_resnorm;
462 std::vector<ValueType> local_timestamp;
466 double init_mpi_wtime = 0.0;
508 #define MEASURE_ELAPSED_FUNC_TIME(_func, _id, _rank, _name, _iter) \ 510 auto start_time = std::chrono::steady_clock::now(); \ 512 auto elapsed_time = std::chrono::duration<ValueType>( \ 513 std::chrono::steady_clock::now() - start_time); \ 515 std::vector<ValueType> temp_vec(1, elapsed_time.count()); \ 516 metadata.time_struct.push_back( \ 517 std::make_tuple(_id, _rank, _iter, #_name, temp_vec)); \ 519 std::get<2>(metadata.time_struct[_id]) = _iter; \ 520 (std::get<4>(metadata.time_struct[_id])) \ 521 .push_back(elapsed_time.count()); \ 526 #define INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(_macro) \ 527 template _macro(float, gko::int32); \ 528 template _macro(double, gko::int32); \ 529 template _macro(float, gko::int64); \ 530 template _macro(double, gko::int64); 533 #define INSTANTIATE_FOR_EACH_VALUE_MIXEDVALUE_AND_INDEX_TYPE(_macro) \ 534 template _macro(double, gko::int32, float); \ 535 template _macro(double, gko::int32, double); \ 536 template _macro(double, gko::int64, float); \ 537 template _macro(double, gko::int64, double); 549 #define DECLARE_METADATA(ValueType, IndexType) \ 550 struct Metadata<ValueType, IndexType> 551 INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(DECLARE_METADATA);
552 #undef DECLARE_METADATA 558 #endif // settings.hpp bool enable_lock_local
Use local locks.
Definition: settings.hpp:261
bool enable_flush_local
Use local flush.
Definition: settings.hpp:251
bool non_symmetric_matrix
Is the matrix non-symmetric ? , Use GMRES for local solves.
Definition: settings.hpp:158
int shifted_iter
Iteration shift for node local communication.
Definition: settings.hpp:212
bool enable_one_by_one
Push each element separately directly into the buffer.
Definition: settings.hpp:246
unsigned int restart_iter
The restart iter for the GMRES solver.
Definition: settings.hpp:163
int reset_local_crit_iter
The global iter at which to reset the local solver criterion.
Definition: settings.hpp:168
bool explicit_laplacian
Flag if the laplacian matrix should be generated within the library.
Definition: settings.hpp:119
bool use_precond
Enable the block jacobi local preconditioner for the local solver.
Definition: settings.hpp:186
partition_settings
The partition algorithm to be used for partitioning the matrix.
Definition: settings.hpp:96
bool enable_put
Put the data to the window using MPI_Put rather than get.
Definition: settings.hpp:231
bool enable_lock_all
Use lock all.
Definition: settings.hpp:266
bool write_debug_out
Enable the writing of debug out to file.
Definition: settings.hpp:191
bool stage_through_host
Stage the MPI transfers through the host.
Definition: settings.hpp:241
gko::int32 overlap
The overlap between the subdomains.
Definition: settings.hpp:108
The settings for the various available communication paradigms.
Definition: settings.hpp:217
std::string metis_objtype
This setting defines the objective type for the metis partitioning.
Definition: settings.hpp:181
local_solver_settings
The local solver algorithm for the local subdomain solves.
Definition: settings.hpp:144
The struct that contains the solver settings and the parameters to be set by the user.
Definition: settings.hpp:77
bool naturally_ordered_factor
Disables the re-ordering of the matrix before computing the triangular factors during the CHOLMOD fac...
Definition: settings.hpp:176
std::shared_ptr< device_guard > cuda_device_guard
The ginkgo executor the code is to be executed on.
Definition: settings.hpp:91
bool write_perm_data
Enable the local permutations from CHOLMOD to a file.
Definition: settings.hpp:207
bool debug_print
Flag to enable some debug printing.
Definition: settings.hpp:139
bool enable_logging
Flag to enable logging for local iterative solvers.
Definition: settings.hpp:202
std::string executor_string
The string that contains the ginkgo executor paradigm.
Definition: settings.hpp:81
std::string factorization
The factorization for the local direct solver.
Definition: settings.hpp:295
The Schwarz wrappers namespace.
Definition: comm_helpers.hpp:49
bool enable_overlap
Enable explicit overlap between communication and computation.
Definition: settings.hpp:226
std::shared_ptr< gko::Executor > executor
The ginkgo executor the code is to be executed on.
Definition: settings.hpp:86
The various convergence settings available.
Definition: settings.hpp:273
bool use_mixed_precision
Flag if mixed precision should be used.
Definition: settings.hpp:124
bool write_iters_and_residuals
Enable writing the iters and residuals to a file.
Definition: settings.hpp:196
bool enable_get
Get the data to the window using MPI_Get rather than put.
Definition: settings.hpp:236
bool enable_flush_all
Use flush all.
Definition: settings.hpp:256
bool enable_random_rhs
Flag to enable a random rhs.
Definition: settings.hpp:129
bool print_matrices
Flag to enable printing of matrices.
Definition: settings.hpp:134
bool enable_onesided
Enable one-sided communication.
Definition: settings.hpp:221
std::string reorder
The reordering for the local solve.
Definition: settings.hpp:300
std::string matrix_filename
The string that contains the matrix file name to read from .
Definition: settings.hpp:113
The struct used for storing data for post-processing.
Definition: settings.hpp:457