src/base/cs_block_dist.h Source File

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_block_dist.h
Go to the documentation of this file.
1 #ifndef __CS_BLOCK_DIST_H__
2 #define __CS_BLOCK_DIST_H__
3
4 /*============================================================================
5 * Definition of a block distribution.
6 *============================================================================*/
7
8 /*
9 This file is part of Code_Saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2013 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 /*----------------------------------------------------------------------------*/
37
38 BEGIN_C_DECLS
39
40 /*=============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44 /*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48 /* Information structure for block size and entity range */
49
50 typedef struct {
51
52 cs_gnum_t gnum_range[2]; /* Start and past-the-end global numbers
53 associated with local block */
54 int n_ranks; /* Number of active ranks */
55 int rank_step; /* Step between active block ranks
56 (1 in basic case, > 1 if we seek to
57 avoid too small buffers and agglomerate
58 blocks on only a few ranks) */
59 cs_lnum_t block_size; /* Basic block size */
60
61 } cs_block_dist_info_t;
62
63 /*=============================================================================
64 * Public function prototypes
65 *============================================================================*/
66
67 /*----------------------------------------------------------------------------
68 * Compute block size and rank info for use with a block distribution.
69 *
70 * arguments:
71 * rank_id <-- id of local rank
72 * n_ranks <-- number of associated ranks
73 * min_rank_step <-- minimum rank step between blocks
74 * min_block_size <-- minimum number of entities per block
75 * n_g_ents <-- total number of associated entities
76 *
77 * returns:
78 * block size and range info structure
79 *----------------------------------------------------------------------------*/
80
81 cs_block_dist_info_t
82 cs_block_dist_compute_sizes(int rank_id,
83 int n_ranks,
84 int min_rank_step,
85 cs_lnum_t min_block_size,
86 cs_gnum_t n_g_ents);
87
88 /*----------------------------------------------------------------------------
89 * Compute block size and rank info for use with a block distribution
90 * for a new global number of entities with a given number of active
91 * ranks.
92 *
93 * arguments:
94 * rank_id <-- id of local rank (ignored in serial mode)
95 * n_ranks <-- number of associated ranks
96 * n_block_ranks <-- number of ranks associated with a block
97 * n_g_ents <-- total number of associated entities
98 *
99 * returns:
100 * block size and range info structure
101 *----------------------------------------------------------------------------*/
102
103 cs_block_dist_info_t
104 cs_block_dist_compute_sizes_nr(int rank_id,
105 int n_ranks,
106 int n_block_ranks,
107 cs_gnum_t n_g_ents);
108
109 /*----------------------------------------------------------------------------*/
110
111 END_C_DECLS
112
113 #endif /* __CS_BLOCK_DIST_H__ */