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 setup (const CoordinateVector &siz)
 General lattice setup.
 
void setup_nodes ()
 invert the mynode index -> location (only on this node)
 
bool is_initialized () const
 is the lattice initialized
 
bool is_on_mynode (const CoordinateVector &c) const
 Is the coordinate on THIS node.
 
int node_rank (const CoordinateVector &c) const
 
unsigned site_index (const CoordinateVector &c) const
 
unsigned site_index (const CoordinateVector &c, const unsigned node) const
 
void create_std_gathers ()
 
CoordinateVector global_coordinates (size_t index) const
 

Public Attributes

std::array< nn_comminfo_struct, NDIRSnn_comminfo
 nearest neighbour comminfo struct
 
unsigned *__restrict__ neighb [NDIRS]
 Main neighbour index array.
 
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

Definition at line 62 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 430 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 388 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

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 100 of file lattice.cpp.

◆ setup_nodes()

void lattice_struct::setup_nodes ( )

invert the mynode index -> location (only on this node)

Set up the basic list about all nodes NOTE: in case of very large number of nodes this may be inconveniently large. Alternatives?

Definition at line 291 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 136 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 164 of file lattice.cpp.


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