My Project
programmer's documentation
|
#include "cs_defs.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_block_dist.h"
#include "cs_crystal_router.h"
#include "cs_log.h"
#include "cs_order.h"
#include "cs_timer.h"
#include "cs_rank_neighbors.h"
Functions | |
cs_rank_neighbors_t * | cs_rank_neighbors_create (size_t n_elts, const int elt_rank[]) |
Create a rank neighbors structure base on a list of element ranks. More... | |
void | cs_rank_neighbors_destroy (cs_rank_neighbors_t **n) |
Destroy a rank neighborhood structure. More... | |
void | cs_rank_neighbors_to_index (const cs_rank_neighbors_t *n, size_t n_elts, int *elt_rank, int *elt_rank_index) |
Given a list of element ranks, determine the associated element rank indexes in a rank neighborhood structure. More... | |
void | cs_rank_neighbors_symmetrize (cs_rank_neighbors_t *n, MPI_Comm comm) |
Symmetrize a rank neighborhood structure. More... | |
void | cs_rank_neighbors_count (const cs_rank_neighbors_t *n, size_t n_elts, const int *elt_rank_index, cs_lnum_t *elt_rank_count) |
Given a list of element rank indexes, count occurences for a rank neighborhood structure. More... | |
void | cs_rank_neighbors_sync_count (const cs_rank_neighbors_t *n_send, cs_rank_neighbors_t **n_recv, const cs_lnum_t *send_count, cs_lnum_t **recv_count, MPI_Comm comm) |
Exchange send and receive counts for rank neighborhoods. More... | |
cs_rank_neighbors_exchange_t | cs_rank_neighbors_get_exchange_type (void) |
Get current type of rank neighbors collective algorithm choice. More... | |
void | cs_rank_neighbors_set_exchange_type (cs_rank_neighbors_exchange_t t) |
Set current type of rank neighbors collective algorithm choice. More... | |
void cs_rank_neighbors_count | ( | const cs_rank_neighbors_t * | n, |
size_t | n_elts, | ||
const int * | elt_rank_index, | ||
cs_lnum_t * | elt_rank_count | ||
) |
Given a list of element rank indexes, count occurences for a rank neighborhood structure.
[in] | n | pointer to rank neighborhood structure |
[in] | n_elts | number of elements |
[in] | elt_rank_index | element rank index in neighborhood (size: n_elts) |
[out] | elt_rank_count | element rank count in neighborhood (size: n->size) |
cs_rank_neighbors_t* cs_rank_neighbors_create | ( | size_t | n_elts, |
const int | elt_rank[] | ||
) |
Create a rank neighbors structure base on a list of element ranks.
[in] | n_elts | number of elements |
[in] | elt_rank | element rank in |
void cs_rank_neighbors_destroy | ( | cs_rank_neighbors_t ** | n | ) |
Destroy a rank neighborhood structure.
[in,out] | n | pointer to associated rank neighborhood |
cs_rank_neighbors_exchange_t cs_rank_neighbors_get_exchange_type | ( | void | ) |
Get current type of rank neighbors collective algorithm choice.
void cs_rank_neighbors_set_exchange_type | ( | cs_rank_neighbors_exchange_t | t | ) |
Set current type of rank neighbors collective algorithm choice.
t | type of rank neighbors collective algorithm choice |
void cs_rank_neighbors_symmetrize | ( | cs_rank_neighbors_t * | n, |
MPI_Comm | comm | ||
) |
Symmetrize a rank neighborhood structure.
This is a collective operation ,which ensures that if rank i has j among its neighbors, then j will also jave i among its neighbors.
[in,out] | n | pointer to rank neighborhood structure |
[in] | comm | associated communicator |
void cs_rank_neighbors_sync_count | ( | const cs_rank_neighbors_t * | n_send, |
cs_rank_neighbors_t ** | n_recv, | ||
const cs_lnum_t * | send_count, | ||
cs_lnum_t ** | recv_count, | ||
MPI_Comm | comm | ||
) |
Exchange send and receive counts for rank neighborhoods.
This allocates the n_recv ranks neighborhood structure and the recv_count counts array, which the caller is responsible for freeing.
[in] | n_send | pointer to rank neighborhood used for sending |
[out] | n_recv | pointer to rank neighborhood used for receiving |
[in] | send_count | pointer to rank neighborhood used for sending |
[in] | recv_count | pointer to rank neighborhood used for sending |
[in] | comm | associated communicator |
void cs_rank_neighbors_to_index | ( | const cs_rank_neighbors_t * | n, |
size_t | n_elts, | ||
int * | elt_rank, | ||
int * | elt_rank_index | ||
) |
Given a list of element ranks, determine the associated element rank indexes in a rank neighborhood structure.
The elt_rank and elt_rank_index may be identical, in which case it is updated.
[in] | n | pointer to rank neighborhood structure |
[in] | n_elts | number of elements |
[in] | elt_rank | element rank (size: n_elts) |
[out] | elt_rank_index | element rank index in neighborhood (size: n_elts) |