(git:374b731)
Loading...
Searching...
No Matches
grid_ref_task_list.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* CP2K: A general program to perform molecular dynamics simulations */
3/* Copyright 2000-2024 CP2K developers group <https://cp2k.org> */
4/* */
5/* SPDX-License-Identifier: BSD-3-Clause */
6/*----------------------------------------------------------------------------*/
7#ifndef GRID_REF_TASK_LIST_H
8#define GRID_REF_TASK_LIST_H
9
10#include <stdbool.h>
11
12#include "../../offload/offload_buffer.h"
13#include "../common/grid_basis_set.h"
14#include "../common/grid_constants.h"
15
16/*******************************************************************************
17 * \brief Internal representation of a task.
18 * \author Ole Schuett
19 ******************************************************************************/
20typedef struct {
21 int level;
22 int iatom;
23 int jatom;
24 int iset;
25 int jset;
26 int ipgf;
27 int jpgf;
30 double radius;
31 double rab[3];
33
34/*******************************************************************************
35 * \brief Internal representation of a grid layout.
36 * \author Ole Schuett
37 ******************************************************************************/
38typedef struct {
39 int npts_global[3];
40 int npts_local[3];
41 int shift_local[3];
42 int border_width[3];
43 double dh[3][3];
44 double dh_inv[3][3];
46
47/*******************************************************************************
48 * \brief Internal representation of a task list.
49 * \author Ole Schuett
50 ******************************************************************************/
70
71/*******************************************************************************
72 * \brief Allocates a task list for the reference backend.
73 * See grid_task_list.h for details.
74 * \author Ole Schuett
75 ******************************************************************************/
77 const bool orthorhombic, const int ntasks, const int nlevels,
78 const int natoms, const int nkinds, const int nblocks,
79 const int block_offsets[nblocks], const double atom_positions[natoms][3],
80 const int atom_kinds[natoms], const grid_basis_set *basis_sets[nkinds],
81 const int level_list[ntasks], const int iatom_list[ntasks],
82 const int jatom_list[ntasks], const int iset_list[ntasks],
83 const int jset_list[ntasks], const int ipgf_list[ntasks],
84 const int jpgf_list[ntasks], const int border_mask_list[ntasks],
85 const int block_num_list[ntasks], const double radius_list[ntasks],
86 const double rab_list[ntasks][3], const int npts_global[nlevels][3],
87 const int npts_local[nlevels][3], const int shift_local[nlevels][3],
88 const int border_width[nlevels][3], const double dh[nlevels][3][3],
89 const double dh_inv[nlevels][3][3], grid_ref_task_list **task_list);
90
91/*******************************************************************************
92 * \brief Deallocates given task list, basis_sets have to be freed separately.
93 * \author Ole Schuett
94 ******************************************************************************/
96
97/*******************************************************************************
98 * \brief Collocate all tasks of in given list onto given grids.
99 * See grid_task_list.h for details.
100 * \author Ole Schuett
101 ******************************************************************************/
103 const enum grid_func func, const int nlevels,
104 const offload_buffer *pab_blocks,
105 offload_buffer *grids[nlevels]);
106
107/*******************************************************************************
108 * \brief Integrate all tasks of in given list from given grids.
109 * See grid_task_list.h for details.
110 * \author Ole Schuett
111 ******************************************************************************/
113 const grid_ref_task_list *task_list, const bool compute_tau,
114 const int natoms, const int nlevels, const offload_buffer *pab_blocks,
115 const offload_buffer *grids[nlevels], offload_buffer *hab_blocks,
116 double forces[natoms][3], double virial[3][3]);
117
118#endif
119
120// EOF
grid_func
static void const int const int const int const int const int const double const int const int const int npts_local[3]
void grid_ref_collocate_task_list(const grid_ref_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.
void grid_ref_free_task_list(grid_ref_task_list *task_list)
Deallocates given task list, basis_sets have to be freed separately.
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)
Allocates a task list for the reference backend. See grid_task_list.h for details.
void grid_ref_integrate_task_list(const grid_ref_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.
Internal representation of a basis set.
Internal representation of a grid layout.
Internal representation of a task list.
grid_ref_layout * layouts
grid_basis_set ** basis_sets
grid_ref_task * tasks
Internal representation of a task.
Internal representation of a buffer.