1 #ifndef __CS_PARALL_H__ 2 #define __CS_PARALL_H__ 52 #if defined(HAVE_MPI_IN_PLACE) 59 MPI_Allreduce(MPI_IN_PLACE, cpt, n,
CS_MPI_GNUM, MPI_SUM,
64 #elif defined(HAVE_MPI) 72 #define cs_parall_counter(_cpt, _n) 84 #if defined(HAVE_MPI_IN_PLACE) 91 MPI_Allreduce(MPI_IN_PLACE, cpt, n,
CS_MPI_LNUM, MPI_MAX,
96 #elif defined(HAVE_MPI) 104 #define cs_parall_counter_max(_cpt, _n) 117 #if defined(HAVE_MPI_IN_PLACE) 130 #elif defined(HAVE_MPI) 139 #define cs_parall_sum(_n, _datatype, _val) { }; 152 #if defined(HAVE_MPI_IN_PLACE) 165 #elif defined(HAVE_MPI) 174 #define cs_parall_max(_n, _datatype, _val); 187 #if defined(HAVE_MPI_IN_PLACE) 200 #elif defined(HAVE_MPI) 209 #define cs_parall_min(_n, _datatype, _val); 225 #if defined(HAVE_MPI) 228 cs_parall_bcast(
int root_rank,
240 #define cs_parall_bcast(_root_rank, _n, _datatype, _val); 436 const float g_array[],
535 #if defined(HAVE_OPENMP) 536 const int t_id = omp_get_thread_num();
537 const int n_t = omp_get_num_threads();
538 const cs_lnum_t t_n = (n + n_t - 1) / n_t;
542 *e_id = (t_id+1) * t_n;
543 *s_id = cs_align(*s_id, cl_m);
544 *e_id = cs_align(*e_id, cl_m);
545 if (*e_id > n) *e_id = n;
cs_datatype_t
Definition: cs_defs.h:275
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:301
void cs_parall_gather_r(int root_rank, int n_elts, int n_g_elts, const cs_real_t array[], cs_real_t g_array[])
Build a global array on the given root rank from all local arrays.
Definition: cs_parall.c:1008
#define CS_CL_SIZE
Definition: cs_defs.h:466
void cs_parall_allgather_ordered_r(int n_elts, int n_g_elts, int stride, cs_real_t o_key[], cs_real_t array[], cs_real_t g_array[])
Build an ordered global array from each local array in each domain.
Definition: cs_parall.c:964
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_parall_scatter_r(int root_rank, int n_elts, int n_g_elts, const cs_real_t g_array[], cs_real_t array[])
Distribute a global array from a given root rank over all ranks. Each rank receive the part related t...
Definition: cs_parall.c:1124
#define CS_UNUSED(x)
Definition: cs_defs.h:496
void cs_parall_gather_f(int root_rank, int n_elts, int n_g_elts, const float array[], float g_array[])
Build a global array on the given root rank from all local arrays. Function dealing with single-preci...
Definition: cs_parall.c:1189
int cs_glob_n_ranks
Definition: cs_defs.c:175
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
void cs_parall_min_loc_vals(int n, cs_real_t *min, cs_real_t min_loc_vals[])
Minimum value of a real and the value of related array on all default communicator processes...
Definition: cs_parall.c:794
MPI_Datatype cs_datatype_to_mpi[]
Definition: cs_defs.c:157
size_t cs_parall_get_min_coll_buf_size(void)
Return minimum recommended scatter or gather buffer size.
Definition: cs_parall.c:1309
void cs_parall_min_id_rank_r(cs_lnum_t *elt_id, int *rank_id, cs_real_t dis2mn)
Given an (id, rank, value) tuple, return the local id and rank corresponding to the global minimum va...
Definition: cs_parall.c:833
void cs_parall_scatter_f(int root_rank, int n_elts, int n_g_elts, const float g_array[], float array[])
Distribute a global array from a given root rank over all ranks. Each rank receive the part related t...
Definition: cs_parall.c:1254
#define CS_MPI_GNUM
Definition: cs_defs.h:386
void cs_parall_gather_ordered_r(int root_rank, int n_elts, int n_g_elts, int stride, cs_real_t o_key[], cs_real_t array[], cs_real_t g_array[])
Build an ordered global array on the given root rank from all local arrays.
Definition: cs_parall.c:1075
void cs_parall_set_min_coll_buf_size(size_t buffer_size)
Define minimum recommended scatter or gather buffer size.
Definition: cs_parall.c:1331
MPI_Comm cs_glob_mpi_comm
Definition: cs_defs.c:183
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
void cs_parall_max_loc_vals(int n, cs_real_t *max, cs_real_t max_loc_vals[])
Maximum value of a real and the value of related array on all default communicator processes...
Definition: cs_parall.c:756
#define CS_MPI_LNUM
Definition: cs_defs.h:406
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_parall_allgather_r(int n_elts, int n_g_elts, cs_real_t array[], cs_real_t g_array[])
Build a global array from each local array in each domain.
Definition: cs_parall.c:887