115 multi1d<int> node_coord(
Nd);
140 for(
int i=0; i <
Nd; i++) {
194 QDP_error_exit(
"dimension of lattice size not the same as the default");
198 for(
int i=0; i <
Nd; ++i)
210 fprintf(stderr,
"vol=%d\n",
_layout.vol);
216 for(
int i=0; i <
Nd; ++i)
222 for(
int i=0; i <
Nd; ++i)
227 for(
int i=0; i <
Nd; ++i)
232 for(
int i=0; i <
Nd; ++i)
236 QDPIO::cout <<
" total number of nodes = " << 1 << std::endl;
242#pragma omp parallel for
243 for(
int i=0; i <
_layout.vol; ++i)
249 fprintf(stderr,
"call nodenumber\n");
251 fprintf(stderr,
"call sitecoords\n");
253 fprintf(stderr,
"call linearsiteindex\n");
255 fprintf(stderr,
"site= %d coord= %d %d %d %d j= %d node=%d\n",
256 i,coord[0],coord[1],coord[2],coord[3],
262 QDP_error_exit(
"Layout::create - Layout problems, the layout functions do not work correctly with this lattice size");
270 QDPIO::cout <<
"Finished lattice layout" << std::endl;
276#if QDP_USE_LEXICO_LAYOUT == 1
303#elif QDP_USE_CB2_LAYOUT == 1
316 int vol_cb =
vol() >> 1;
320 int cb = linearsite / vol_cb;
324 for(
int m=1; m<coord.size(); ++m)
328 coord[0] = 2*coord[0] + cbb;
337 int vol_cb =
vol() >> 1;
346 for(
int m=0; m<coord.size(); ++m)
350 return local_site(cb_coord, cb_nrow) + cb*vol_cb;
358#elif QDP_USE_CB3D_LAYOUT == 1
360QDPXX_MESSAGE(
"Using a 2 checkerboard (red/black) layout but in 3D. Time running fastest")
376 int vol_cb =
vol() / 2;
380 int cb = linearsite / vol_cb;
386 for(
int m=1; m<coord.size()-1; ++m)
391 coord[0] = 2*coord[0] + cbb;
400 int vol_cb =
vol() / 2;
409 for(
int m=0; m<coord.size()-1; ++m)
415 return local_site(cb_coord, cb_nrow) + cb*vol_cb;
422#elif QDP_USE_CB32_LAYOUT == 1
435 int vol_cb =
vol() >> (
Nd+1);
438 for(
int i=1; i <
Nd; ++i)
441 int subl = linearsite / vol_cb;
445 for(
int m=1; m<
Nd; ++m)
450 for(
int m=1; m<
Nd; ++m)
454 for(
int m=0; m<
Nd; ++m)
455 coord[m] ^= (subl & (1 << m)) >> m;
456 coord[0] ^= (subl & (1 <<
Nd)) >> (
Nd-1);
465 int vol_cb =
vol() >> (
Nd+1);
468 for(
int i=1; i <
Nd; ++i)
471 int subl = coord[
Nd-1] & 1;
472 for(
int m=
Nd-2; m >= 0; --m)
473 subl = (subl << 1) + (coord[m] & 1);
476 for(
int m=0; m <
Nd; ++m)
479 subl += (cb & 1) <<
Nd;
484 cb_coord[0] = coord[0] >> 2;
485 for(
int m=1; m <
Nd; ++m)
486 cb_coord[m] = coord[m] >> 1;
488 return local_site(cb_coord, cb_nrow) + subl*vol_cb;
494#error "no appropriate layout defined"
void init(size_t PoolSizeinMB)
static QDP::Allocator::QDPDefaultAllocator & Instance()
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 setIONodeGrid(const multi1d< int > &io_grid)
Set the I/O Node grid – satisfy interface.
void create()
Main lattice creation routine.
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.
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.
void setIONodeGridDefaults()
Default initializer.
int numIONodeGrid(void) QDP_CONST
number of I/O nodes
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.
StandardOutputStream cout
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.
MakeReturn< UnaryNode< FnFloor, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnFloor >::Type_t >::Expression_t floor(const QDPExpr< T1, C1 > &l)
int setProfileLevel(int n)
multi1d< int > crtesn(int ipos, const multi1d< int > &latt_size)
Decompose a lexicographic site into coordinates.
Primary include file for QDP.
Catch-alls for all memory allocators.
Local data specific to all architectures.
int subgrid_vol
Subgrid lattice volume.
multi1d< int > logical_size
Logical system size.
int vol
Total lattice volume.
multi1d< int > iogrid
IO Grid size.
multi1d< int > nrow
Lattice size.
multi1d< int > logical_coord
Logical node coordinates.