描述了所有进程数据的大小和位置。
C interface:
void kml_fft_mpi_split_world(const int *world, const int *proc_grid, int(*box_low)[3], int(*box_high)[3]);
void kml_fftf_mpi_split_world(const int *world, const int *proc_grid, int(*box_low)[3], int(*box_high)[3]);
无返回值。
参数名 |
数据类型 |
描述 |
输入/输出 |
---|---|---|---|
world |
const int* |
n是长度为3的数组,包含各维度的大小; |
输入 |
proc_grid |
const int* |
proc_grid是长度为3的数组,包含各维度进程分布数量 |
输入 |
box_low |
int** |
所有进程三个维度切分后的起点 |
输出 |
bow_high |
int** |
所有进程三个维度切分后的终点 |
输出 |
C: "kfft-mpi.h"
C interface:
const int n0 = 32, n1 = 32, n2 = 32; kml_fft_plan plan; int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); MPI_Comm comm = MPI_COMM_WORLD; int size; MPI_Comm_size(comm, &size); /* get local data size and allocate */ int low[size][3]; int high[size][3]; int world[3] = {n0, n1, n2}; int proc_grid[3] = {1, 1, size}; kml_fft_mpi_split_world(world, proc_grid, low, high); MPI_Finalize();