SLATE 2024.05.31
Software for Linear Algebra Targeting Exascale
Loading...
Searching...
No Matches
Constructor functions

Useful functions for SLATE's "lambda" constructors. More...

Functions

std::function< int64_t(int64_t)> slate::func::uniform_blocksize (int64_t n, int64_t nb)
 Creates a uniform blocksize.
 
int64_t slate::func::max_blocksize (int64_t nt, std::function< int64_t(int64_t)> size)
 Computes the largest block given a blocksize function.
 
std::function< int(ij_tuple)> slate::func::device_2d_grid (GridOrder order, int64_t m, int64_t n, int64_t p, int64_t q)
 Distributes tiles to devices in a 2d block-cyclic fashion.
 
std::function< int(ij_tuple)> slate::func::device_1d_grid (GridOrder order, int64_t block_size, int size)
 Distributes tiles to devices in a 1d block-cyclic fashion.
 
std::function< int(ij_tuple)> slate::func::process_2d_grid (GridOrder order, int64_t p, int64_t q)
 Distributes tiles to processes in a 2d cyclic fashion, resulting in the elements being distributed in a 2d block-cyclic fashion.
 
std::function< int(ij_tuple)> slate::func::process_1d_grid (GridOrder order, int size)
 Distributes tiles to processes in a 1d cyclic fashion, resulting in the elements being distributed in a 1d block-cyclic fashion.
 
std::function< int(ij_tuple)> slate::func::transpose_grid (std::function< int(ij_tuple)> old_func)
 Transposes the given tile distribution function for processes or devices.
 
bool slate::func::is_2d_cyclic_grid (int64_t mt, int64_t nt, std::function< int(ij_tuple)> func, GridOrder *order, int *p, int *q)
 Checks whether the given tile map is a 2d cyclic grid (i.e., equivalent to 'process_2d_grid(order, p, q)' for some 'order', 'p', and 'q').
 

Detailed Description

Useful functions for SLATE's "lambda" constructors.

Function Documentation

◆ device_1d_grid()

std::function< int(ij_tuple)> slate::func::device_1d_grid ( GridOrder  order,
int64_t  block_size,
int  size 
)
inline

Distributes tiles to devices in a 1d block-cyclic fashion.

When the tiles are distributed across processes with process_2d_grid or process_1d_grid, this results in the local tiles being distributed cyclicly across devices.

This function can also be used to distribute tiles to processes, resulting in blocks of tiles belonging to the same process. However, the device grid should then be adjusted.

Parameters
[in]orderCol distributes a single column across multiple processes Row distributes a single row across multiple processes.
[in]block_sizeThe number of rows or columns in the process grid
[in]sizeThe number of rows or column in the device grid
Returns
The distribution function

◆ device_2d_grid()

std::function< int(ij_tuple)> slate::func::device_2d_grid ( GridOrder  order,
int64_t  m,
int64_t  n,
int64_t  p,
int64_t  q 
)
inline

Distributes tiles to devices in a 2d block-cyclic fashion.

When the tiles are distributed across processes with process_2d_grid, this results in the local tiles being distributed cyclicly across devices.

This function can also be used to distribute tiles to processes, resulting in blocks of tiles belonging to the same process. However, the device grid should then be adjusted.

Parameters
[in]orderWhether to use a column major or a row major grid
[in]pThe number of rows in the process grid
[in]qThe number of columns in the process grid
[in]pThe number of rows in the device grid
[in]qThe number of columns in the device grid
Returns
The distribution function

◆ is_2d_cyclic_grid()

bool slate::func::is_2d_cyclic_grid ( int64_t  mt,
int64_t  nt,
std::function< int(ij_tuple)>  func,
GridOrder order,
int *  p,
int *  q 
)
inline

Checks whether the given tile map is a 2d cyclic grid (i.e., equivalent to 'process_2d_grid(order, p, q)' for some 'order', 'p', and 'q').

Parameters
[in]mtThe number of tile rows to consider
[in]ntThe number of tile columns to consider
[in]funcThe tile distribution to inspect
[out]orderThe GridOrder detected.
[out]pThe number of rows in the grid, or -1 if the GridOrder is unknown.
[out]qThe number of columns in the grid, or -1 if the GridOrder is unknown.
Returns
Whether the map is a 2d cyclic grid

◆ max_blocksize()

int64_t slate::func::max_blocksize ( int64_t  nt,
std::function< int64_t(int64_t)>  size 
)
inline

Computes the largest block given a blocksize function.

Parameters
[in]ntNumber of tiles
[in]sizeBlock size function
Returns
The maximum blocksize

◆ process_1d_grid()

std::function< int(ij_tuple)> slate::func::process_1d_grid ( GridOrder  order,
int  size 
)
inline

Distributes tiles to processes in a 1d cyclic fashion, resulting in the elements being distributed in a 1d block-cyclic fashion.

This function can also be used to distribute tiles to devices in a 2d cyclic fashion, regardless of process ownership. Thus, care must be taken to prevent all of a process's tiles from being stored on a single device.

Parameters
[in]orderCol distributes a single column across multiple processes. Row distributes a single row across multiple processes.
[in]sizeThe number of processes
Returns
The distribution function

◆ process_2d_grid()

std::function< int(ij_tuple)> slate::func::process_2d_grid ( GridOrder  order,
int64_t  p,
int64_t  q 
)
inline

Distributes tiles to processes in a 2d cyclic fashion, resulting in the elements being distributed in a 2d block-cyclic fashion.

This function can also be used to distribute tiles to devices in a 2d cyclic fashion, regardless of process ownership. Thus, care must be taken to prevent all of a process's tiles from being stored on a single device.

Parameters
[in]orderWhether to use a column major or a row major grid
[in]pThe number of rows in the process grid
[in]qThe number of columns in the process grid
Returns
The distribution function

◆ transpose_grid()

std::function< int(ij_tuple)> slate::func::transpose_grid ( std::function< int(ij_tuple)>  old_func)
inline

Transposes the given tile distribution function for processes or devices.

Parameters
[in]old_funcThe original distribution function
Returns
The transposed distribution function

◆ uniform_blocksize()

std::function< int64_t(int64_t)> slate::func::uniform_blocksize ( int64_t  n,
int64_t  nb 
)
inline

Creates a uniform blocksize.

Parameters
[in]nGlobal matrix size. Needed to correctly handle the last block size
[in]nbBlock size
Returns
The requested blocksize function