![]() |
(git:d18deda)
|
#include "dbm_multiply_comm.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "dbm_hyperparams.h"
#include "dbm_mempool.h"
#include "dbm_mpi.h"
Go to the source code of this file.
Data Structures | |
struct | plan_t |
Private struct used for planing during pack_matrix. More... | |
Functions | |
static int | gcd (const int a, const int b) |
Private routine for computing greatest common divisor of two numbers. | |
static int | lcm (const int a, const int b) |
Private routine for computing least common multiple of two numbers. | |
static int | isum (const int n, const int input[n]) |
Private routine for computing the sum of the given integers. | |
static void | icumsum (const int n, const int input[n], int output[n]) |
Private routine for computing the cumulative sums of given numbers. | |
static void | create_pack_plans (const bool trans_matrix, const bool trans_dist, const dbm_matrix_t *matrix, const dbm_mpi_comm_t comm, const dbm_dist_1d_t *dist_indices, const dbm_dist_1d_t *dist_ticks, const int nticks, const int npacks, plan_t *plans_per_pack[npacks], int nblks_per_pack[npacks], int ndata_per_pack[npacks]) |
Private routine for planing packs. | |
static void | fill_send_buffers (const dbm_matrix_t *matrix, const bool trans_matrix, const int nblks_send, const int ndata_send, plan_t plans[nblks_send], const int nranks, int blks_send_count[nranks], int data_send_count[nranks], int blks_send_displ[nranks], int data_send_displ[nranks], dbm_pack_block_t blks_send[nblks_send], double data_send[ndata_send]) |
Private routine for filling send buffers. | |
static int | compare_pack_blocks_by_sum_index (const void *a, const void *b) |
Private comperator passed to qsort to compare two blocks by sum_index. | |
static void | postprocess_received_blocks (const int nranks, const int nshards, const int nblocks_recv, const int blks_recv_count[nranks], const int blks_recv_displ[nranks], const int data_recv_displ[nranks], dbm_pack_block_t blks_recv[nblocks_recv]) |
Private routine for post-processing received blocks. | |
static dbm_packed_matrix_t | pack_matrix (const bool trans_matrix, const bool trans_dist, const dbm_matrix_t *matrix, const dbm_distribution_t *dist, const int nticks) |
Private routine for redistributing a matrix along selected dimensions. | |
static dbm_pack_t * | sendrecv_pack (const int itick, const int nticks, dbm_packed_matrix_t *packed) |
Private routine for sending and receiving the pack for the given tick. | |
static void | free_packed_matrix (dbm_packed_matrix_t *packed) |
Private routine for releasing a packed matrix. | |
dbm_comm_iterator_t * | dbm_comm_iterator_start (const bool transa, const bool transb, const dbm_matrix_t *matrix_a, const dbm_matrix_t *matrix_b, const dbm_matrix_t *matrix_c) |
Internal routine for creating a communication iterator. | |
bool | dbm_comm_iterator_next (dbm_comm_iterator_t *iter, dbm_pack_t **pack_a, dbm_pack_t **pack_b) |
Internal routine for retriving next pair of packs from given iterator. | |
void | dbm_comm_iterator_stop (dbm_comm_iterator_t *iter) |
Internal routine for releasing the given communication iterator. | |
|
static |
Private routine for computing greatest common divisor of two numbers.
Definition at line 22 of file dbm_multiply_comm.c.
|
static |
Private routine for computing least common multiple of two numbers.
Definition at line 32 of file dbm_multiply_comm.c.
|
inlinestatic |
Private routine for computing the sum of the given integers.
Definition at line 38 of file dbm_multiply_comm.c.
|
inlinestatic |
Private routine for computing the cumulative sums of given numbers.
Definition at line 50 of file dbm_multiply_comm.c.
|
static |
Private routine for planing packs.
Definition at line 72 of file dbm_multiply_comm.c.
|
static |
Private routine for filling send buffers.
Definition at line 154 of file dbm_multiply_comm.c.
|
static |
Private comperator passed to qsort to compare two blocks by sum_index.
Definition at line 251 of file dbm_multiply_comm.c.
|
static |
Private routine for post-processing received blocks.
Definition at line 261 of file dbm_multiply_comm.c.
|
static |
Private routine for redistributing a matrix along selected dimensions.
Definition at line 325 of file dbm_multiply_comm.c.
|
static |
Private routine for sending and receiving the pack for the given tick.
Definition at line 447 of file dbm_multiply_comm.c.
|
static |
Private routine for releasing a packed matrix.
Definition at line 503 of file dbm_multiply_comm.c.
dbm_comm_iterator_t * dbm_comm_iterator_start | ( | const bool | transa, |
const bool | transb, | ||
const dbm_matrix_t * | matrix_a, | ||
const dbm_matrix_t * | matrix_b, | ||
const dbm_matrix_t * | matrix_c | ||
) |
Internal routine for creating a communication iterator.
Definition at line 517 of file dbm_multiply_comm.c.
bool dbm_comm_iterator_next | ( | dbm_comm_iterator_t * | iter, |
dbm_pack_t ** | pack_a, | ||
dbm_pack_t ** | pack_b | ||
) |
Internal routine for retriving next pair of packs from given iterator.
Definition at line 546 of file dbm_multiply_comm.c.
void dbm_comm_iterator_stop | ( | dbm_comm_iterator_t * | iter | ) |
Internal routine for releasing the given communication iterator.
Definition at line 566 of file dbm_multiply_comm.c.