7.0
general documentation
cs_halo.c File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_order.h"
#include "cs_interface.h"
#include "cs_rank_neighbors.h"
#include "fvm_periodicity.h"
#include "cs_halo.h"
+ Include dependency graph for cs_halo.c:

Functions

cs_halo_tcs_halo_create (const cs_interface_set_t *ifs)
 Create a halo structure given an interface set. More...
 
cs_halo_tcs_halo_create_from_ref (const cs_halo_t *ref)
 Create a halo structure, given a reference halo. More...
 
cs_halo_tcs_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_id[], const cs_lnum_t elt_id[])
 Create a halo structure from distant element distant ranks and ids. More...
 
void cs_halo_destroy (cs_halo_t **halo)
 
void cs_halo_update_buffers (const cs_halo_t *halo)
 
void cs_halo_free_buffer (void)
 
void cs_halo_renumber_cells (cs_halo_t *halo, const cs_lnum_t new_cell_id[])
 
void cs_halo_renumber_ghost_cells (cs_halo_t *halo, const cs_lnum_t old_cell_id[])
 
void cs_halo_sync_untyped (const cs_halo_t *halo, cs_halo_type_t sync_mode, size_t size, void *val)
 
void cs_halo_sync_num (const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_lnum_t num[])
 
void cs_halo_sync_var (const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_real_t var[])
 
void cs_halo_sync_var_strided (const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_real_t var[], int stride)
 
void cs_halo_sync_component (const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_halo_rotation_t rotation_op, cs_real_t var[])
 
void cs_halo_sync_components_strided (const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_halo_rotation_t rotation_op, cs_real_t var[], int stride)
 
bool cs_halo_get_use_barrier (void)
 
void cs_halo_set_use_barrier (bool use_barrier)
 
void cs_halo_dump (const cs_halo_t *halo, int print_level)
 

Function Documentation

◆ cs_halo_create()

cs_halo_t* cs_halo_create ( const cs_interface_set_t ifs)

Create a halo structure given an interface set.

Parameters
[in]ifspointer to a cs_interface_set structure
Returns
pointer to created cs_halo_t structure

◆ cs_halo_create_from_rank_neighbors()

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_id[],
const cs_lnum_t  elt_id[] 
)

Create a halo structure from distant element distant ranks and ids.

Remarks
This function does not handle periodicity. For most matrix-vector, products and similar operations, periodicity of translation an even rotation could be handled with no specific halo information, simply by assigning an equivalence between two periodic elements. For rotation, this would require also applying a rotation through the matrix coefficients (this would have the advantage of being compatible with external libraries). An alternative would be to add rotation information to a given halo as a second stage, through a specialized operator which can be added in the future.
Parameters
[in]rnassociated rank neighbors info
[in]n_local_eltsnumber of elements for local rank
[in]n_distant_eltsnumber of distant elements for local rank
[in]elt_rank_iddistant element rank index in rank neighbors, ordered by rank (size: n_distant_elts)
[in]elt_iddistant element id (at distant rank), ordered by rank (size: n_distant_elts)
Returns
pointer to created cs_halo_t structure

◆ cs_halo_create_from_ref()

cs_halo_t* cs_halo_create_from_ref ( const cs_halo_t ref)

Create a halo structure, given a reference halo.

Parameters
[in]refpointer to reference halo
Returns
pointer to created cs_halo_t structure

◆ cs_halo_destroy()

void cs_halo_destroy ( cs_halo_t **  halo)

brief Destroy a halo structure.

Parameters
[in,out]halopointer to pointer to cs_halo structure to destroy.

◆ cs_halo_dump()

void cs_halo_dump ( const cs_halo_t halo,
int  print_level 
)

◆ cs_halo_free_buffer()

void cs_halo_free_buffer ( void  )

◆ cs_halo_get_use_barrier()

bool cs_halo_get_use_barrier ( void  )

◆ cs_halo_renumber_cells()

void cs_halo_renumber_cells ( cs_halo_t halo,
const cs_lnum_t  new_cell_id[] 
)

◆ cs_halo_renumber_ghost_cells()

void cs_halo_renumber_ghost_cells ( cs_halo_t halo,
const cs_lnum_t  old_cell_id[] 
)

◆ cs_halo_set_use_barrier()

void cs_halo_set_use_barrier ( bool  use_barrier)

◆ cs_halo_sync_component()

void cs_halo_sync_component ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
cs_halo_rotation_t  rotation_op,
cs_real_t  var[] 
)

◆ cs_halo_sync_components_strided()

void cs_halo_sync_components_strided ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
cs_halo_rotation_t  rotation_op,
cs_real_t  var[],
int  stride 
)

◆ cs_halo_sync_num()

void cs_halo_sync_num ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
cs_lnum_t  num[] 
)

◆ cs_halo_sync_untyped()

void cs_halo_sync_untyped ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
size_t  size,
void *  val 
)

◆ cs_halo_sync_var()

void cs_halo_sync_var ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
cs_real_t  var[] 
)

◆ cs_halo_sync_var_strided()

void cs_halo_sync_var_strided ( const cs_halo_t halo,
cs_halo_type_t  sync_mode,
cs_real_t  var[],
int  stride 
)

◆ cs_halo_update_buffers()

void cs_halo_update_buffers ( const cs_halo_t halo)