My Project
programmer's documentation
cs_matrix_tuning.h
Go to the documentation of this file.
1 #ifndef __CS_MATRIX_TUNING_H__
2 #define __CS_MATRIX_TUNING_H__
3 
4 /*============================================================================
5  * Sparse Matrix Representation and Operations
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 #include "cs_halo.h"
37 #include "cs_numbering.h"
38 #include "cs_halo_perio.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*============================================================================
53  * Global variables
54  *============================================================================*/
55 
56 /*=============================================================================
57  * Public function prototypes
58  *============================================================================*/
59 
60 /*----------------------------------------------------------------------------
61  * Tune local matrix.vector product operations.
62  *
63  * To avoid multiplying structures for multiple matrix fill-ins,
64  * an array of tuning types may be provided, and weights may be
65  * associated to each type based on the expected usage of each fill-in
66  * type. If n_fill_types is set to 0, these arrays are ignored, and their
67  * following default is used:
68  *
69  * CS_MATRIX_SCALAR 0.5
70  * CS_MATRIX_SCALAR_SYM 0.25
71  * CS_MATRIX_33_BLOCK_D 0.25
72  *
73  * parameters:
74  * t_measure <-- minimum time for each measure
75  * n_types <-- number of matrix types tuned for, or 0
76  * n_fill_types <-- number of fill types tuned for, or 0
77  * types <-- array of matrix types tuned for, or NULL
78  * fill_types <-- array of fill types tuned for, or NULL
79  * fill_weights <-- weight of fill types tuned for, or NULL
80  * n_min_products <-- minimum number of SpMv products (to estimate
81  * amortization of coefficients assignment)
82  * n_cells <-- number of local cells
83  * n_cells_ext <-- number of cells including ghost cells (array size)
84  * n_faces <-- local number of internal faces
85  * face_cell <-- face -> cells connectivity
86  * halo <-- cell halo structure
87  * numbering <-- vectorization or thread-related numbering info, or NULL
88  *
89  * returns:
90  * pointer to tuning results structure
91  *----------------------------------------------------------------------------*/
92 
94 cs_matrix_variant_tuned(double t_measure,
95  int n_types,
96  int n_fill_types,
97  cs_matrix_type_t types[],
98  cs_matrix_fill_type_t fill_types[],
99  double fill_weights[],
100  int n_min_products,
101  cs_lnum_t n_cells,
102  cs_lnum_t n_cells_ext,
103  cs_lnum_t n_faces,
104  const cs_lnum_2_t *face_cell,
105  const cs_halo_t *halo,
106  const cs_numbering_t *numbering);
107 
108 /*----------------------------------------------------------------------------*/
109 
111 
112 #endif /* __CS_MATRIX_TUNING_H__ */
cs_matrix_variant_tuned
cs_matrix_variant_t * cs_matrix_variant_tuned(double t_measure, int n_types, int n_fill_types, cs_matrix_type_t types[], cs_matrix_fill_type_t fill_types[], double fill_weights[], int n_min_products, cs_lnum_t n_cells, cs_lnum_t n_cells_ext, cs_lnum_t n_faces, const cs_lnum_2_t *face_cell, const cs_halo_t *halo, const cs_numbering_t *numbering)
Definition: cs_matrix_tuning.c:711
cs_defs.h
cs_numbering.h
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_numbering_t
Definition: cs_numbering.h:83
cs_matrix_variant_t
struct _cs_matrix_variant_t cs_matrix_variant_t
Definition: cs_matrix.h:94
cs_halo.h
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_halo_perio.h
cs_halo_t
Definition: cs_halo.h:71
cs_lnum_2_t
int cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:308
cs_matrix_fill_type_t
cs_matrix_fill_type_t
Definition: cs_matrix.h:67
cs_matrix_type_t
cs_matrix_type_t
Definition: cs_matrix.h:55