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)
94# define MPI_INFO_NULL 0
99#if defined(HAVE_OPENMP)
104#undef HAVE_OPENMP_SIMD
105#define HAVE_OPENMP_SIMD 1
112#if defined(HAVE_CUDA)
114#elif defined(HAVE_SYCL)
116#elif defined(HAVE_OPENMP_TARGET)
128#if !defined(__STDC_VERSION__)
129# define __STDC_VERSION__ 1989
137#if (__STDC_VERSION__ < 199901L)
139# if defined(__GNUC__)
140# define inline __inline__
141# define restrict __restrict__
151# ifndef HAVE_RESTRICT
159#if defined(__GNUC__) || defined(__clang__)
160# define DEPRECATED __attribute__((deprecated))
161#elif defined(_MSC_VER)
162# define DEPRECATED __declspec(deprecated)
191# include <inttypes.h>
198#if defined(HAVE_SYS_TYPES_H)
199#include <sys/types.h>
209# define _Bool signed char;
217# define __bool_true_false_are_defined 1
222#if !defined(HAVE_INT32_T)
223# if (SIZEOF_INT == 4)
225# elif (SIZEOF_SHORT == 4)
226typedef short int32_t;
234#if !defined(HAVE_INT64_T)
235# if (SIZEOF_INT == 8)
237# elif (SIZEOF_LONG == 8)
239# elif (HAVE_LONG_LONG == 8)
240typedef long long int64_t;
248#if !defined(HAVE_UINT32_T)
249# if (SIZEOF_INT == 4)
250typedef unsigned uint32_t;
251# elif (SIZEOF_SHORT == 4)
252typedef unsigned short uint32_t;
260#if !defined(HAVE_UINT64_T)
261# if (SIZEOF_INT == 8)
262typedef unsigned uint64_t;
263# elif (SIZEOF_LONG == 8)
264typedef unsigned long uint64_t;
265# elif (HAVE_LONG_LONG)
266typedef unsigned long long uint64_t;
311#if defined(HAVE_LONG_GNUM)
312 #if (SIZEOF_LONG == 8)
313 typedef unsigned long cs_gnum_t;
314 #elif (SIZEOF_LONG_LONG == 8)
315 typedef unsigned long long cs_gnum_t;
320 typedef unsigned cs_gnum_t;
325#if defined(HAVE_LONG_LNUM)
399#if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
401# define CS_MPI_REAL MPI_DOUBLE
405# if defined(HAVE_LONG_GNUM)
406# if (SIZEOF_LONG == 8)
407# define CS_MPI_GNUM MPI_UNSIGNED_LONG
408# elif (SIZEOF_LONG_LONG == 8)
409# if defined(MPI_UNSIGNED_LONG_LONG)
410# define CS_MPI_GNUM MPI_UNSIGNED_LONG_LONG
411# elif defined(MPI_LONG_LONG)
412# define CS_MPI_GNUM MPI_LONG_LONG
415# if !defined(CS_MPI_GNUM)
419# define CS_MPI_GNUM MPI_UNSIGNED
424# if defined(HAVE_LONG_LNUM)
425# define CS_MPI_LNUM MPI_LONG
427# define CS_MPI_LNUM MPI_INT
430# define CS_MPI_EFLAG MPI_UNSIGNED
431# define CS_MPI_FLAG MPI_UNSIGNED_SHORT
432# define CS_MPI_COORD MPI_DOUBLE
439#if defined(HAVE_LONG_GNUM)
440# define CS_GNUM_TYPE CS_UINT64
441#elif (SIZEOF_INT == 8)
442# define CS_GNUM_TYPE CS_UINT64
444# define CS_GNUM_TYPE CS_UINT32
447#if defined(HAVE_LONG_LNUM)
448# if (SIZEOF_LONG == 8)
449# define CS_LNUM_TYPE CS_INT64
451# define CS_LNUM_TYPE CS_INT32
454# if (SIZEOF_INT == 8)
455# define CS_LNUM_TYPE CS_INT64
457# define CS_LNUM_TYPE CS_INT32
462# define CS_INT_TYPE CS_INT64
464# define CS_INT_TYPE CS_INT32
468# define CS_UINT_TYPE CS_UINT64
470# define CS_UINT_TYPE CS_UINT32
473#define CS_FLAG_TYPE CS_UINT16
474#define CS_EFLAG_TYPE CS_UINT_TYPE
475#define CS_REAL_TYPE CS_DOUBLE
476#define CS_COORD_TYPE CS_DOUBLE
482#define CS_THR_MIN 128
493#define CS_ABS(a) ((a) < 0 ? -(a) : (a))
494#define CS_MIN(a,b) ((a) < (b) ? (a) : (b))
495#define CS_MAX(a,b) ((a) > (b) ? (a) : (b))
517#define CS_UNUSED(x) (void)(x)
518#define CS_NO_WARN_IF_UNUSED(x) (void)(x)
527#if defined(__cplusplus)
528# define BEGIN_C_DECLS extern "C" {
529# define END_C_DECLS }
531# define BEGIN_C_DECLS
541#define CS_F_HOST __host__
542#define CS_F_DEVICE __device__
543#define CS_F_HOST_DEVICE __host__ __device__
549#define CS_F_HOST_DEVICE
563#define CS_PROCF(x, y) x##_
565#define CS_PROCF(x, y) x
575#define CS_ARGF_SUPP_CHAINE , ...
592#if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
609#if defined(HAVE_MPI) && !defined(CS_IGNORE_MPI)
651 return ((i > 0) ? ((i-1)/m+1)*m : 0);
666#if defined(HAVE_OPENMP)
667 return omp_get_thread_num();
int cs_glob_n_ranks
Definition cs_defs.c:175
const char * cs_datatype_name[]
Definition cs_defs.c:143
const size_t cs_datatype_size[]
Definition cs_defs.c:133
int cs_glob_node_rank_id
Definition cs_defs.c:177
const char cs_empty_string[]
Definition cs_defs.c:129
int cs_glob_n_threads
Definition cs_defs.c:172
int cs_glob_node_n_ranks
Definition cs_defs.c:178
MPI_Datatype cs_datatype_to_mpi[]
Definition cs_defs.c:157
MPI_Comm cs_glob_mpi_comm
Definition cs_defs.c:183
int cs_glob_rank_id
Definition cs_defs.c:174
cs_datatype_t
Definition cs_defs.h:284
@ CS_FLOAT
Definition cs_defs.h:288
@ CS_CHAR
Definition cs_defs.h:287
@ CS_UINT16
Definition cs_defs.h:290
@ CS_INT64
Definition cs_defs.h:292
@ CS_UINT64
Definition cs_defs.h:294
@ CS_DOUBLE
Definition cs_defs.h:289
@ CS_UINT32
Definition cs_defs.h:293
@ CS_INT32
Definition cs_defs.h:291
@ CS_DATATYPE_NULL
Definition cs_defs.h:286
cs_lnum_t cs_lnum_3_t[3]
Definition cs_defs.h:341
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition cs_defs.h:357
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition cs_defs.h:356
char cs_byte_t
Definition cs_defs.h:333
void * cs_destructor_t(void *s)
Destroy a given structure.
Definition cs_defs.h:627
cs_real_t cs_real_69_t[6][9]
Definition cs_defs.h:366
cs_nreal_t cs_nreal_3_t[3]
Definition cs_defs.h:373
double cs_real_t
Floating-point value.
Definition cs_defs.h:332
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition cs_defs.h:340
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:661
cs_real_t cs_real_10_t[10]
Definition cs_defs.h:352
cs_real_t cs_real_99_t[9][9]
Definition cs_defs.h:358
double cs_coord_t
Definition cs_defs.h:330
cs_real_t cs_real_34_t[3][4]
Definition cs_defs.h:362
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition cs_defs.h:346
cs_coord_t cs_coord_3_t[3]
Definition cs_defs.h:343
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition cs_defs.h:349
cs_real_66_t cs_real_662_t[2]
Definition cs_defs.h:370
cs_real_33_t cs_real_332_t[2]
vector of 2 3x3 matrices of floating-point values
Definition cs_defs.h:368
cs_interlace_t
Definition cs_defs.h:500
@ CS_INTERLACE
Definition cs_defs.h:502
@ CS_NO_INTERLACE
Definition cs_defs.h:503
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:645
cs_real_t cs_real_4_t[4]
vector of 4 floating-point values
Definition cs_defs.h:348
cs_real_t cs_real_333_t[3][3][3]
Definition cs_defs.h:360
cs_real_t cs_real_63_t[6][3]
Definition cs_defs.h:364
double cs_nreal_t
Definition cs_defs.h:336
cs_real_t cs_real_9_t[9]
Definition cs_defs.h:351
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:325
cs_real_t cs_real_23_t[2][3]
Definition cs_defs.h:354
unsigned short int cs_flag_t
Definition cs_defs.h:334
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:347
double val
Definition cs_defs.h:378
int id
Definition cs_defs.h:379
double meas
Definition cs_defs.h:388
double unitv[3]
Definition cs_defs.h:389