255 const int elt_rank_idx[],
257 const int16_t elt_tr_id[],
285 const int elt_rank_idx[],
446#if defined(HAVE_ACCEL)
471cs_halo_sync_pack_d(
const cs_halo_t *halo,
549#if defined(HAVE_ACCEL)
791template <
int Str
ide,
typename T>
822template <
int Str
ide,
typename T>
838template<
typename T,
int N>
844 [[maybe_unused]]
bool on_device,
848 static_assert(N == 1 || N == 2,
849 "Only possible for arrays of dim 1 or 2.");
856 T *val = span.
data();
858 int Stride = (N == 1) ? 1 : span.
extent(1);
860#if defined(HAVE_ACCEL)
862 cs_halo_sync_pack_d(halo,
895template<
typename T,
int N>
900 [[maybe_unused]]
bool on_device,
919template<
typename T,
int N>
929 cs_halo_sync<T, N>(halo, sync_mode, on_device, span);
945template<
typename T,
int N>
1000template <
typename T>
1024template <
typename T>
1050template <
typename T>
1074template <
typename T>
1093template<
typename T,
int N>
1099 [[maybe_unused]]
bool on_device,
1103 static_assert(N == 1 || N == 2,
1104 "Only possible for arrays of dim 1 or 2.");
1106 int stride = (N == 1) ? 1 : span.
extent(1);
1110 t3_t *val_v = (t3_t *)span.
data();
1113 else if (stride == 6) {
1115 t6_t *val_t = (t6_t *)span.
data();
1136template<
typename T,
int N>
1145 static_assert(N == 1 || N == 2,
1146 "Only possible for arrays of dim 1 or 2.");
1149 int stride = (N == 1) ? 1 : span.
extent(1);
1153 t3_t *val_v = (t3_t *)span.
data();
1156 else if (stride == 6) {
1158 t6_t *val_t = (t6_t *)span.
data();
Define a templated mdspan class (non owner of data)
Definition: cs_mdspan.h:68
CS_F_HOST_DEVICE T * data() const
Getter for data raw pointer.
Definition: cs_mdspan.h:561
CS_F_HOST_DEVICE cs_lnum_t extent(int i) const
Getter for extent along a given dimension.
Definition: cs_mdspan.h:525
const size_t cs_datatype_size[]
Definition: cs_defs.cpp:129
cs_datatype_t
Definition: cs_defs.h:290
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
bool cs_halo_get_use_barrier(void)
Definition: cs_halo.cpp:2412
void cs_halo_sync_pack(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_datatype_t data_type, int stride, void *val, void *send_buf, cs_halo_state_t *hs)
Pack halo data to send into dense buffer.
Definition: cs_halo.cpp:1739
cs_halo_state_t * cs_halo_state_create(void)
Create a halo state structure.
Definition: cs_halo.cpp:1353
cs_halo_comm_mode_t
Definition: cs_halo.h:63
@ CS_HALO_COMM_P2P
Definition: cs_halo.h:65
@ CS_HALO_COMM_RMA_GET
Definition: cs_halo.h:66
void cs_halo_state_destroy(cs_halo_state_t **halo_state)
Destroy a halo state structure.
Definition: cs_halo.cpp:1406
void cs_halo_sync_start(const cs_halo_t *halo, void *val, cs_halo_state_t *hs)
Launch update array of values in case of parallelism or periodicity.
Definition: cs_halo.cpp:1957
cs_halo_comm_mode_t cs_halo_get_comm_mode(void)
Get default communication mode for halo exchange.
Definition: cs_halo.cpp:2440
void cs_halo_sync(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_datatype_t data_type, int stride, void *val)
Update array of values in case of parallelism or periodicity.
Definition: cs_halo.cpp:2240
void * cs_halo_get_default_buffer(size_t size)
Return pointer to working send buffer used by default halo state.
Definition: cs_halo.cpp:2508
void cs_halo_set_comm_mode(cs_halo_comm_mode_t mode)
Set default communication mode for halo exchange.
Definition: cs_halo.cpp:2454
cs_alloc_mode_t cs_halo_get_buffer_alloc_mode(void)
Get default host/device allocation mode for message packing arrays.
Definition: cs_halo.cpp:2469
void cs_halo_renumber_cells(cs_halo_t *halo, const cs_lnum_t new_cell_id[])
Definition: cs_halo.cpp:1455
cs_halo_t * cs_halo_create_from_ref(const cs_halo_t *ref)
Create a halo structure, given a reference halo.
Definition: cs_halo.cpp:864
void cs_halo_dump(const cs_halo_t *halo, int print_level)
Definition: cs_halo.cpp:2535
size_t cs_halo_pack_size(const cs_halo_t *halo, cs_datatype_t data_type, int stride)
Compute required size for packing send data into dense buffer.
Definition: cs_halo.h:349
cs_halo_t * cs_halo_create(const cs_interface_set_t *ifs)
Create a halo structure given an interface set.
Definition: cs_halo.cpp:608
void cs_halo_sync_wait(const cs_halo_t *halo, void *val, cs_halo_state_t *hs)
Wait for completion of update array of values in case of parallelism or periodicity.
Definition: cs_halo.cpp:2130
void cs_halo_set_use_barrier(bool use_barrier)
Definition: cs_halo.cpp:2426
cs_halo_type_t
Definition: cs_halo.h:53
@ CS_HALO_N_TYPES
Definition: cs_halo.h:57
@ CS_HALO_STANDARD
Definition: cs_halo.h:55
@ CS_HALO_EXTENDED
Definition: cs_halo.h:56
void * cs_halo_sync_pack_init_state(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_datatype_t data_type, int stride, void *send_buf, cs_halo_state_t *hs)
Initialize halo state prior to packing halo data to send.
Definition: cs_halo.cpp:1641
void cs_halo_create_complete(cs_halo_t *halo)
Ready halo for use.
Definition: cs_halo.cpp:753
void cs_halo_sync_untyped(const cs_halo_t *halo, cs_halo_type_t sync_mode, size_t size, void *val)
Definition: cs_halo.cpp:2328
cs_halo_state_t * cs_halo_state_get_default(void)
Get pointer to default halo state structure.
Definition: cs_halo.cpp:1441
void cs_halo_set_buffer_alloc_mode(cs_alloc_mode_t mode)
Set default host/device allocation mode for message packing arrays.
Definition: cs_halo.cpp:2483
void cs_halo_sync_var(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_real_t var[])
Definition: cs_halo.cpp:2372
void cs_halo_sync_num(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_lnum_t num[])
Definition: cs_halo.cpp:2350
void cs_halo_sync_r(const cs_halo_t *halo, cs_halo_type_t sync_mode, bool on_device, T val[][3])
Update ghost cell values of a spatial vector field, including rotational periodicity if present.
Definition: cs_halo.cpp:2880
void cs_halo_renumber_ghost_cells(cs_halo_t *halo, const cs_lnum_t old_cell_id[])
Definition: cs_halo.cpp:1479
void cs_halo_sync_var_strided(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_real_t var[], int stride)
Definition: cs_halo.cpp:2395
cs_halo_t * cs_halo_create_from_rank_neighbors(const cs_rank_neighbors_t *rn, cs_lnum_t n_local_elts, cs_lnum_t n_distant_elts, const int elt_rank_idx[], const cs_lnum_t elt_id[], const int16_t elt_tr_id[], const fvm_periodicity_t *periodicity)
Create a halo structure from distant element distant ranks and ids.
Definition: cs_halo.cpp:954
void cs_halo_destroy(cs_halo_t **halo)
Definition: cs_halo.cpp:1306
struct _cs_halo_state_t cs_halo_state_t
Definition: cs_halo.h:175
struct _cs_interface_set_t cs_interface_set_t
Definition: cs_interface.h:57
bool cs_mem_is_device_ptr(const void *ptr)
Check if a pointer is a device (or shared) pointer.
Definition: cs_mem.h:753
cs_alloc_mode_t
Definition: cs_mem.h:46
struct _fvm_periodicity_t fvm_periodicity_t
Definition: fvm_periodicity.h:63
int n_transforms
Definition: cs_halo.h:77
cs_lnum_t * index
Definition: cs_halo.h:121
cs_lnum_t * send_list
Definition: cs_halo.h:95
cs_lnum_t * send_index
Definition: cs_halo.h:98
int n_rotations
Definition: cs_halo.h:84
cs_lnum_t * std_send_blocks
Definition: cs_halo.h:112
cs_lnum_t n_local_elts
Definition: cs_halo.h:87
cs_lnum_t n_std_send_blocks
Definition: cs_halo.h:110
int n_c_domains
Definition: cs_halo.h:76
int * c_domain_rank
Definition: cs_halo.h:79
cs_lnum_t * perio_lst
Definition: cs_halo.h:126
cs_lnum_t std_send_block_size
Definition: cs_halo.h:109
cs_lnum_t * send_perio_lst
Definition: cs_halo.h:103
const fvm_periodicity_t * periodicity
Definition: cs_halo.h:81
MPI_Group c_domain_group
Definition: cs_halo.h:166
cs_lnum_t * c_domain_s_shift
Definition: cs_halo.h:167
cs_lnum_t n_send_elts[2]
Definition: cs_halo.h:91
Definition: cs_rank_neighbors.h:63