HiRep 0.1
Loading...
Searching...
No Matches
new_geometry.h
Go to the documentation of this file.
1/***************************************************************************\
2* Copyright (c) 2022, Claudio Pica, Sofie Martins *
3* All rights reserved. *
4\***************************************************************************/
5
9
16#ifndef NEW_GEOMETRY_H
17#define NEW_GEOMETRY_H
18
19#include "spinor_field.h"
20#include "suN.h"
21#include "suN_types.h"
22#include <stdint.h>
23#include <stddef.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29void define_geometry(void);
30void *sendbuf_alloc(size_t bytes_per_site);
31#ifdef WITH_GPU
32void *sendbuf_alloc_gpu(size_t bytes_per_site);
33#endif
34void sync_field(geometry_descriptor *gd, size_t byte_per_site, int is_spinor_like, void *latticebuf, void *sb_ptr);
35int test_define_geometry(void);
36void sendbuf_report(void);
37void sync_field_gpu(geometry_descriptor *, int, int, void *, void *);
38
39typedef struct coord4 {
40 uint8_t x[4];
41} coord4;
42
43enum box_type {
44 // L0 = 0, //unused
45 // L1 = 1, //unused
46 L2 = 2,
47 L3 = 3,
48 INNER = 4,
49 SENDBUF = 5
50};
51
56typedef struct box_t {
57 int l[4];
58 int h[4];
59 int base_index;
60 int base_index_odd;
61 int parity;
62 char mask;
63 enum box_type type; //< the type of the box, just a convenience for testing
65 struct box_t *
67 struct box_t *next;
69
70int boxEvenVolume(box_t *B);
71int boxOddVolume(box_t *B);
72int boxVolume(box_t *);
73void geometryMemSize(box_t *G, size_t *total, size_t *buffers);
74
75#define _DECLARE_SYNC_TO_BUFFER(_name, _field_type, _type) \
76 void sync_box_to_buffer_gpu_##_name(geometry_descriptor *, box_t *, _field_type *, void *);
77
78#define _DECLARE_SYNC_TO_BUFFER_REDUCED(_name, _field_type, _type) \
79 void sync_box_to_buffer_gpu_reduced_##_name(geometry_descriptor *, box_t *, _field_type *, void *, int, char); \
80 void sync_box_reduced_init_##_name(geometry_descriptor *, box_t *, _field_type *, void *, int);
81
82_DECLARE_SYNC_TO_BUFFER(spinor_field, spinor_field, suNf_spinor);
83_DECLARE_SYNC_TO_BUFFER(spinor_field_flt, spinor_field_flt, suNf_spinor_flt);
84
85_DECLARE_SYNC_TO_BUFFER_REDUCED(spinor_field, spinor_field, suNf_spinor);
86_DECLARE_SYNC_TO_BUFFER_REDUCED(spinor_field_flt, spinor_field_flt, suNf_spinor_flt)
87
88_DECLARE_SYNC_TO_BUFFER(scalar_field, scalar_field, double);
89
90_DECLARE_SYNC_TO_BUFFER(suNg_field, suNg_field, suNg);
91_DECLARE_SYNC_TO_BUFFER(suNf_field, suNf_field, suNf);
92_DECLARE_SYNC_TO_BUFFER(suNg_field_flt, suNg_field_flt, suNg_flt);
93_DECLARE_SYNC_TO_BUFFER(suNf_field_flt, suNf_field_flt, suNf_flt);
94_DECLARE_SYNC_TO_BUFFER(suNg_scalar_field, suNg_scalar_field, suNg_vector);
95_DECLARE_SYNC_TO_BUFFER(suNg_av_field, suNg_av_field, suNg_algebra_vector);
96_DECLARE_SYNC_TO_BUFFER(gtransf, gtransf, suNg);
97_DECLARE_SYNC_TO_BUFFER(ldl_field, ldl_field, ldl_t);
98_DECLARE_SYNC_TO_BUFFER(clover_term, clover_term, suNfc);
99_DECLARE_SYNC_TO_BUFFER(clover_force, clover_force, suNf);
100_DECLARE_SYNC_TO_BUFFER(staple_field, staple_field, suNg);
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif
void geometryMemSize(box_t *G, size_t *total, size_t *buffers)
Compute memory size for total=inner + buffers, and buffers only.
Definition new_geom.c:375
struct box_t box_t
The elementary site structures defined in suN.h are used in this file to define field structures that...
Definition new_geometry.h:56
int parity
0 -> base point is even; 1 -> basepoint is odd
Definition new_geometry.h:61
struct box_t * next
link to next box. NULL if last
Definition new_geometry.h:67
coord4 * icoord
given an index in the box return the 4D coordinates of the point in the box relative to the l[4]
Definition new_geometry.h:64
struct box_t * sendBox
if this is a border corresponding to a Recv buffer, this is the box to copy data from,...
Definition new_geometry.h:65
int h[4]
the upper right corner
Definition new_geometry.h:58
char mask
tells if the box is a border, e.g. if T_UP_MASK is set the box is in top T border of the extended lat...
Definition new_geometry.h:62
int l[4]
the lower left corner, the box base point (e.g. in the extended lattice)
Definition new_geometry.h:57
Clover Force.
Definition spinor_field.h:304
Clover term.
Definition spinor_field.h:288
Definition new_geometry.h:39
This struct should contain all information necessary to perform operations on the local lattice inclu...
Definition geometry_descriptor.h:106
Gauge transformation.
Definition spinor_field.h:336
LDL decomposition field needed for clover improvement.
Definition spinor_field.h:256
Scalar field of double precision real values.
Definition spinor_field.h:240
Spinor field array containing single precision SU(N_f) spinors in chosen fermion representation.
Definition spinor_field.h:207
Spinor field array containing SU(N_f) spinors in chosen fermion representation.
Definition spinor_field.h:189
Staple field for Luescher-Weisz
Definition spinor_field.h:320
Single precision gauge field in the chosen fermion representation.
Definition spinor_field.h:171
Gauge field in chosen fermion representation.
Definition spinor_field.h:153
Field of SU(N_g) algebra vectors.
Definition spinor_field.h:224
Gauge field of single precision SU(N_g) matrices.
Definition spinor_field.h:135
Gauge field of SU(N_g) matrices.
Definition spinor_field.h:98
SU(N_g) scalar field of SU(N_g) vectors.
Definition spinor_field.h:117