PaStiX Handbook  6.3.2
solver_comm_matrix.h
Go to the documentation of this file.
1 /**
2  *
3  * @file solver_comm_matrix.h
4  *
5  * PaStiX communication matrix handler.
6  *
7  * @copyright 2021-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.3.2
11  * @author Nolan Bredel
12  * @date 2023-07-21
13  *
14  **/
15 #ifndef _solver_comm_matrix_h_
16 #define _solver_comm_matrix_h_
17 
18 #include "common/common.h"
19 #include "blend/solver.h"
20 
21 #if defined(PASTIX_COMMUNICATION_MATRIX)
22 void solverComMatrixInit( SolverMatrix *solvmtx );
23 void solverComMatrixExit( SolverMatrix *solvmtx );
24 void solverComMatrixGather( SolverMatrix *solvmtx );
25 
26 /**
27  *******************************************************************************
28  *
29  * @brief Add the size of a communication
30  *
31  *******************************************************************************
32  *
33  * @param[inout] solvmtx
34  * The solver matrix structure.
35  *
36  * @param[in] dest
37  * The destination node where the data goes.
38  *
39  * @param[in] size
40  * Size of the communication.
41  *
42  *******************************************************************************/
43 static inline void
44 solverCommMatrixAdd( SolverMatrix *solvmtx, int dest, size_t size )
45 {
46  solvmtx->com_vector[dest] += size;
47 }
48 
49 #else
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 static inline void
52 solverComMatrixInit( __attribute__((unused)) SolverMatrix *solvmtx ) {}
53 
54 static inline void
55 solverComMatrixExit( __attribute__((unused)) SolverMatrix *solvmtx ) {}
56 
57 static inline void
58 solverComMatrixGather( __attribute__((unused)) SolverMatrix *solvmtx ) {}
59 
60 static inline void
61 solverCommMatrixAdd( __attribute__((unused)) SolverMatrix *solvmtx,
62  __attribute__((unused)) int dest,
63  __attribute__((unused)) size_t size )
64 {}
65 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
66 #endif
67 
68 #endif /* _solver_comm_matrix_h_ */
size_t * com_vector
Definition: solver.h:271
Solver column block structure.
Definition: solver.h:200
void solverComMatrixExit(SolverMatrix *solvmtx)
Free the communication matrix.
void solverComMatrixGather(SolverMatrix *solvmtx)
Gather the volume of communication and save it as a csv.
void solverComMatrixInit(SolverMatrix *solvmtx)
Initialize the communication matrix.