My Project
programmer's documentation
Enumerations | Functions
cs_renumber.h File Reference
#include "cs_base.h"
#include "cs_mesh.h"
Include dependency graph for cs_renumber.h:

Go to the source code of this file.

Enumerations

enum  cs_renumber_cells_type_t {
  CS_RENUMBER_CELLS_SCOTCH_PART, CS_RENUMBER_CELLS_SCOTCH_ORDER, CS_RENUMBER_CELLS_METIS_PART, CS_RENUMBER_CELLS_METIS_ORDER,
  CS_RENUMBER_CELLS_MORTON, CS_RENUMBER_CELLS_HILBERT, CS_RENUMBER_CELLS_RCM, CS_RENUMBER_CELLS_NONE
}
 Cell renumbering algorithm types. More...
 
enum  cs_renumber_i_faces_type_t { CS_RENUMBER_I_FACES_BLOCK, CS_RENUMBER_I_FACES_MULTIPASS, CS_RENUMBER_I_FACES_SIMD, CS_RENUMBER_I_FACES_NONE }
 Interior faces renumbering algorithm types. More...
 
enum  cs_renumber_b_faces_type_t { CS_RENUMBER_B_FACES_THREAD, CS_RENUMBER_B_FACES_SIMD, CS_RENUMBER_B_FACES_NONE }
 Boundary faces renumbering algorithm types. More...
 
enum  cs_renumber_vertices_type_t { CS_RENUMBER_VERTICES_BY_CELL_ADJ, CS_RENUMBER_VERTICES_BY_FACE_ADJ, CS_RENUMBER_VERTICES_NONE }
 Vertices renumbering algorithm types. More...
 
enum  cs_renumber_ordering_t { CS_RENUMBER_ADJACENT_LOW, CS_RENUMBER_ADJACENT_HIGH }
 Ordering options for adjacency arrays. More...
 

Functions

void cs_renumber_set_n_threads (int n_threads)
 Set the target number of threads for mesh renumbering. More...
 
int cs_renumber_get_n_threads (void)
 Return the target number of threads for mesh renumbering. More...
 
void cs_renumber_set_min_subset_size (cs_lnum_t min_i_subset_size, cs_lnum_t min_b_subset_size)
 Set the minimum sunset sizes when renumbering for threads. More...
 
void cs_renumber_get_min_subset_size (cs_lnum_t *min_i_subset_size, cs_lnum_t *min_b_subset_size)
 Get the minimum sunset sizes when renumbering for threads. More...
 
void cs_renumber_set_algorithm (bool halo_adjacent_cells_last, bool halo_adjacent_faces_last, cs_renumber_ordering_t i_faces_base_ordering, cs_renumber_cells_type_t cells_pre_numbering, cs_renumber_cells_type_t cells_numbering, cs_renumber_i_faces_type_t i_faces_numbering, cs_renumber_b_faces_type_t b_faces_numbering, cs_renumber_vertices_type_t vertices_numbering)
 Select the algorithm for mesh renumbering. More...
 
void cs_renumber_get_algorithm (bool *halo_adjacent_cells_last, bool *halo_adjacent_faces_last, cs_renumber_ordering_t *i_faces_base_ordering, cs_renumber_cells_type_t *cells_pre_numbering, cs_renumber_cells_type_t *cells_numbering, cs_renumber_i_faces_type_t *i_faces_numbering, cs_renumber_b_faces_type_t *b_faces_numbering, cs_renumber_vertices_type_t *vertices_numbering)
 Return the algorithms for mesh renumbering. More...
 
void cs_renumber_mesh (cs_mesh_t *mesh)
 Renumber mesh elements for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_cells (cs_mesh_t *mesh)
 Renumber cells depending on code options and target machine. More...
 
void cs_renumber_i_faces (cs_mesh_t *mesh)
 Renumber interior faces for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_i_faces_by_gnum (cs_mesh_t *mesh)
 
void cs_renumber_b_faces (cs_mesh_t *mesh)
 Renumber boundary faces for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_b_faces_by_gnum (cs_mesh_t *mesh)
 
void cs_renumber_vertices (cs_mesh_t *mesh)
 Renumber vertices depending on code options and target machine. More...
 

Enumeration Type Documentation

◆ cs_renumber_b_faces_type_t

Boundary faces renumbering algorithm types.

Enumerator
CS_RENUMBER_B_FACES_THREAD 

Renumber for threads, with one block per thread, and no cell referenced by faces in different threads blocks.

CS_RENUMBER_B_FACES_SIMD 
CS_RENUMBER_B_FACES_NONE 

◆ cs_renumber_cells_type_t

Cell renumbering algorithm types.

Enumerator
CS_RENUMBER_CELLS_SCOTCH_PART 

Subpartition for thread blocks based SCOTCH library.

CS_RENUMBER_CELLS_SCOTCH_ORDER 

Fill-reducing ordering based on SCOTCH library.

CS_RENUMBER_CELLS_METIS_PART 

Subpartition for thread blocks based METIS library.

CS_RENUMBER_CELLS_METIS_ORDER 

Fill-reducing ordering based on METIS library.

CS_RENUMBER_CELLS_MORTON 

Order cells using domain-local Morton space-filling curve.

CS_RENUMBER_CELLS_HILBERT 

Order cells using domain-local Hilbert space-filling curve.

CS_RENUMBER_CELLS_RCM 

Order cells using domain-local reverse Cuthill-McKee algorithm.

CS_RENUMBER_CELLS_NONE 

No cells renumbering.

◆ cs_renumber_i_faces_type_t

Interior faces renumbering algorithm types.

Enumerator
CS_RENUMBER_I_FACES_BLOCK 

No shared cell in block. This should produce blocks of similar (prescribed) size across thread groups.

CS_RENUMBER_I_FACES_MULTIPASS 

Use multipass face numbering. This should produce a smaller number of blocks, with a diminishing number of faces per thread group.

CS_RENUMBER_I_FACES_SIMD 

Renumber to allow SIMD operations in interior face->cell gather operations (such as SpMV products with native matrix representation).

Renumber to allow SIMD operations in boundary face->cell gather operations.

CS_RENUMBER_I_FACES_NONE 

No interior face renumbering.

◆ cs_renumber_ordering_t

Ordering options for adjacency arrays.

Enumerator
CS_RENUMBER_ADJACENT_LOW 

Lexicographical ordering with lowest adjacent id first

CS_RENUMBER_ADJACENT_HIGH 

Lexicographical ordering with highest adjacent id first } ;

◆ cs_renumber_vertices_type_t

Vertices renumbering algorithm types.

Enumerator
CS_RENUMBER_VERTICES_BY_CELL_ADJ 

Renumbering based on the cell adjacency.

CS_RENUMBER_VERTICES_BY_FACE_ADJ 

Renumbering based on the face adjacency.

CS_RENUMBER_VERTICES_NONE 

No vertex renumbering.

Function Documentation

◆ cs_renumber_b_faces()

void cs_renumber_b_faces ( cs_mesh_t mesh)

Renumber boundary faces for vectorization or threading depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_b_faces_by_gnum()

void cs_renumber_b_faces_by_gnum ( cs_mesh_t mesh)

◆ cs_renumber_cells()

void cs_renumber_cells ( cs_mesh_t mesh)

Renumber cells depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_get_algorithm()

void cs_renumber_get_algorithm ( bool *  halo_adjacent_cells_last,
bool *  halo_adjacent_faces_last,
cs_renumber_ordering_t i_faces_base_ordering,
cs_renumber_cells_type_t cells_pre_numbering,
cs_renumber_cells_type_t cells_numbering,
cs_renumber_i_faces_type_t i_faces_numbering,
cs_renumber_b_faces_type_t b_faces_numbering,
cs_renumber_vertices_type_t vertices_numbering 
)

Return the algorithms for mesh renumbering.

Any argument may be passed NULL if this option is not queried.

Parameters
[out]halo_adjacent_cells_lastif true, cells adjacent to ghost cells will be placed last (after pre-numbering)
[out]halo_adjacent_faces_lastif true, interior faces adjacent to ghost cells will be placed last (after pre-numbering)
[out]i_faces_base_orderingpre-ordering of interior faces by lowest or highest adjacent cell id
[out]cells_pre_numberingalgorithm for cells pre-numbering
[out]cells_numberingalgorithm for cells numbering
[out]i_faces_numberingalgorithm for interior faces numbering
[out]b_faces_numberingalgorithm for boundary faces numbering
[out]vertices_numberingalgorithm for vertices numbering

◆ cs_renumber_get_min_subset_size()

void cs_renumber_get_min_subset_size ( cs_lnum_t min_i_subset_size,
cs_lnum_t min_b_subset_size 
)

Get the minimum sunset sizes when renumbering for threads.

Parameters
[out]min_i_subset_sizeminimum number of interior faces per thread per group, or NULL
[out]min_b_subset_sizeminimum number of boundary faces per thread per group, or NULL

◆ cs_renumber_get_n_threads()

int cs_renumber_get_n_threads ( void  )

Return the target number of threads for mesh renumbering.

Returns
the target number of threads for mesh numbering

◆ cs_renumber_i_faces()

void cs_renumber_i_faces ( cs_mesh_t mesh)

Renumber interior faces for vectorization or threading depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_i_faces_by_gnum()

void cs_renumber_i_faces_by_gnum ( cs_mesh_t mesh)

◆ cs_renumber_mesh()

void cs_renumber_mesh ( cs_mesh_t mesh)

Renumber mesh elements for vectorization or threading depending on code options and target machine.

Renumbering cells may also allow improving locality (and favor faces renumbering). It is also possible to place cells connected to ghost cells last, which may be useful to enable computation/communication overlap.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_set_algorithm()

void cs_renumber_set_algorithm ( bool  halo_adjacent_cells_last,
bool  halo_adjacent_faces_last,
cs_renumber_ordering_t  i_faces_base_ordering,
cs_renumber_cells_type_t  cells_pre_numbering,
cs_renumber_cells_type_t  cells_numbering,
cs_renumber_i_faces_type_t  i_faces_numbering,
cs_renumber_b_faces_type_t  b_faces_numbering,
cs_renumber_vertices_type_t  vertices_numbering 
)

Select the algorithm for mesh renumbering.

Parameters
[in]halo_adjacent_cells_lastif true, cells adjacent to ghost cells will be placed last (after pre-numbering)
[in]halo_adjacent_faces_lastif true, interior faces adjacent to ghost cells will be placed last (after pre-numbering)
[in]i_faces_base_orderingpre-ordering of interior faces by lowest or highest adjacent cell id
[in]cells_pre_numberingalgorithm for cells pre-numbering
[in]cells_numberingalgorithm for cells numbering
[in]i_faces_numberingalgorithm for interior faces numbering
[in]b_faces_numberingalgorithm for boundary faces numbering
[in]vertices_numberingalgorithm for vertices numbering

◆ cs_renumber_set_min_subset_size()

void cs_renumber_set_min_subset_size ( cs_lnum_t  min_i_subset_size,
cs_lnum_t  min_b_subset_size 
)

Set the minimum sunset sizes when renumbering for threads.

Parameters
[in]min_i_subset_sizeminimum number of interior faces per thread per group
[in]min_b_subset_sizeminimum number of boundary faces per thread per group

◆ cs_renumber_set_n_threads()

void cs_renumber_set_n_threads ( int  n_threads)

Set the target number of threads for mesh renumbering.

By default, the target number of threads is set to cs_glob_n_threads, but the value may be forced using this function. This is mainly useful for testing purposes.

Parameters
[in]n_threadstarget number of threads for mesh numbering

◆ cs_renumber_vertices()

void cs_renumber_vertices ( cs_mesh_t mesh)

Renumber vertices depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure