7.0
general documentation
cs_parall.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "bft_error.h"
#include "bft_mem.h"
#include "cs_parall.h"
+ Include dependency graph for cs_parall.c:

Functions

void cs_parall_max_loc_vals (int n, cs_real_t *max, cs_real_t max_loc_vals[])
 Maximum value of a real and the value of related array on all default communicator processes. More...
 
void cs_parall_min_loc_vals (int n, cs_real_t *min, cs_real_t min_loc_vals[])
 Minimum value of a real and the value of related array on all default communicator processes. More...
 
void cs_parall_min_id_rank_r (cs_lnum_t *elt_id, int *rank_id, cs_real_t val)
 Given an (id, rank, value) tuple, return the local id and rank corresponding to the global minimum value. More...
 
void cs_parall_allgather_r (int n_elts, int n_g_elts, cs_real_t array[], cs_real_t g_array[])
 Build a global array from each local array in each domain. More...
 
size_t cs_parall_get_min_coll_buf_size (void)
 Return minimum recommended scatter or gather buffer size. More...
 
void cs_parall_set_min_coll_buf_size (size_t buffer_size)
 Define minimum recommended scatter or gather buffer size. More...
 

Detailed Description

Utility functions dealing with parallelism.

Function Documentation

◆ cs_parall_allgather_r()

void cs_parall_allgather_r ( int  n_elts,
int  n_g_elts,
cs_real_t  array[],
cs_real_t  g_array[] 
)

Build a global array from each local array in each domain.

Local arrays are appended in order of owning MPI rank. The size of each local array may be different.

Use of this function may be quite practical, but should be limited to user functions, as it may limit scalability (especially as regards memory usage).

Parameters
[in]n_eltssize of the local array
[in]n_g_eltssize of the global array
[in]arraylocal array (size: n_elts)
[out]g_arrayglobal array (size: n_g_elts)

◆ cs_parall_get_min_coll_buf_size()

size_t cs_parall_get_min_coll_buf_size ( void  )

Return minimum recommended scatter or gather buffer size.

This is used by some internal part to block or scatter/gather algorithms, so as to allow I/O buffer size tuning.

Returns
minimum recommended part to block or gather buffer size (in bytes)

◆ cs_parall_max_loc_vals()

void cs_parall_max_loc_vals ( int  n,
cs_real_t max,
cs_real_t  max_loc_vals[] 
)

Maximum value of a real and the value of related array on all default communicator processes.

Parameters
[in]nsize of the related array
[in,out]maxlocal max in, global max out
[in,out]max_loc_valsarray values at location of local max in, and at location of global max out

◆ cs_parall_min_id_rank_r()

void cs_parall_min_id_rank_r ( cs_lnum_t elt_id,
int *  rank_id,
cs_real_t  val 
)

Given an (id, rank, value) tuple, return the local id and rank corresponding to the global minimum value.

Parameters
[in,out]elt_idelement id for which the value is the smallest (local in, global out)
[in,out]rank_idrank id for which the value is the smallest (local in, global out)
[in]valassociated local minimum value

◆ cs_parall_min_loc_vals()

void cs_parall_min_loc_vals ( int  n,
cs_real_t min,
cs_real_t  min_loc_vals[] 
)

Minimum value of a real and the value of related array on all default communicator processes.

Parameters
[in]nsize of the related array
[in,out]minlocal min in, global min out
[in,out]min_loc_valsarray values at location of local min in, and at location of global min out

◆ cs_parall_set_min_coll_buf_size()

void cs_parall_set_min_coll_buf_size ( size_t  buffer_size)

Define minimum recommended scatter or gather buffer size.

This is used by some internal part to block or scatter/gather algorithms, so as to allow I/O buffer size tuning.

Parameters
[in]buffer_sizeminimum recommended part to block or gather buffer size (in bytes)