34 #if defined(HAVE_CONFIG_H)
35 # include "cs_config.h"
49 #if defined(ENABLE_NLS) && defined(HAVE_GETTEXT)
52 # define _(String) dgettext(PACKAGE, String)
54 # define N_(String) gettext_noop(String)
56 # define N_(String) String
66 # define _(String) (String)
67 # define N_(String) String
68 # define textdomain(String) (String)
69 # define gettext(String) (String)
70 # define dgettext(Domain,String) (String)
71 # define dcgettext(Domain,String,Type) (String)
72 # define bindtextdomain(Domain, Directory) (Domain)
84 #if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
88 # if !defined(MPI_VERSION)
89 # define MPI_VERSION 1
94 # define MPI_INFO_NULL 0
99 #if defined(HAVE_OPENMP)
103 #if _OPENMP >= 201307
104 #undef HAVE_OPENMP_SIMD
105 #define HAVE_OPENMP_SIMD 1
112 #if defined(HAVE_CUDA)
114 #elif defined(HAVE_OPENMP_TARGET)
126 #if !defined(__STDC_VERSION__)
127 # define __STDC_VERSION__ 1989
135 #if (__STDC_VERSION__ < 199901L)
137 # if defined(__GNUC__)
138 # define inline __inline__
139 # define restrict __restrict__
149 # ifndef HAVE_RESTRICT
178 #elif HAVE_INTTYPES_H
179 # include <inttypes.h>
186 #if defined(HAVE_SYS_TYPES_H)
187 #include <sys/types.h>
193 # include <stdbool.h>
197 # define _Bool signed char;
205 # define __bool_true_false_are_defined 1
210 #if !defined(HAVE_INT32_T)
211 # if (SIZEOF_INT == 4)
213 # elif (SIZEOF_SHORT == 4)
214 typedef short int32_t;
222 #if !defined(HAVE_INT64_T)
223 # if (SIZEOF_INT == 8)
225 # elif (SIZEOF_LONG == 8)
226 typedef long int64_t;
227 # elif (HAVE_LONG_LONG == 8)
228 typedef long long int64_t;
236 #if !defined(HAVE_UINT32_T)
237 # if (SIZEOF_INT == 4)
238 typedef unsigned uint32_t;
239 # elif (SIZEOF_SHORT == 4)
240 typedef unsigned short uint32_t;
248 #if !defined(HAVE_UINT64_T)
249 # if (SIZEOF_INT == 8)
250 typedef unsigned uint64_t;
251 # elif (SIZEOF_LONG == 8)
252 typedef unsigned long uint64_t;
253 # elif (HAVE_LONG_LONG)
254 typedef unsigned long long uint64_t;
299 #if defined(HAVE_LONG_GNUM)
300 #if (SIZEOF_LONG == 8)
302 #elif (SIZEOF_LONG_LONG == 8)
313 #if defined(HAVE_LONG_LNUM)
380 #if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
382 # define CS_MPI_REAL MPI_DOUBLE
386 # if defined(HAVE_LONG_GNUM)
387 # if (SIZEOF_LONG == 8)
388 # define CS_MPI_GNUM MPI_UNSIGNED_LONG
389 # elif (SIZEOF_LONG_LONG == 8)
390 # if defined(MPI_UNSIGNED_LONG_LONG)
391 # define CS_MPI_GNUM MPI_UNSIGNED_LONG_LONG
392 # elif defined(MPI_LONG_LONG)
393 # define CS_MPI_GNUM MPI_LONG_LONG
396 # if !defined(CS_MPI_GNUM)
400 # define CS_MPI_GNUM MPI_UNSIGNED
405 # if defined(HAVE_LONG_LNUM)
406 # define CS_MPI_LNUM MPI_LONG
408 # define CS_MPI_LNUM MPI_INT
411 # define CS_MPI_EFLAG MPI_UNSIGNED
412 # define CS_MPI_FLAG MPI_UNSIGNED_SHORT
413 # define CS_MPI_COORD MPI_DOUBLE
420 #if defined(HAVE_LONG_GNUM)
421 # define CS_GNUM_TYPE CS_UINT64
422 #elif (SIZEOF_INT == 8)
423 # define CS_GNUM_TYPE CS_UINT64
425 # define CS_GNUM_TYPE CS_UINT32
428 #if defined(HAVE_LONG_LNUM)
429 # if (SIZEOF_LONG == 8)
430 # define CS_LNUM_TYPE CS_INT64
432 # define CS_LNUM_TYPE CS_INT32
435 # if (SIZEOF_INT == 8)
436 # define CS_LNUM_TYPE CS_INT64
438 # define CS_LNUM_TYPE CS_INT32
442 #if (SIZEOF_INT == 8)
443 # define CS_INT_TYPE CS_INT64
445 # define CS_INT_TYPE CS_INT32
448 #if (SIZEOF_INT == 8)
449 # define CS_UINT_TYPE CS_UINT64
451 # define CS_UINT_TYPE CS_UINT32
454 #define CS_FLAG_TYPE CS_UINT16
455 #define CS_EFLAG_TYPE CS_UINT_TYPE
456 #define CS_REAL_TYPE CS_DOUBLE
457 #define CS_COORD_TYPE CS_DOUBLE
463 #define CS_THR_MIN 128
468 #define CS_CL_SIZE 64
474 #define CS_ABS(a) ((a) < 0 ? -(a) : (a))
475 #define CS_MIN(a,b) ((a) < (b) ? (a) : (b))
476 #define CS_MAX(a,b) ((a) > (b) ? (a) : (b))
498 #define CS_UNUSED(x) (void)(x)
499 #define CS_NO_WARN_IF_UNUSED(x) (void)(x)
508 #if defined(__cplusplus)
509 # define BEGIN_C_DECLS extern "C" {
510 # define END_C_DECLS }
512 # define BEGIN_C_DECLS
525 #if !defined (__hpux)
526 #define CS_PROCF(x, y) x##_
528 #define CS_PROCF(x, y) x
538 #define CS_ARGF_SUPP_CHAINE , ...
555 #if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
572 #if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
597 return ((i > 0) ? ((i-1)/m+1)*m : 0);
612 #if defined(HAVE_OPENMP)
613 return omp_get_thread_num();
int cs_glob_n_ranks
Definition: cs_defs.c:175
cs_datatype_t
Definition: cs_defs.h:272
@ CS_FLOAT
Definition: cs_defs.h:276
@ CS_CHAR
Definition: cs_defs.h:275
@ CS_UINT16
Definition: cs_defs.h:278
@ CS_INT64
Definition: cs_defs.h:280
@ CS_UINT64
Definition: cs_defs.h:282
@ CS_DOUBLE
Definition: cs_defs.h:277
@ CS_UINT32
Definition: cs_defs.h:281
@ CS_INT32
Definition: cs_defs.h:279
@ CS_DATATYPE_NULL
Definition: cs_defs.h:274
cs_lnum_t cs_lnum_3_t[3]
Definition: cs_defs.h:326
const char * cs_datatype_name[]
Definition: cs_defs.c:143
char cs_byte_t
Definition: cs_defs.h:320
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
const size_t cs_datatype_size[]
Definition: cs_defs.c:133
cs_real_33_t cs_real_332_t[2]
vector of 2 3x3 matrices of floating-point values
Definition: cs_defs.h:353
int cs_glob_node_rank_id
Definition: cs_defs.c:177
cs_real_t cs_real_69_t[6][9]
Definition: cs_defs.h:351
const char cs_empty_string[]
Definition: cs_defs.c:129
int cs_glob_n_threads
Definition: cs_defs.c:172
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:325
static int cs_get_thread_id(void)
Retrieve the associated thread id (0 if no OpenMP or if outside an OpenMP region)
Definition: cs_defs.h:607
int cs_glob_node_n_ranks
Definition: cs_defs.c:178
cs_real_t cs_real_4_t[4]
vector of 4 floating-point values
Definition: cs_defs.h:333
MPI_Datatype cs_datatype_to_mpi[]
Definition: cs_defs.c:157
cs_real_t cs_real_10_t[10]
Definition: cs_defs.h:337
cs_real_t cs_real_99_t[9][9]
Definition: cs_defs.h:343
double cs_coord_t
Definition: cs_defs.h:317
cs_real_t cs_real_34_t[3][4]
Definition: cs_defs.h:347
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:332
cs_coord_t cs_coord_3_t[3]
Definition: cs_defs.h:328
cs_real_66_t cs_real_662_t[2]
Definition: cs_defs.h:355
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:331
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:298
cs_interlace_t
Definition: cs_defs.h:481
@ CS_INTERLACE
Definition: cs_defs.h:483
@ CS_NO_INTERLACE
Definition: cs_defs.h:484
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:334
static cs_lnum_t cs_align(cs_lnum_t i, cs_lnum_t m)
Given a base index i, return the next index aligned with a size m.
Definition: cs_defs.h:591
cs_real_t cs_real_333_t[3][3][3]
Definition: cs_defs.h:345
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:341
MPI_Comm cs_glob_mpi_comm
Definition: cs_defs.c:183
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
cs_real_t cs_real_63_t[6][3]
Definition: cs_defs.h:349
cs_real_t cs_real_9_t[9]
Definition: cs_defs.h:336
cs_real_t cs_real_23_t[2][3]
Definition: cs_defs.h:339
unsigned short int cs_flag_t
Definition: cs_defs.h:321
int cs_glob_rank_id
Definition: cs_defs.c:174
Definition: cs_defs.h:358
Definition: cs_defs.h:367