HILA
|
#include <lattice.h>
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, NDIRS > | nn_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. | |
The lattice struct defines the lattice geometry ans sets up MPI communication patterns
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.
|
inline |
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.
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.
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.
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.