9.2
general documentation
cs_sort_partition.h
Go to the documentation of this file.
1#ifndef FVM_SORT_PARTITION_H
2#define FVM_SORT_PARTITION_H
3
4/*============================================================================
5 * Data partitioning for parallel sort or order operations.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#include "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Standard C library headers
34 *----------------------------------------------------------------------------*/
35
36#include <stdio.h>
37
38/*----------------------------------------------------------------------------
39 * Local headers
40 *----------------------------------------------------------------------------*/
41
42#include "base/cs_defs.h"
43
44/*============================================================================
45 * Macro and type definitions
46 *============================================================================*/
47
48/*----------------------------------------------------------------------------*/
61/*----------------------------------------------------------------------------*/
62
63typedef void
65 void *elt,
66 const void *input);
67
68/*----------------------------------------------------------------------------*/
84/*----------------------------------------------------------------------------*/
85
86typedef int
87(cs_sort_partition_compare_t) (const void *elt1,
88 const void *elt2,
89 const void *input);
90
91/*============================================================================
92 * Public function definitions
93 *============================================================================*/
94
95#if defined(HAVE_MPI)
96
97/*----------------------------------------------------------------------------*/
115/*----------------------------------------------------------------------------*/
116
117void
119 size_t elt_size,
120 cs_lnum_t n_elts,
121 const void *elts,
122 const cs_lnum_t *weight,
123 const cs_lnum_t order[],
124 int dest_rank_id[],
127 const void *f_input,
128 MPI_Comm comm);
129
130#endif /* if HAVE_MPI */
131
132/*----------------------------------------------------------------------------*/
133
134#endif /* FVM_SORT_PARTITION_H */
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
void cs_sort_partition_dest_rank_id(cs_lnum_t sampling_factor, size_t elt_size, cs_lnum_t n_elts, const void *elts, const cs_lnum_t *weight, const cs_lnum_t order[], int dest_rank_id[], cs_sort_partition_s_to_elt_t s_to_elt, cs_sort_partition_compare_t compare, const void *f_input, MPI_Comm comm)
Determine to which rank data elements should be sent for parallel sorting or ordering.
Definition: cs_sort_partition.cpp:722
void() cs_sort_partition_s_to_elt_t(double s, void *elt, const void *input)
function pointer for conversion of a double precision value in range [0, 1] to a given element.
Definition: cs_sort_partition.h:64
int() cs_sort_partition_compare_t(const void *elt1, const void *elt2, const void *input)
function pointer for comparison of 2 elements.
Definition: cs_sort_partition.h:87