YetAnotherCoupler 3.2.0
Loading...
Searching...
No Matches
yac_mpi_internal.h
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef YAC_MPI_INTERNAL_H
6#define YAC_MPI_INTERNAL_H
7
8#include <stdint.h>
9#include <mpi.h>
10#include "utils_core.h"
11#include "yac_mpi_common.h"
12#include "yac_mpi.h"
13
14#if SIZE_MAX == UINT8_MAX
15#define YAC_MPI_SIZE_T MPI_UINT8_T
16#define YAC_MPI_SIZE_T_TYPE uint8_t
17#elif SIZE_MAX == UINT16_MAX
18#define YAC_MPI_SIZE_T MPI_UINT16_T
19#define YAC_MPI_SIZE_T_TYPE uint16_t
20#elif SIZE_MAX == UINT32_MAX
21#define YAC_MPI_SIZE_T MPI_UINT32_T
22#define YAC_MPI_SIZE_T_TYPE uint32_t
23#elif SIZE_MAX == UINT64_MAX
24#define YAC_MPI_SIZE_T MPI_UINT64_T
25#define YAC_MPI_SIZE_T_TYPE uint64_t
26#else
27#error "YAC: unable to determine MPI data type for size_t"
28#endif
29
35 int start;
36 int size;
37 MPI_Comm comm;
38};
39
40#define YAC_ALLTOALLV_P2P_DEC(N, T) \
41void yac_alltoallv_ ## N ## _p2p( \
42 T const * send_buffer, size_t const * sendcounts, size_t const * sdispls, \
43 T * recv_buffer, size_t const * recvcounts, size_t const * rdispls, \
44 MPI_Comm comm); \
45
48YAC_ALLTOALLV_P2P_DEC(uint64, uint64_t)
49YAC_ALLTOALLV_P2P_DEC(packed, void)
50YAC_ALLTOALLV_P2P_DEC(dble, double)
51YAC_ALLTOALLV_P2P_DEC(size_t, size_t)
52
53#undef YAC_ALLTOALLV_P2P_DEC
54
56 void const * send_buffer, size_t const * sendcounts, size_t const * sdispls,
57 void * recv_buffer, size_t const * recvcounts, size_t const * rdispls,
58 size_t dt_size, MPI_Datatype dt, MPI_Comm comm);
59
61 void const * send_buffer, int const * sendcounts, int const * sdispls,
62 void * recv_buffer, int const * recvcounts, int const * rdispls,
63 size_t dt_size, MPI_Datatype dt, struct yac_group_comm group_comm);
64
66 double * buffer, int count, struct yac_group_comm group_comm);
67
69 const uint64_t * sendbuf, uint64_t * recvbuf, int count,
70 struct yac_group_comm group_comm);
71
73 void * buffer, int count, MPI_Datatype datatype, int root,
74 struct yac_group_comm group_comm);
75
77void yac_group_comm_delete(struct yac_group_comm group_comm);
78int yac_group_comm_get_rank(struct yac_group_comm group_comm);
79int yac_group_comm_get_size(struct yac_group_comm group_comm);
82
84 struct yac_group_comm group_comm, int split_rank,
85 struct yac_group_comm * local_group_comm,
86 struct yac_group_comm * remote_group_comm);
87
88MPI_Datatype yac_get_bounding_circle_mpi_datatype(MPI_Comm comm);
89MPI_Datatype yac_create_resized(
90 MPI_Datatype dt, size_t new_size, MPI_Comm comm);
91
93 int count, size_t const * sendcounts, size_t * recvcounts,
94 size_t * sdispls, size_t * rdispls, MPI_Comm comm);
95
97 int count, size_t ** sendcounts, size_t ** recvcounts,
98 size_t ** sdispls, size_t ** rdispls, MPI_Comm comm);
100 size_t * sendcounts, size_t * recvcounts,
101 size_t * sdispls, size_t * rdispls);
102
103#endif // YAC_MPI_INTERNAL_H
104
105/*
106 * Local Variables:
107 * c-basic-offset: 2
108 * coding: utf-8
109 * indent-tabs-mode: nil
110 * show-trailing-whitespace: t
111 * require-trailing-newline: t
112 * End:
113 */
void yac_alltoallv_p2p_group(void const *send_buffer, int const *sendcounts, int const *sdispls, void *recv_buffer, int const *recvcounts, int const *rdispls, size_t dt_size, MPI_Datatype dt, struct yac_group_comm group_comm)
Definition yac_mpi.c:236
int yac_group_comm_get_global_rank(struct yac_group_comm group_comm)
Definition yac_mpi.c:493
void yac_generate_alltoallv_args(int count, size_t const *sendcounts, size_t *recvcounts, size_t *sdispls, size_t *rdispls, MPI_Comm comm)
Definition yac_mpi.c:571
void yac_free_comm_buffers(size_t *sendcounts, size_t *recvcounts, size_t *sdispls, size_t *rdispls)
Definition yac_mpi.c:627
int yac_group_comm_get_rank(struct yac_group_comm group_comm)
Definition yac_mpi.c:485
void yac_group_comm_split(struct yac_group_comm group_comm, int split_rank, struct yac_group_comm *local_group_comm, struct yac_group_comm *remote_group_comm)
Definition yac_mpi.c:505
MPI_Datatype yac_get_bounding_circle_mpi_datatype(MPI_Comm comm)
Definition yac_mpi.c:530
int yac_group_comm_get_global_size(struct yac_group_comm group_comm)
Definition yac_mpi.c:499
struct yac_group_comm yac_group_comm_new(MPI_Comm comm)
Definition yac_mpi.c:470
void yac_allreduce_sum_dble(double *buffer, int count, struct yac_group_comm group_comm)
Definition yac_mpi.c:289
void yac_get_comm_buffers(int count, size_t **sendcounts, size_t **recvcounts, size_t **sdispls, size_t **rdispls, MPI_Comm comm)
Definition yac_mpi.c:596
#define YAC_ALLTOALLV_P2P_DEC(N, T)
int yac_group_comm_get_size(struct yac_group_comm group_comm)
Definition yac_mpi.c:489
MPI_Datatype yac_create_resized(MPI_Datatype dt, size_t new_size, MPI_Comm comm)
Definition yac_mpi.c:550
void yac_alltoallv_p2p(void const *send_buffer, size_t const *sendcounts, size_t const *sdispls, void *recv_buffer, size_t const *recvcounts, size_t const *rdispls, size_t dt_size, MPI_Datatype dt, MPI_Comm comm)
Definition yac_mpi.c:131
void yac_bcast_group(void *buffer, int count, MPI_Datatype datatype, int root, struct yac_group_comm group_comm)
Definition yac_mpi.c:405
void yac_allgather_uint64(const uint64_t *sendbuf, uint64_t *recvbuf, int count, struct yac_group_comm group_comm)
Definition yac_mpi.c:361
void yac_group_comm_delete(struct yac_group_comm group_comm)
Definition yac_mpi.c:480
Xt_int yac_int
Definition yac_types.h:15