(git:66ce584)
Loading...
Searching...
No Matches
grid_ref_task_list.c File Reference
#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_ref_collocate.h"
#include "grid_ref_integrate.h"
#include "grid_ref_task_list.h"
#include "grid_ref_task_list_internal.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_ref_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_ref_task_list **task_list_out)
 Allocates a task list for the reference backend. See grid_task_list.h for details.
void grid_ref_free_task_list (grid_ref_task_list *ptr)
 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_ref_task_list *ptr, 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_ref_collocate_task_list (const grid_ref_task_list *ptr, 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_ref_task_list *ptr, 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_ref_integrate_task_list (const grid_ref_task_list *ptr, 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.

Function Documentation

◆ compare_tasks()

int compare_tasks ( const void * a,
const void * b )
static

Comperator passed to qsort to compare two tasks.

Author
Ole Schuett

Definition at line 26 of file grid_ref_task_list.c.

◆ grid_ref_create_task_list()

void grid_ref_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_ref_task_list ** task_list_out )

Allocates a task list for the reference backend. See grid_task_list.h for details.

Author
Ole Schuett

Definition at line 43 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grid_ref_free_task_list()

void grid_ref_free_task_list ( grid_ref_task_list * ptr)

Deallocates given task list, basis_sets have to be freed separately.

Author
Ole Schuett

Definition at line 188 of file grid_ref_task_list.c.

Here is the caller graph for this function:

◆ dgemm_()

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.

Author
Ole Schuett
Here is the caller graph for this function:

◆ dgemm()

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 )
static

Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.

Author
Ole Schuett

Definition at line 225 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_pab()

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 )
static

Transforms pab from contracted spherical to prim. cartesian basis.

Author
Ole Schuett

Definition at line 237 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collocate_one_grid_level()

void collocate_one_grid_level ( const grid_ref_task_list * ptr,
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 )
static

Collocate a range of tasks which are destined for the same grid level.

Author
Ole Schuett

Definition at line 277 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grid_ref_collocate_task_list()

void grid_ref_collocate_task_list ( const grid_ref_task_list * ptr,
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.

Author
Ole Schuett

Definition at line 434 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_hab()

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 )
inlinestatic

Transforms hab from prim. cartesian to contracted spherical basis.

Author
Ole Schuett

Definition at line 462 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_one_grid_level()

void integrate_one_grid_level ( const grid_ref_task_list * ptr,
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] )
static

Integrate a range of tasks that belong to the same grid level.

Author
Ole Schuett

Definition at line 505 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grid_ref_integrate_task_list()

void grid_ref_integrate_task_list ( const grid_ref_task_list * ptr,
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.

Author
Ole Schuett

Definition at line 659 of file grid_ref_task_list.c.

Here is the call graph for this function:
Here is the caller graph for this function: