YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
proc_sphere_part.c File Reference
#include <limits.h>
#include <string.h>
#include <mpi.h>
#include "proc_sphere_part.h"
#include "remote_point.h"
#include "ensure_array_size.h"
#include "yac_mpi_internal.h"
#include "instrument_internal.h"
Include dependency graph for proc_sphere_part.c:

Go to the source code of this file.

Data Structures

struct  dist_vertex
 
struct  comm_buffers
 
struct  proc_sphere_part_node_data
 Data structure for the process sphere partition. More...
 
struct  proc_sphere_part_node
 Inner node of the process sphere partition tree. More...
 
struct  neigh_search_data
 

Enumerations

enum  splicomm_tags { DATA_SIZE_TAG , DATA_TAG }
 
enum  proc_sphere_part_list_type { U_LIST = 0 , T_LIST = 1 }
 

Functions

static int get_proc_sphere_part_node_data_pack_size (struct proc_sphere_part_node_data node_data, MPI_Comm comm)
 
static int get_proc_sphere_part_node_pack_size (struct proc_sphere_part_node node, MPI_Comm comm)
 
static void pack_proc_sphere_part_node_data (struct proc_sphere_part_node_data node_data, void *pack_buffer, int pack_buffer_size, int *position, MPI_Comm comm)
 
static void pack_proc_sphere_part_node (struct proc_sphere_part_node *node, void *pack_buffer, int pack_buffer_size, int *position, MPI_Comm comm)
 
static struct proc_sphere_part_node_data unpack_proc_sphere_part_node_data (void *pack_buffer, int pack_buffer_size, int *position, MPI_Comm comm)
 
static struct proc_sphere_part_nodeunpack_proc_sphere_part_node (void *pack_buffer, int pack_buffer_size, int *position, MPI_Comm comm)
 
static struct proc_sphere_part_node_data get_remote_data (struct proc_sphere_part_node_data local_data, struct yac_group_comm local_group_comm, struct yac_group_comm remote_group_comm)
 
static void compute_redist_recvcounts_rdispls (int comm_rank, int split_rank, int comm_size, size_t global_sizes[2], size_t(*all_bucket_sizes)[2], int *counts, int *displs, size_t *recv_count)
 
static void compute_redist_sendcounts_sdispls (int comm_rank, int split_rank, int comm_size, size_t global_sizes[2], size_t(*all_bucket_sizes)[2], int *counts, int *displs)
 
static void reorder_data_remote_point_info (size_t *reorder_idx, size_t count, struct remote_point_info *data)
 
static int compare_dist_vertices (const void *a, const void *b)
 
static void remove_duplicated_vertices (struct dist_vertex *vertices, size_t *num_vertices, struct remote_point_info *owners, size_t num_owners, size_t **owners_reorder_idx, size_t *owners_reorder_idx_array_size)
 
static void redistribute_dist_vertices (struct dist_vertex **vertices, size_t *num_vertices, struct remote_point_info **owners, size_t *num_owners, size_t global_bucket_sizes[2], size_t(*all_bucket_sizes)[2], int split_rank, struct comm_buffers comm_buffers, size_t **owners_reorder_idx, size_t *owners_reorder_idx_array_size, MPI_Datatype dist_vertex_dt, MPI_Datatype remote_point_info_dt, struct yac_group_comm group_comm)
 
static enum proc_sphere_part_list_type determine_list_type (double const *restrict gc_norm_vector, double const *restrict vertex_coord)
 
static struct proc_sphere_part_nodegenerate_proc_sphere_part_node_recursive (struct dist_vertex **vertices, size_t *num_vertices, struct remote_point_info **owners, size_t *num_owners, size_t(*all_bucket_sizes)[2], struct comm_buffers comm_buffers, size_t **reorder_idx, size_t *reorder_idx_array_size, int **list_flag_, size_t *list_flag_array_size, MPI_Datatype dist_vertex_dt, MPI_Datatype remote_point_info_dt, struct yac_group_comm group_comm, double prev_gc_norm_vector[3])
 
static MPI_Datatype yac_get_dist_vertex_mpi_datatype (MPI_Comm comm)
 
static void inform_dist_vertex_owners (struct dist_vertex *dist_vertices, size_t num_dist_vertices, struct remote_point_info *dist_owners, size_t **reorder_idx, size_t *reorder_idx_array_size, yac_int **global_vertex_ids[2], int *global_ids_missing, int **vertex_ranks[2], size_t *num_vertices, MPI_Comm comm)
 
void yac_proc_sphere_part_new (yac_coordinate_pointer vertex_coordinates[2], size_t *num_vertices, struct proc_sphere_part_node **proc_sphere_part, yac_int **global_vertex_ids_[2], int **vertex_ranks[2], MPI_Comm comm)
 
static int is_serial_node (struct proc_sphere_part_node *node)
 
void yac_proc_sphere_part_do_point_search (struct proc_sphere_part_node *node, yac_coordinate_pointer search_coords, size_t count, int *ranks)
 
static void bnd_circle_search (struct proc_sphere_part_node *node, struct bounding_circle bnd_circle, int *ranks, int *rank_count)
 
static void bnd_circle_search_big_angle (struct proc_sphere_part_node *node, struct bounding_circle bnd_circle, int *ranks, int *rank_count)
 
void yac_proc_sphere_part_do_bnd_circle_search (struct proc_sphere_part_node *node, struct bounding_circle bnd_circle, int *ranks, int *rank_count)
 
static int get_leaf_ranks (struct proc_sphere_part_node *node, int *ranks)
 
static void get_neigh_ranks (struct proc_sphere_part_node *node, uint64_t *leaf_sizes, uint64_t min_size, uint64_t **inner_node_sizes, int *send_flags, int *recv_flags, int comm_rank, struct neigh_search_data *last_valid_node)
 
static uint64_t determine_node_sizes (struct proc_sphere_part_node *node, uint64_t *leaf_sizes, uint64_t **inner_node_sizes)
 
void yac_proc_sphere_part_get_neigh_ranks (struct proc_sphere_part_node *node, uint64_t *leaf_sizes, uint64_t min_size, int *send_flags, int *recv_flags, int comm_rank, int comm_size)
 
void yac_proc_sphere_part_node_delete (struct proc_sphere_part_node *node)
 

Enumeration Type Documentation

◆ proc_sphere_part_list_type

Enumerator
U_LIST 
T_LIST 

Definition at line 79 of file proc_sphere_part.c.

◆ splicomm_tags

Enumerator
DATA_SIZE_TAG 
DATA_TAG 

Definition at line 19 of file proc_sphere_part.c.

Function Documentation

◆ bnd_circle_search()

static void bnd_circle_search ( struct proc_sphere_part_node * node,
struct bounding_circle bnd_circle,
int * ranks,
int * rank_count )
static

Definition at line 1238 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bnd_circle_search_big_angle()

static void bnd_circle_search_big_angle ( struct proc_sphere_part_node * node,
struct bounding_circle bnd_circle,
int * ranks,
int * rank_count )
static

Definition at line 1271 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_dist_vertices()

static int compare_dist_vertices ( const void * a,
const void * b )
static

Definition at line 387 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_redist_recvcounts_rdispls()

static void compute_redist_recvcounts_rdispls ( int comm_rank,
int split_rank,
int comm_size,
size_t global_sizes[2],
size_t(*) all_bucket_sizes[2],
int * counts,
int * displs,
size_t * recv_count )
static

Definition at line 247 of file proc_sphere_part.c.

Here is the caller graph for this function:

◆ compute_redist_sendcounts_sdispls()

static void compute_redist_sendcounts_sdispls ( int comm_rank,
int split_rank,
int comm_size,
size_t global_sizes[2],
size_t(*) all_bucket_sizes[2],
int * counts,
int * displs )
static

Definition at line 301 of file proc_sphere_part.c.

Here is the caller graph for this function:

◆ determine_list_type()

static enum proc_sphere_part_list_type determine_list_type ( double const *restrict gc_norm_vector,
double const *restrict vertex_coord )
inlinestatic

Determine the list type (U or T) of a vertex based on its coordinates and the normal vector of the great circle plane.

The angle between a vertex coordinate and the great circle plane is computed using the dot product of the normal vector and the vertex coordinate. The result of the dot product is the cosine of the angle between the normal vector and the vertex coordinate. How it is also the sine of the angle between the great circle plane and the vertex coordinate. Hence, if the dot product is less than or equal to zero, the vertex is on one side of the great circle plane (U list), otherwise it is on the other side (T list).

The dot product is computed using the function dotproduct_eft, which provides an accurate result by using error-free transformations to reduce numerical errors in the computation. This is important to ensure that the classification of vertices into U and T lists is consistent and not affected by floating-point precision issues, especially when vertices are close to the great circle plane.

Definition at line 568 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ determine_node_sizes()

static uint64_t determine_node_sizes ( struct proc_sphere_part_node * node,
uint64_t * leaf_sizes,
uint64_t ** inner_node_sizes )
static

Definition at line 1396 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_proc_sphere_part_node_recursive()

static struct proc_sphere_part_node * generate_proc_sphere_part_node_recursive ( struct dist_vertex ** vertices,
size_t * num_vertices,
struct remote_point_info ** owners,
size_t * num_owners,
size_t(*) all_bucket_sizes[2],
struct comm_buffers comm_buffers,
size_t ** reorder_idx,
size_t * reorder_idx_array_size,
int ** list_flag_,
size_t * list_flag_array_size,
MPI_Datatype dist_vertex_dt,
MPI_Datatype remote_point_info_dt,
struct yac_group_comm group_comm,
double prev_gc_norm_vector[3] )
static

Definition at line 577 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_leaf_ranks()

static int get_leaf_ranks ( struct proc_sphere_part_node * node,
int * ranks )
static

Definition at line 1317 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_neigh_ranks()

static void get_neigh_ranks ( struct proc_sphere_part_node * node,
uint64_t * leaf_sizes,
uint64_t min_size,
uint64_t ** inner_node_sizes,
int * send_flags,
int * recv_flags,
int comm_rank,
struct neigh_search_data * last_valid_node )
static

Definition at line 1336 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_proc_sphere_part_node_data_pack_size()

static int get_proc_sphere_part_node_data_pack_size ( struct proc_sphere_part_node_data node_data,
MPI_Comm comm )
static

Definition at line 99 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_proc_sphere_part_node_pack_size()

static int get_proc_sphere_part_node_pack_size ( struct proc_sphere_part_node node,
MPI_Comm comm )
static

Definition at line 87 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_remote_data()

static struct proc_sphere_part_node_data get_remote_data ( struct proc_sphere_part_node_data local_data,
struct yac_group_comm local_group_comm,
struct yac_group_comm remote_group_comm )
static

Definition at line 190 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inform_dist_vertex_owners()

static void inform_dist_vertex_owners ( struct dist_vertex * dist_vertices,
size_t num_dist_vertices,
struct remote_point_info * dist_owners,
size_t ** reorder_idx,
size_t * reorder_idx_array_size,
yac_int ** global_vertex_ids[2],
int * global_ids_missing,
int ** vertex_ranks[2],
size_t * num_vertices,
MPI_Comm comm )
static

Definition at line 847 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_serial_node()

static int is_serial_node ( struct proc_sphere_part_node * node)
static

Definition at line 1135 of file proc_sphere_part.c.

Here is the caller graph for this function:

◆ pack_proc_sphere_part_node()

static void pack_proc_sphere_part_node ( struct proc_sphere_part_node * node,
void * pack_buffer,
int pack_buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 119 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pack_proc_sphere_part_node_data()

static void pack_proc_sphere_part_node_data ( struct proc_sphere_part_node_data node_data,
void * pack_buffer,
int pack_buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 131 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ redistribute_dist_vertices()

static void redistribute_dist_vertices ( struct dist_vertex ** vertices,
size_t * num_vertices,
struct remote_point_info ** owners,
size_t * num_owners,
size_t global_bucket_sizes[2],
size_t(*) all_bucket_sizes[2],
int split_rank,
struct comm_buffers comm_buffers,
size_t ** owners_reorder_idx,
size_t * owners_reorder_idx_array_size,
MPI_Datatype dist_vertex_dt,
MPI_Datatype remote_point_info_dt,
struct yac_group_comm group_comm )
static

Definition at line 459 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_duplicated_vertices()

static void remove_duplicated_vertices ( struct dist_vertex * vertices,
size_t * num_vertices,
struct remote_point_info * owners,
size_t num_owners,
size_t ** owners_reorder_idx,
size_t * owners_reorder_idx_array_size )
static

Definition at line 406 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reorder_data_remote_point_info()

static void reorder_data_remote_point_info ( size_t * reorder_idx,
size_t count,
struct remote_point_info * data )
static

Definition at line 354 of file proc_sphere_part.c.

Here is the caller graph for this function:

◆ unpack_proc_sphere_part_node()

static struct proc_sphere_part_node * unpack_proc_sphere_part_node ( void * pack_buffer,
int pack_buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 150 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpack_proc_sphere_part_node_data()

static struct proc_sphere_part_node_data unpack_proc_sphere_part_node_data ( void * pack_buffer,
int pack_buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 168 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_get_dist_vertex_mpi_datatype()

static MPI_Datatype yac_get_dist_vertex_mpi_datatype ( MPI_Comm comm)
static

Definition at line 811 of file proc_sphere_part.c.

Here is the call graph for this function:
Here is the caller graph for this function: