![]() |
(git:d18deda)
|
#include <assert.h>
#include <math.h>
#include <omp.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../common/grid_common.h"
#include "grid_cpu_collocate.h"
#include "grid_cpu_integrate.h"
#include "grid_cpu_task_list.h"
Go to the source code of this file.
Functions | |
static int | compare_tasks (const void *a, const void *b) |
Comperator passed to qsort to compare two tasks. | |
void | grid_cpu_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_cpu_task_list **task_list_out) |
Allocates a task list for the cpu backend. See grid_task_list.h for details. | |
void | grid_cpu_free_task_list (grid_cpu_task_list *task_list) |
Deallocates given task list, basis_sets have to be freed separately. | |
void | dgemm_ (const char *transa, const char *transb, const int *m, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *b, const int *ldb, const double *beta, double *c, const int *ldc) |
Prototype for BLAS dgemm. | |
static void | dgemm (const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc) |
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b. | |
static void | load_pab (const grid_basis_set *ibasis, const grid_basis_set *jbasis, const int iset, const int jset, const bool transpose, const double *block, double *pab) |
Transforms pab from contracted spherical to prim. cartesian basis. | |
static void | collocate_one_grid_level (const grid_cpu_task_list *task_list, const int *first_block_task, const int *last_block_task, const enum grid_func func, const int npts_global[3], const int npts_local[3], const int shift_local[3], const int border_width[3], const double dh[3][3], const double dh_inv[3][3], const double *pab_blocks, offload_buffer *grid) |
Collocate a range of tasks which are destined for the same grid level. | |
void | grid_cpu_collocate_task_list (const grid_cpu_task_list *task_list, const enum grid_func func, const int nlevels, const offload_buffer *pab_blocks, offload_buffer *grids[nlevels]) |
Collocate all tasks of in given list onto given grids. See grid_task_list.h for details. | |
static void | store_hab (const grid_basis_set *ibasis, const grid_basis_set *jbasis, const int iset, const int jset, const bool transpose, const double *hab, double *block) |
Transforms hab from prim. cartesian to contracted spherical basis. | |
static void | integrate_one_grid_level (const grid_cpu_task_list *task_list, const int *first_block_task, const int *last_block_task, const bool compute_tau, const int natoms, const int npts_global[3], const int npts_local[3], const int shift_local[3], const int border_width[3], const double dh[3][3], const double dh_inv[3][3], const offload_buffer *pab_blocks, const offload_buffer *grid, offload_buffer *hab_blocks, double forces[natoms][3], double virial[3][3]) |
Integrate a range of tasks that belong to the same grid level. | |
void | grid_cpu_integrate_task_list (const grid_cpu_task_list *task_list, const bool compute_tau, const int natoms, const int nlevels, 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. See grid_task_list.h for details. | |
|
static |
Comperator passed to qsort to compare two tasks.
Definition at line 25 of file grid_cpu_task_list.c.
void grid_cpu_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_cpu_task_list ** | task_list_out | ||
) |
Allocates a task list for the cpu backend. See grid_task_list.h for details.
Definition at line 42 of file grid_cpu_task_list.c.
void grid_cpu_free_task_list | ( | grid_cpu_task_list * | task_list | ) |
Deallocates given task list, basis_sets have to be freed separately.
Definition at line 174 of file grid_cpu_task_list.c.
void dgemm_ | ( | const char * | transa, |
const char * | transb, | ||
const int * | m, | ||
const int * | n, | ||
const int * | k, | ||
const double * | alpha, | ||
const double * | a, | ||
const int * | lda, | ||
const double * | b, | ||
const int * | ldb, | ||
const double * | beta, | ||
double * | c, | ||
const int * | ldc | ||
) |
Prototype for BLAS dgemm.
|
static |
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Definition at line 206 of file grid_cpu_task_list.c.
|
static |
Transforms pab from contracted spherical to prim. cartesian basis.
Definition at line 218 of file grid_cpu_task_list.c.
|
static |
Collocate a range of tasks which are destined for the same grid level.
Definition at line 258 of file grid_cpu_task_list.c.
void grid_cpu_collocate_task_list | ( | const grid_cpu_task_list * | task_list, |
const enum grid_func | func, | ||
const int | nlevels, | ||
const offload_buffer * | pab_blocks, | ||
offload_buffer * | grids[nlevels] | ||
) |
Collocate all tasks of in given list onto given grids. See grid_task_list.h for details.
Definition at line 409 of file grid_cpu_task_list.c.
|
inlinestatic |
Transforms hab from prim. cartesian to contracted spherical basis.
Definition at line 432 of file grid_cpu_task_list.c.
|
static |
Integrate a range of tasks that belong to the same grid level.
Definition at line 475 of file grid_cpu_task_list.c.
void grid_cpu_integrate_task_list | ( | const grid_cpu_task_list * | task_list, |
const bool | compute_tau, | ||
const int | natoms, | ||
const int | nlevels, | ||
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. See grid_task_list.h for details.
Definition at line 624 of file grid_cpu_task_list.c.