QDP++
qdp_layout.h
Go to the documentation of this file.
1// -*- C++ -*-
2
8
9#ifndef QDP_LAYOUT_H
10#define QDP_LAYOUT_H
11
12namespace QDP {
13
20
22
28 namespace Layout
29 {
31
32 void init();
33
35 void create();
36
38 void destroy();
39
41 void setLattSize(const multi1d<int>& nrows);
42
44 void setSMPFlag(bool);
45
47 void setNumProc(int N);
48
50
51 int nodeNumber(const multi1d<int>& coord) QDP_CONST;
52
53 //returns local lexicographical site coordinate from linear index:
54 multi1d<int> localLexiCoordFromLinear(const int& linearr) QDP_CONST;
55
57
59
61
65 multi1d<int> siteCoords(int node, int index) QDP_CONST;
66
67 extern "C" {
68 /* Export this to "C" */
69 void QDPXX_getSiteCoords(int coord[], int node, int linear) QDP_CONST;
70 int QDPXX_getLinearSiteIndex(const int coord[]);
71 int QDPXX_nodeNumber(const int coord[]);
72
73 };
74
77
79 int numNodes() QDP_CONST;
80
81
83 const multi1d<int>& lattSize() QDP_CONST;
84
86 int vol() QDP_CONST;
87
90
93
95 int linearSiteIndex(int lexicosite) QDP_CONST;
96
98 const multi1d<int>& nodeCoord() QDP_CONST;
99
101 multi1d<int> nodeCoord(const multi1d<int>& coord);
102
104 const multi1d<int>& subgridLattSize() QDP_CONST;
105
107 const multi1d<int>& logicalSize() QDP_CONST;
108
110
111 int getNodeNumberFrom(const multi1d<int>& node_coord);
112
114
115 multi1d<int> getLogicalCoordFrom(int node);
116
117
119 bool isIOGridDefined(void) QDP_CONST;
120
122 void setIONodeGrid(const multi1d<int>& io_grid);
123
125 int numIONodeGrid(void) QDP_CONST;
126
128 const multi1d<int>& getIONodeGrid() QDP_CONST;
129
130
131 }
132
135
136 // end of group layout
138
139} // namespace QDP
140
141#endif
ArrayBiDirectional of general permutation map class for communications.
Container for a multi-dimensional 1D array.
Definition qdp_multi.h:25
ArrayBiDirectionalMap shift
Definition of shift function object.
Definition qdp_map.cc:14
Layout namespace holding info on problem size and machine info.
Definition qdp_layout.cc:16
int nodeNumber()
Returns the node number of this node.
const multi1d< int > & logicalSize()
Returns the logical size of this machine.
void setLattSize(const multi1d< int > &nrows)
Set virtual grid (problem grid) lattice size.
int linearSiteIndex(int site)
The linearized site index for the corresponding lexicographic site.
int sitesOnNode()
Subgrid lattice volume.
multi1d< int > siteCoords(int node, int index) QDP_CONST
Reconstruct the lattice coordinate from the node and site number.
void setIONodeGrid(const multi1d< int > &io_grid)
Set the I/O Node grid – satisfy interface.
void create()
Main lattice creation routine.
int getNodeNumberFrom(const multi1d< int > &node_coord)
Returns the node number given some logical node coordinate.
void QDPXX_getSiteCoords(int coord[], int node, int linear) QDP_CONST
Definition qdp_layout.cc:43
void init()
Initializer for layout.
int QDPXX_getLinearSiteIndex(const int coord[])
Definition qdp_layout.cc:50
int numNodes()
Returns the number of nodes.
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
bool isIOGridDefined(void) QDP_CONST
check if I/O grid is defined
const multi1d< int > & subgridLattSize()
Subgrid (grid on each node) lattice size.
void setNumProc(int N)
Set number of processors in a multi-threaded implementation.
int numIONodeGrid(void) QDP_CONST
number of I/O nodes
multi1d< int > localLexiCoordFromLinear(const int &linearr)
Definition qdp_layout.cc:28
multi1d< int > getLogicalCoordFrom(int node)
Returns the logical node coordinates given some node number.
void setSMPFlag(bool flag)
Set SMP flag – true if using smp/multiprocessor mode on a node.
int vol()
Total lattice volume.
bool primaryNode()
Returns whether this is the primary node.
void destroy()
Main destruction routine.
const multi1d< int > & nodeCoord()
Returns the logical node coordinates for this node.
const multi1d< int > & getIONodeGrid() QDP_CONST
Get the I/O Node grid.
int QDPXX_nodeNumber(const int coord[])
Definition qdp_layout.cc:58
Yet another random number generator.
#define QDP_CONST
Definition qdp.h:63