![]() |
(git:d18deda)
|
#include <stdbool.h>
#include "../offload/offload_buffer.h"
#include "../offload/offload_runtime.h"
#include "common/grid_basis_set.h"
#include "common/grid_constants.h"
#include "cpu/grid_cpu_task_list.h"
#include "dgemm/grid_dgemm_task_list.h"
#include "gpu/grid_gpu_task_list.h"
#include "hip/grid_hip_task_list.h"
#include "ref/grid_ref_task_list.h"
Go to the source code of this file.
Data Structures | |
struct | grid_task_list |
Internal representation of a task list, abstracting various backends. More... | |
Functions | |
void | grid_create_task_list (const bool orthorhombic, const int ntasks, const int nlevels, const int natoms, const int nkinds, const int nblocks, const int block_offsets[nblocks], const double atom_positions[natoms][3], const int atom_kinds[natoms], const grid_basis_set *basis_sets[nkinds], const int level_list[ntasks], const int iatom_list[ntasks], const int jatom_list[ntasks], const int iset_list[ntasks], const int jset_list[ntasks], const int ipgf_list[ntasks], const int jpgf_list[ntasks], const int border_mask_list[ntasks], const int block_num_list[ntasks], const double radius_list[ntasks], const double rab_list[ntasks][3], const int npts_global[nlevels][3], const int npts_local[nlevels][3], const int shift_local[nlevels][3], const int border_width[nlevels][3], const double dh[nlevels][3][3], const double dh_inv[nlevels][3][3], grid_task_list **task_list) |
Allocates a task list which can be passed to grid_collocate_task_list. | |
void | grid_free_task_list (grid_task_list *task_list) |
Deallocates given task list, basis_sets have to be freed separately. | |
void | grid_collocate_task_list (const grid_task_list *task_list, const enum grid_func func, const int nlevels, const int npts_local[nlevels][3], const offload_buffer *pab_blocks, offload_buffer *grids[nlevels]) |
Collocate all tasks of in given list onto given grids. | |
void | grid_integrate_task_list (const grid_task_list *task_list, const bool compute_tau, const int natoms, const int nlevels, const int npts_local[nlevels][3], const offload_buffer *pab_blocks, const offload_buffer *grids[nlevels], offload_buffer *hab_blocks, double forces[natoms][3], double virial[3][3]) |
Integrate all tasks of in given list from given grids. | |
void grid_create_task_list | ( | const bool | orthorhombic, |
const int | ntasks, | ||
const int | nlevels, | ||
const int | natoms, | ||
const int | nkinds, | ||
const int | nblocks, | ||
const int | block_offsets[nblocks], | ||
const double | atom_positions[natoms][3], | ||
const int | atom_kinds[natoms], | ||
const grid_basis_set * | basis_sets[nkinds], | ||
const int | level_list[ntasks], | ||
const int | iatom_list[ntasks], | ||
const int | jatom_list[ntasks], | ||
const int | iset_list[ntasks], | ||
const int | jset_list[ntasks], | ||
const int | ipgf_list[ntasks], | ||
const int | jpgf_list[ntasks], | ||
const int | border_mask_list[ntasks], | ||
const int | block_num_list[ntasks], | ||
const double | radius_list[ntasks], | ||
const double | rab_list[ntasks][3], | ||
const int | npts_global[nlevels][3], | ||
const int | npts_local[nlevels][3], | ||
const int | shift_local[nlevels][3], | ||
const int | border_width[nlevels][3], | ||
const double | dh[nlevels][3][3], | ||
const double | dh_inv[nlevels][3][3], | ||
grid_task_list ** | task_list_out | ||
) |
Allocates a task list which can be passed to grid_collocate_task_list.
orthorhombic | Whether simulation box is orthorhombic. |
ntasks | Number of tasks, ie. length of the task list. |
nlevels | Number of grid levels. |
natoms | Number of atoms. |
nkinds | Number of atomic kinds. |
nblocks | Number of local matrix blocks. |
block_offsets | Offset of each block within the buffer (zero based). |
atom_positions | Position of the atoms. |
atom_kinds | Mapping from atom to atomic kind (one based). |
basis_sets | Mapping from atomic kind to basis sets. The following params are given for each task: |
level_list | Index of grid level (one based). |
iatom_list | Index of first atom (one based). |
jatom_list | Index of second atom (one based). |
iset_list | Index of first set (one based). |
jset_list | Index of second set (one based). |
ipgf_list | Index of first exponent (one based). |
jpgf_list | Index of second exponent (one based). |
border_mask_list | Bit-pattern determining border regions to exclude. |
block_num_list | Index into the block_offsets array (one based). |
radius_list | Radius where Gaussian becomes smaller than threshold. |
rab_list | Vector between atoms, encodes the virtual image. The following params are given for each grid level: |
npts_global | Number of global grid points in each direction. |
npts_local | Number of local grid points in each direction. |
shift_local | Number of points local grid is shifted wrt global grid |
border_width | Width of halo region in grid points in each direction. |
dh | Incremental grid matrix. |
dh_inv | Inverse incremental grid matrix. |
task_list | Handle to the created task list. |
Allocates a task list which can be passed to grid_collocate_task_list.
Definition at line 25 of file grid_task_list.c.
void grid_free_task_list | ( | grid_task_list * | task_list | ) |
Deallocates given task list, basis_sets have to be freed separately.
Definition at line 149 of file grid_task_list.c.
void grid_collocate_task_list | ( | const grid_task_list * | task_list, |
const enum grid_func | func, | ||
const int | nlevels, | ||
const int | npts_local[nlevels][3], | ||
const offload_buffer * | pab_blocks, | ||
offload_buffer * | grids[nlevels] | ||
) |
Collocate all tasks of in given list onto given grids.
task_list | Task list to collocate. |
func | Function to be collocated, see grid_prepare_pab.h |
nlevels | Number of grid levels. The remaining params are given for each grid level: |
npts_local | Number of local grid points in each direction. |
pab_blocks | Buffer that contains the density matrix blocks. |
grids | The output grid array to collocate into. |
Collocate all tasks of in given list onto given grids.
Definition at line 185 of file grid_task_list.c.
void grid_integrate_task_list | ( | const grid_task_list * | task_list, |
const bool | compute_tau, | ||
const int | natoms, | ||
const int | nlevels, | ||
const int | npts_local[nlevels][3], | ||
const offload_buffer * | pab_blocks, | ||
const offload_buffer * | grids[nlevels], | ||
offload_buffer * | hab_blocks, | ||
double | forces[natoms][3], | ||
double | virial[3][3] | ||
) |
Integrate all tasks of in given list from given grids.
task_list | Task list to collocate. |
compute_tau | When true then <nabla a| V | nabla b> is computed. |
natoms | Number of atoms. |
nlevels | Number of grid levels. The remaining params are given for each grid level: |
npts_local | Number of local grid points in each direction. |
grids | Grid array to integrate from. |
pab_blocks | Optional density blocks, needed for forces and virial. |
hab_blocks | Output buffer with the Hamiltonian matrix blocks. |
forces | Optional output forces, requires pab_blocks. |
virial | Optional output virials, requires pab_blocks. |
Integrate all tasks of in given list from given grids.
Definition at line 282 of file grid_task_list.c.