1
#ifndef __CS_NUMBERING_H__
2
#define __CS_NUMBERING_H__
4
/*============================================================================
5
* Numbering information for vectorization or multithreading
6
*============================================================================*/
9
This file is part of Code_Saturne, a general-purpose CFD tool.
11
Copyright (C) 1998-2011 EDF S.A.
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
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
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.
28
/*----------------------------------------------------------------------------*/
30
/*----------------------------------------------------------------------------
32
*----------------------------------------------------------------------------*/
36
/*----------------------------------------------------------------------------
38
*----------------------------------------------------------------------------*/
42
/*----------------------------------------------------------------------------*/
46
/*============================================================================
48
*============================================================================*/
50
/*============================================================================
52
*============================================================================*/
54
/* Renumbering types */
58
CS_NUMBERING_VECTORIZE, /* Numbered for vectorization */
59
CS_NUMBERING_THREADS /* Numbered for threads */
61
} cs_numbering_type_t;
63
/* Renumbering structure */
67
cs_numbering_type_t type; /* Numbering type */
69
int vector_size; /* Vector size if vectorized, 1 otherwise */
71
int n_threads; /* Number of threads */
72
int n_groups; /* Number of associated groups */
74
fvm_lnum_t *group_index; /* For thread t and group g, the start and end
75
ids for entities in a given group and thread
76
are group_index[t*n_groups*2 + g] and
77
group_index[t*n_groups*2 + g + 1] respectively.
78
(size: n_groups * n_threads * 2) */
82
/*=============================================================================
83
* Global variable definitions
84
*============================================================================*/
86
/* Names for numbering types */
88
extern const char *cs_numbering_type_name[];
90
/*============================================================================
91
* Public function prototypes for Fortran API
92
*============================================================================*/
94
/*=============================================================================
95
* Public function prototypes
96
*============================================================================*/
98
/*----------------------------------------------------------------------------
99
* Create a numbering information structure in case of vectorization.
102
* vector_size <-- vector size used for this vectorization
105
* pointer to created cs_numbering_t structure
106
*---------------------------------------------------------------------------*/
109
cs_numbering_create_vectorized(int vector_size);
111
/*----------------------------------------------------------------------------
112
* Create a numbering information structure in case of threading.
115
* n_threads <-- number of threads
116
* n_groups <-- number of groups
117
* group_index <-- group_index[thread_id*group_id*2 + group_id*2] and
118
* group_index[thread_id*group_id*2 + group_id*2 +1] define
119
* the start and end ids for entities in a given group and
120
* thread; (size: n_groups *2 * n_threads)
123
* pointer to created cs_numbering_t structure
124
*---------------------------------------------------------------------------*/
127
cs_numbering_create_threaded(int n_threads,
129
fvm_lnum_t group_index[]);
131
/*----------------------------------------------------------------------------
132
* Destroy a numbering information structure.
135
* numbering <-> pointer to cs_numbering_t structure pointer (or NULL)
136
*---------------------------------------------------------------------------*/
139
cs_numbering_destroy(cs_numbering_t **numbering);
141
/*----------------------------------------------------------------------------
142
* Dump a cs_numbering_t structure.
145
* numbering <-- pointer to cs_numbering_t structure (or NULL)
146
*---------------------------------------------------------------------------*/
149
cs_numbering_dump(const cs_numbering_t *numbering);
151
/*----------------------------------------------------------------------------*/
155
#endif /* __CS_NUMBERING_H__ */