HILA
Loading...
Searching...
No Matches
lattice_struct Class Reference

#include <lattice.h>

Collaboration diagram for lattice_struct:

Classes

struct  allnodes
 information about all nodes More...
 
struct  comm_node_struct
 Information necessary to communicate with a node. More...
 
struct  gen_comminfo_struct
 general communication More...
 
struct  nn_comminfo_struct
 nn-communication has only 1 node to talk to More...
 
struct  node_struct
 Information about the node stored on this process. More...
 

Public Member Functions

void create_std_gathers ()
 
CoordinateVector global_coordinates (size_t index) const
 
bool is_on_mynode (const CoordinateVector &c) const
 Is the coordinate on THIS node ?
 
int node_rank (const CoordinateVector &c) const
 
void setup_base_lattice (const CoordinateVector &siz)
 General lattice setup.
 
void setup_node_divisors ()
 
void setup_nodes ()
 
unsigned site_index (const CoordinateVector &c) const
 
unsigned site_index (const CoordinateVector &c, const unsigned node) const
 

Public Attributes

unsigned *__restrict__ neighb [NDIRS]
 Main neighbour index array.
 
std::array< nn_comminfo_struct, NDIRSnn_comminfo
 nearest neighbour comminfo struct
 
dir_mask_t *__restrict__ wait_arr_
 implement waiting using mask_t - unsigned char is good for up to 4 dim.
 

Detailed Description

The lattice struct defines the lattice geometry ans sets up MPI communication patterns

Examples
/home/runner/work/HILA/HILA/libraries/plumbing/field.h.

Definition at line 66 of file lattice.h.

Member Function Documentation

◆ create_std_gathers()

void lattice_struct::create_std_gathers ( )

Create the neighbour index arrays This is for the index array neighbours TODO: implement some other neighbour schemas!

Definition at line 471 of file lattice.cpp.

◆ global_coordinates()

CoordinateVector lattice_struct::global_coordinates ( size_t  index) const
inline

Return the coordinates of a site, where 1st dim (x) runs fastest etc. Useful in for (int64_t i=0; i<lattice.volume(); i++) { auto c = lattice.global_coordinates(i);

Definition at line 356 of file lattice.h.

◆ node_rank()

int lattice_struct::node_rank ( const CoordinateVector loc) const

The routines is_on_mynode(), node_rank(), site_index() implement the "layout" of the nodes and sites of the lattice. To be changed in different implementations! Get the node rank for coordinates This is the fundamental routine which defines how the nodes are mapped. map_node_layout MUST BE compatible with this algorithm! So if you change this, change that too Divisor moved now below

Here the node number along one Direction is calculated with loc * n_divisions/l_size (with integer division) example: with l_size=14 and n_divisions=3, the dividers are at 0, 5, 10, 14

Definition at line 102 of file lattice.cpp.

◆ setup_node_divisors()

void lattice_struct::setup_node_divisors ( )

In this routine we set up the node divisors this must be compatible with the node_rank above

Definition at line 123 of file lattice.cpp.

◆ setup_nodes()

void lattice_struct::setup_nodes ( )

only thing setup_nodes now does is to call mynode.setup and set the max size field of nodes-struct

Definition at line 353 of file lattice.cpp.

◆ site_index() [1/2]

unsigned lattice_struct::site_index ( const CoordinateVector loc) const

give site index for ON NODE sites Note: loc really has to be on this node

Definition at line 165 of file lattice.cpp.

◆ site_index() [2/2]

unsigned lattice_struct::site_index ( const CoordinateVector loc,
const unsigned  nodeid 
) const

give site index for nodeid sites compare to above

Definition at line 191 of file lattice.cpp.


The documentation for this class was generated from the following files: