Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
task_info.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2011 - 2021 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16
17#ifndef dealii_matrix_free_task_info_h
18#define dealii_matrix_free_task_info_h
19
20
21#include <deal.II/base/config.h>
22
26#include <deal.II/base/tensor.h>
30
31
33
34
35// forward declaration
36#ifndef DOXYGEN
38#endif
39
40
41namespace internal
42{
48 {
49 public:
50 virtual ~MFWorkerInterface() = default;
51
53 virtual void
55
57 virtual void
59
61 virtual void
63
65 virtual void
67
70 virtual void
71 zero_dst_vector_range(const unsigned int range_index) = 0;
72
73 virtual void
74 cell_loop_pre_range(const unsigned int range_index) = 0;
75
76 virtual void
77 cell_loop_post_range(const unsigned int range_index) = 0;
78
81 virtual void
82 cell(const std::pair<unsigned int, unsigned int> &cell_range) = 0;
83
86 virtual void
87 cell(const unsigned int range_index) = 0;
88
91 virtual void
92 face(const unsigned int range_index) = 0;
93
96 virtual void
97 boundary(const unsigned int range_index) = 0;
98 };
99
100
101
102 namespace MatrixFreeFunctions
103 {
109 struct TaskInfo
110 {
111 // enum for choice of how to build the task graph. Odd add versions with
112 // preblocking and even versions with postblocking. partition_partition
113 // and partition_color are deprecated but kept for backward
114 // compatibility.
116 {
120 color
121 };
122
126 TaskInfo();
127
132 void
133 clear();
134
138 void
139 loop(MFWorkerInterface &worker) const;
140
145 void
146 make_boundary_cells_divisible(std::vector<unsigned int> &boundary_cells);
147
190 void
192 const std::vector<unsigned int> &cells_with_comm,
193 const unsigned int dofs_per_cell,
194 const bool categories_are_hp,
195 const std::vector<unsigned int> &cell_vectorization_categories,
196 const bool cell_vectorization_categories_strict,
197 const std::vector<unsigned int> &parent_relation,
198 std::vector<unsigned int> & renumbering,
199 std::vector<unsigned char> & incompletely_filled_vectorization);
200
218 void
220 const std::vector<unsigned int> &boundary_cells,
221 std::vector<unsigned int> & renumbering,
222 std::vector<unsigned char> & incompletely_filled_vectorization);
223
230 void
231 guess_block_size(const unsigned int dofs_per_cell);
232
259 void
261 DynamicSparsityPattern & connectivity,
262 std::vector<unsigned int> & renumbering,
263 std::vector<unsigned char> &irregular_cells,
264 const bool hp_bool);
265
298 void
300 const std::vector<unsigned int> &cell_active_fe_index,
301 DynamicSparsityPattern & connectivity,
302 std::vector<unsigned int> & renumbering,
303 std::vector<unsigned char> & irregular_cells,
304 const bool hp_bool);
305
329 void
330 make_thread_graph(const std::vector<unsigned int> &cell_active_fe_index,
331 DynamicSparsityPattern & connectivity,
332 std::vector<unsigned int> & renumbering,
333 std::vector<unsigned char> & irregular_cells,
334 const bool hp_bool);
335
340 void
342 const std::vector<unsigned char> &irregular_cells,
343 const DynamicSparsityPattern & connectivity_cells,
344 DynamicSparsityPattern & connectivity_blocks) const;
345
350 void
352 const DynamicSparsityPattern & connectivity,
353 const unsigned int partition,
354 const std::vector<unsigned int> &cell_partition,
355 const std::vector<unsigned int> &partition_list,
356 const std::vector<unsigned int> &partition_size,
357 std::vector<unsigned int> & partition_color_list);
358
363 void
365 const DynamicSparsityPattern & connectivity,
366 const std::vector<unsigned int> &cell_active_fe_index,
367 const unsigned int partition,
368 const unsigned int cluster_size,
369 const bool hp_bool,
370 const std::vector<unsigned int> &cell_partition,
371 const std::vector<unsigned int> &partition_list,
372 const std::vector<unsigned int> &partition_size,
373 std::vector<unsigned int> & partition_partition_list,
374 std::vector<unsigned char> & irregular_cells);
375
396 void
397 make_partitioning(const DynamicSparsityPattern &connectivity,
398 const unsigned int cluster_size,
399 std::vector<unsigned int> & cell_partition,
400 std::vector<unsigned int> & partition_list,
401 std::vector<unsigned int> & partition_size,
402 unsigned int & partition) const;
403
408 void
409 update_task_info(const unsigned int partition);
410
414 void
416
420 std::size_t
421 memory_consumption() const;
422
427 template <typename StreamType>
428 void
429 print_memory_statistics(StreamType &out, std::size_t data_length) const;
430
435 unsigned int n_active_cells;
436
441 unsigned int n_ghost_cells;
442
447
451 unsigned int block_size;
452
456 unsigned int n_blocks;
457
462
469 std::vector<unsigned int> partition_row_index;
470
477 std::vector<unsigned int> cell_partition_data;
478
484 std::vector<unsigned int> cell_partition_data_hp;
485
490 std::vector<unsigned int> cell_partition_data_hp_ptr;
491
499 std::vector<unsigned int> face_partition_data;
500
506 std::vector<unsigned int> face_partition_data_hp;
507
512 std::vector<unsigned int> face_partition_data_hp_ptr;
513
521 std::vector<unsigned int> boundary_partition_data;
522
528 std::vector<unsigned int> boundary_partition_data_hp;
529
534 std::vector<unsigned int> boundary_partition_data_hp_ptr;
535
544 std::vector<unsigned int> ghost_face_partition_data;
545
555 std::vector<unsigned int> refinement_edge_face_partition_data;
556
561 std::vector<unsigned int> partition_evens;
562
567 std::vector<unsigned int> partition_odds;
568
573 std::vector<unsigned int> partition_n_blocked_workers;
574
579 std::vector<unsigned int> partition_n_workers;
580
585 unsigned int evens;
586
591 unsigned int odds;
592
597 unsigned int n_blocked_workers;
598
602 unsigned int n_workers;
603
608 std::vector<unsigned char> task_at_mpi_boundary;
609
614
619
624
628 unsigned int my_pid;
629
633 unsigned int n_procs;
634 };
635
636 } // end of namespace MatrixFreeFunctions
637} // end of namespace internal
638
640
641#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
virtual void face(const unsigned int range_index)=0
virtual void zero_dst_vector_range(const unsigned int range_index)=0
virtual void cell(const std::pair< unsigned int, unsigned int > &cell_range)=0
virtual void boundary(const unsigned int range_index)=0
virtual void vector_compress_start()=0
Starts the communication for the vector compress operation.
virtual void cell(const unsigned int range_index)=0
virtual void cell_loop_post_range(const unsigned int range_index)=0
virtual void vector_update_ghosts_start()=0
Starts the communication for the update ghost values operation.
virtual ~MFWorkerInterface()=default
virtual void cell_loop_pre_range(const unsigned int range_index)=0
virtual void vector_update_ghosts_finish()=0
Finishes the communication for the update ghost values operation.
virtual void vector_compress_finish()=0
Finishes the communication for the vector compress operation.
std::vector< unsigned int > face_partition_data_hp_ptr
Definition: task_info.h:512
std::size_t memory_consumption() const
Definition: task_info.cc:705
std::vector< unsigned int > boundary_partition_data_hp
Definition: task_info.h:528
std::vector< unsigned int > boundary_partition_data
Definition: task_info.h:521
void loop(MFWorkerInterface &worker) const
Definition: task_info.cc:350
std::vector< unsigned char > task_at_mpi_boundary
Definition: task_info.h:608
std::vector< unsigned int > face_partition_data_hp
Definition: task_info.h:506
void make_thread_graph_partition_color(DynamicSparsityPattern &connectivity, std::vector< unsigned int > &renumbering, std::vector< unsigned char > &irregular_cells, const bool hp_bool)
Definition: task_info.cc:1177
std::vector< unsigned int > refinement_edge_face_partition_data
Definition: task_info.h:555
std::vector< unsigned int > partition_n_workers
Definition: task_info.h:579
void create_blocks_serial(const std::vector< unsigned int > &cells_with_comm, const unsigned int dofs_per_cell, const bool categories_are_hp, const std::vector< unsigned int > &cell_vectorization_categories, const bool cell_vectorization_categories_strict, const std::vector< unsigned int > &parent_relation, std::vector< unsigned int > &renumbering, std::vector< unsigned char > &incompletely_filled_vectorization)
Definition: task_info.cc:794
void make_connectivity_cells_to_blocks(const std::vector< unsigned char > &irregular_cells, const DynamicSparsityPattern &connectivity_cells, DynamicSparsityPattern &connectivity_blocks) const
Definition: task_info.cc:1587
void make_partitioning_within_partitions_post_blocked(const DynamicSparsityPattern &connectivity, const std::vector< unsigned int > &cell_active_fe_index, const unsigned int partition, const unsigned int cluster_size, const bool hp_bool, const std::vector< unsigned int > &cell_partition, const std::vector< unsigned int > &partition_list, const std::vector< unsigned int > &partition_size, std::vector< unsigned int > &partition_partition_list, std::vector< unsigned char > &irregular_cells)
Definition: task_info.cc:1631
void initial_setup_blocks_tasks(const std::vector< unsigned int > &boundary_cells, std::vector< unsigned int > &renumbering, std::vector< unsigned char > &incompletely_filled_vectorization)
Definition: task_info.cc:1083
void print_memory_statistics(StreamType &out, std::size_t data_length) const
Definition: task_info.cc:690
void make_coloring_within_partitions_pre_blocked(const DynamicSparsityPattern &connectivity, const unsigned int partition, const std::vector< unsigned int > &cell_partition, const std::vector< unsigned int > &partition_list, const std::vector< unsigned int > &partition_size, std::vector< unsigned int > &partition_color_list)
Definition: task_info.cc:1952
std::vector< unsigned int > partition_row_index
Definition: task_info.h:469
void make_thread_graph_partition_partition(const std::vector< unsigned int > &cell_active_fe_index, DynamicSparsityPattern &connectivity, std::vector< unsigned int > &renumbering, std::vector< unsigned char > &irregular_cells, const bool hp_bool)
Definition: task_info.cc:1519
std::vector< unsigned int > partition_evens
Definition: task_info.h:561
void make_thread_graph(const std::vector< unsigned int > &cell_active_fe_index, DynamicSparsityPattern &connectivity, std::vector< unsigned int > &renumbering, std::vector< unsigned char > &irregular_cells, const bool hp_bool)
Definition: task_info.cc:1324
std::vector< unsigned int > partition_n_blocked_workers
Definition: task_info.h:573
std::vector< unsigned int > cell_partition_data_hp
Definition: task_info.h:484
std::vector< unsigned int > cell_partition_data_hp_ptr
Definition: task_info.h:490
std::vector< unsigned int > cell_partition_data
Definition: task_info.h:477
void make_partitioning(const DynamicSparsityPattern &connectivity, const unsigned int cluster_size, std::vector< unsigned int > &cell_partition, std::vector< unsigned int > &partition_list, std::vector< unsigned int > &partition_size, unsigned int &partition) const
Definition: task_info.cc:2028
void update_task_info(const unsigned int partition)
Definition: task_info.cc:2257
void make_boundary_cells_divisible(std::vector< unsigned int > &boundary_cells)
Definition: task_info.cc:722
std::vector< unsigned int > ghost_face_partition_data
Definition: task_info.h:544
void guess_block_size(const unsigned int dofs_per_cell)
Definition: task_info.cc:1149
std::vector< unsigned int > boundary_partition_data_hp_ptr
Definition: task_info.h:534
std::vector< unsigned int > partition_odds
Definition: task_info.h:567
std::vector< unsigned int > face_partition_data
Definition: task_info.h:499