97 int nodeNumber(
const multi1d<int>& coord) {
return 0;}
116 multi1d<int> node_coord(
Nd);
153 QDP_error_exit(
"dimension of lattice size not the same as the default");
156 for(
int i=0; i <
Nd; ++i)
168 fprintf(stderr,
"vol=%d\n",
_layout.vol);
173 QDP_error_exit(
"Layout::create() - this scalarvec implementation requires there be a multiple of %d sites",
INNER_LEN);
177 for(
int i=0; i <
vol(); ++i)
181 QDP_error_exit(
"Layout::create - Layout problems, the layout functions do not work correctly with this lattice size");
187 QDP_info(
"Finished lattice layout");
193#if QDP_USE_LEXICO_LAYOUT == 1
220#elif QDP_USE_CB2_LAYOUT == 1
233 int vol_cb =
vol() >> 1;
237 int cb = linearsite / vol_cb;
241 for(
int m=1; m<coord.size(); ++m)
245 coord[0] = 2*coord[0] + cbb;
254 int vol_cb =
vol() >> 1;
263 for(
int m=0; m<coord.size(); ++m)
267 return local_site(cb_coord, cb_nrow) + cb*vol_cb;
273#elif QDP_USE_CB32_LAYOUT == 1
286 int vol_cb =
vol() >> (
Nd+1);
289 for(
int i=1; i <
Nd; ++i)
292 int subl = linearsite / vol_cb;
296 for(
int m=1; m<
Nd; ++m)
301 for(
int m=1; m<
Nd; ++m)
305 for(
int m=0; m<
Nd; ++m)
306 coord[m] ^= (subl & (1 << m)) >> m;
307 coord[0] ^= (subl & (1 <<
Nd)) >> (
Nd-1);
316 int vol_cb =
vol() >> (
Nd+1);
319 for(
int i=1; i <
Nd; ++i)
322 int subl = coord[
Nd-1] & 1;
323 for(
int m=
Nd-2; m >= 0; --m)
324 subl = (subl << 1) + (coord[m] & 1);
327 for(
int m=0; m <
Nd; ++m)
330 subl += (cb & 1) <<
Nd;
335 cb_coord[0] = coord[0] >> 2;
336 for(
int m=1; m <
Nd; ++m)
337 cb_coord[m] = coord[m] >> 1;
339 return local_site(cb_coord, cb_nrow) + subl*vol_cb;
345#error "no appropriate layout defined"
Container for a multi-dimensional 1D array.
Layout namespace holding info on problem size and machine info.
int nodeNumber()
Returns the node number of this node.
struct QDP::Layout::LocalLayout_t _layout
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 create()
Main lattice creation routine.
int outerSitesOnNode()
Subgrid lattice volume.
void initDefaults()
Initializer for all the layout defaults.
int getNodeNumberFrom(const multi1d< int > &node_coord)
Returns the node number given some logical node coordinate.
void init()
Initializer for layout.
int numNodes()
Returns the number of nodes.
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
const multi1d< int > & subgridLattSize()
Subgrid (grid on each node) lattice size.
void setNumProc(int N)
Set number of processors in a multi-threaded implementation.
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.
void initDefaultRNG()
Initialize the random number generator with a default seed.
Yet another random number generator.
int getProgramProfileLevel()
bool QDP_isInitialized()
Is the machine initialized?
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
int local_site(const multi1d< int > &coord, const multi1d< int > &latt_size)
Calculates the lexicographic site index from the coordinate of a site.
void initDefaultMaps()
Initializer for maps.
void initDefaultSets()
Initializer for sets.
int setProfileLevel(int n)
multi1d< int > crtesn(int ipos, const multi1d< int > &latt_size)
Decompose a lexicographic site into coordinates.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.
Local data specific to all architectures.
int subgrid_vol
Subgrid lattice volume.
int olattice_vol
Outer-subgrid lattice volume.
multi1d< int > logical_size
Logical system size.
int vol
Total lattice volume.
multi1d< int > nrow
Lattice size.
multi1d< int > logical_coord
Logical node coordinates.