![]() |
(git:33f85d8)
|
#include <assert.h>
#include <math.h>
#include <omp.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "dbm_distribution.h"
#include "dbm_hyperparams.h"
#include "dbm_internal.h"
Go to the source code of this file.
Functions | |
static void | dbm_dist_1d_new (dbm_dist_1d_t *dist, const int length, const int coords[length], const dbm_mpi_comm_t comm, const int nshards) |
Private routine for creating a new one dimensional distribution. | |
static void | dbm_dist_1d_free (dbm_dist_1d_t *dist) |
Private routine for releasing a one dimensional distribution. | |
static int | find_best_nrow_shards (const int nshards, const int nrows, const int ncols) |
Private routine for finding the optimal number of shard rows. | |
void | dbm_distribution_new (dbm_distribution_t **dist_out, const int fortran_comm, const int nrows, const int ncols, const int row_dist[nrows], const int col_dist[ncols]) |
Creates a new two dimensional distribution. | |
void | dbm_distribution_hold (dbm_distribution_t *dist) |
Increases the reference counter of the given distribution. | |
void | dbm_distribution_release (dbm_distribution_t *dist) |
Decreases the reference counter of the given distribution. | |
void | dbm_distribution_row_dist (const dbm_distribution_t *dist, int *nrows, const int **row_dist) |
Returns the rows of the given distribution. | |
void | dbm_distribution_col_dist (const dbm_distribution_t *dist, int *ncols, const int **col_dist) |
Returns the columns of the given distribution. | |
int | dbm_distribution_stored_coords (const dbm_distribution_t *dist, const int row, const int col) |
Returns the MPI rank on which the given block should be stored. | |
|
static |
Private routine for creating a new one dimensional distribution.
Definition at line 24 of file dbm_distribution.c.
|
static |
Private routine for releasing a one dimensional distribution.
Definition at line 66 of file dbm_distribution.c.
|
static |
Private routine for finding the optimal number of shard rows.
Definition at line 76 of file dbm_distribution.c.
void dbm_distribution_new | ( | dbm_distribution_t ** | dist_out, |
const int | fortran_comm, | ||
const int | nrows, | ||
const int | ncols, | ||
const int | row_dist[nrows], | ||
const int | col_dist[ncols] | ||
) |
Creates a new two dimensional distribution.
Definition at line 101 of file dbm_distribution.c.
void dbm_distribution_hold | ( | dbm_distribution_t * | dist | ) |
Increases the reference counter of the given distribution.
Definition at line 134 of file dbm_distribution.c.
void dbm_distribution_release | ( | dbm_distribution_t * | dist | ) |
Decreases the reference counter of the given distribution.
Definition at line 143 of file dbm_distribution.c.
void dbm_distribution_row_dist | ( | const dbm_distribution_t * | dist, |
int * | nrows, | ||
const int ** | row_dist | ||
) |
Returns the rows of the given distribution.
Definition at line 157 of file dbm_distribution.c.
void dbm_distribution_col_dist | ( | const dbm_distribution_t * | dist, |
int * | ncols, | ||
const int ** | col_dist | ||
) |
Returns the columns of the given distribution.
Definition at line 168 of file dbm_distribution.c.
int dbm_distribution_stored_coords | ( | const dbm_distribution_t * | dist, |
const int | row, | ||
const int | col | ||
) |
Returns the MPI rank on which the given block should be stored.
Definition at line 179 of file dbm_distribution.c.