8.3
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-2024 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 "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 "cs_defs.h"
43
44/*----------------------------------------------------------------------------*/
45
47
48/*============================================================================
49 * Macro and type definitions
50 *============================================================================*/
51
52/*----------------------------------------------------------------------------*/
65/*----------------------------------------------------------------------------*/
66
67typedef void
69 void *elt,
70 const void *input);
71
72/*----------------------------------------------------------------------------*/
88/*----------------------------------------------------------------------------*/
89
90typedef int
91(cs_sort_partition_compare_t) (const void *elt1,
92 const void *elt2,
93 const void *input);
94
95/*============================================================================
96 * Public function definitions
97 *============================================================================*/
98
99#if defined(HAVE_MPI)
100
101/*----------------------------------------------------------------------------*/
119/*----------------------------------------------------------------------------*/
120
121void
123 size_t elt_size,
124 cs_lnum_t n_elts,
125 const void *elts,
126 const cs_lnum_t *weight,
127 const cs_lnum_t order[],
128 int dest_rank_id[],
131 const void *f_input,
132 MPI_Comm comm);
133
134#endif /* if HAVE_MPI */
135
136/*----------------------------------------------------------------------------*/
137
139
140#endif /* __FVM_SORT_PARTITION_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
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:724
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:68
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:91