HILA
Loading...
Searching...
No Matches
vectorized_lattice_struct< vector_size > Struct Template Reference

#include <lattice_vector.h>

Collaboration diagram for vectorized_lattice_struct< vector_size >:

Public Member Functions

void build_wait_arrays ()
 
auto coordinates (int idx) const
 
unsigned field_alloc_size () const
 
void get_boundary_permutations ()
 Find the boundary permutations to different directions.
 
lattice_struct::nn_comminfo_struct get_comminfo (int d)
 Return the communication info.
 
void get_neighbours_and_local_halo ()
 
void get_receive_lists ()
 Get neighbour receive indices for MPI.
 
bool is_on_first_subnode (CoordinateVector v)
 Check if this is the first subnode.
 
unsigned loop_begin (::Parity P) const
 First index in a lattice loop.
 
unsigned loop_end (::Parity P) const
 Last index in a lattice loop.
 
void set_coordinates ()
 Build the structs for coordinates.
 
unsigned site_neighbour (Direction d, int idx) const
 
unsigned vector_neighbour (Direction d, int idx) const
 
 vectorized_lattice_struct ()
 

Public Attributes

size_t alloc_size
 The storage size of a field.
 
int boundary_permutation [NDIRS][vector_size]
 permutation vectors
 
unsigned *__restrict__ halo_index [NDIRS]
 storage for indexes to halo sites
 
unsigned halo_offset [NDIRS]
 offsets to boundary halos
 
bool is_boundary_permutation [4]
 True if boundary needs a permutation.
 
unsigned *__restrict__ neighbours [NDIRS]
 Storage for neighbour indexes on each site.
 
bool only_local_boundary_copy [NDIRS]
 True if the boundary elements are local.
 
unsigned * recv_list [NDIRS]
 
unsigned recv_list_size [NDIRS]
 The size of the receive list in each direction.
 
CoordinateVector subdivisions
 subnode divisions to different directions
 
CoordinateVector subnode_origin
 origin of the 1st subnode = origin of mynode
 
size_t v_sites
 pointer to the original lattice
 
unsigned char *__restrict__ vec_wait_arr_
 A wait array for the vectorized field.
 

Detailed Description

template<int vector_size>
struct vectorized_lattice_struct< vector_size >

Vectorized lattice struct stores information needed for vectorized access to lattice fields.

  • loop_begin, loop_end
  • neighbour arrays
  • twist permutations when needed
  • allocation size, including new halo sites (replaces field_alloc_size) these are used by fields which are laid out with vector structure

Definition at line 19 of file lattice_vector.h.

Constructor & Destructor Documentation

◆ vectorized_lattice_struct()

template<int vector_size>
vectorized_lattice_struct< vector_size >::vectorized_lattice_struct ( )
inline

Set up the vectorized lattice:

  • Split the lattice and record size and splits
  • Map indeces into local coordinate_list
  • Set up neighbour vector references mapping between the sites: here i is the original lattice site index vector_index = i / vector_size; index_in_vector = i % vector_size; Note that this maps site indices of 64 bit elements (double)and 32 bit (float) so that vector_index(32) = vector_index(64)/2 and index_in_vector(32) = index_in_vector(64) + (vector_index(64)%2)*vector_size(64) This removes the last direction where number of subnodes is divisible

Initialize

sites on vector

Definition at line 90 of file lattice_vector.h.

Member Function Documentation

◆ build_wait_arrays()

template<int vector_size>
void vectorized_lattice_struct< vector_size >::build_wait_arrays ( )
inline

Finally, initialize wait arrays it is a bit mask array containing a bit at location dir if the neighbour at that dir is out of the local volume

Definition at line 343 of file lattice_vector.h.

◆ coordinates()

template<int vector_size>
auto vectorized_lattice_struct< vector_size >::coordinates ( int  idx) const
inline

Return the coordinates of each vector nested as coordinate[Direction][vector_index]

Definition at line 389 of file lattice_vector.h.

◆ field_alloc_size()

template<int vector_size>
unsigned vectorized_lattice_struct< vector_size >::field_alloc_size ( ) const
inline

Return the number of sites that need to be allocated returns sites, not vectors!

Definition at line 382 of file lattice_vector.h.

◆ get_neighbours_and_local_halo()

template<int vector_size>
void vectorized_lattice_struct< vector_size >::get_neighbours_and_local_halo ( )
inline

Set the neighbour array, and also local halo mapping reserve extra storage for permutation halo sites there are 2*(area) v-sites to each direction with permutation,

  • mpi buffers too if needed. (separately allocated) to directions without permutation there is also
  • 2*(area) v-sites, filled in directly by MPI or copying from local node if no mpi comm. The copying is done to ease implementing different boundary conditions These come automatically when we tally up the neigbours below

set also the index array, if needed halo_index[d] points to the subnode modded neighbour site to dir d, if there is boundary twist (meaning there are on-node subnodes to this dir) we'll use the standard neighb array to do this.

Finally, how big the field allocation should be - IN SITES, not vectors

Definition at line 180 of file lattice_vector.h.

◆ set_coordinates()

template<int vector_size>
void vectorized_lattice_struct< vector_size >::set_coordinates ( )
inline

Build the structs for coordinates.

first vector_size elements should give the coordinates of vector offsets

Definition at line 322 of file lattice_vector.h.

◆ site_neighbour()

template<int vector_size>
unsigned vectorized_lattice_struct< vector_size >::site_neighbour ( Direction  d,
int  idx 
) const
inline

this gives the neighbour when the lattice is traversed site-by-site. Now idx is the "true" site index, not vector index

Definition at line 375 of file lattice_vector.h.

◆ vector_neighbour()

template<int vector_size>
unsigned vectorized_lattice_struct< vector_size >::vector_neighbour ( Direction  d,
int  idx 
) const
inline

get neighbours for this, with 2 different methods: First vector neighbour. Now idx is the vector index

Definition at line 369 of file lattice_vector.h.

Member Data Documentation

◆ recv_list

template<int vector_size>
unsigned* vectorized_lattice_struct< vector_size >::recv_list[NDIRS]

move data from receive buffer – sending is fine as it is takes the role of nn_comms

Definition at line 46 of file lattice_vector.h.

◆ v_sites

template<int vector_size>
size_t vectorized_lattice_struct< vector_size >::v_sites

pointer to the original lattice

vector sites on this node

Definition at line 27 of file lattice_vector.h.


The documentation for this struct was generated from the following file: