QDP++
QDP::Layout Namespace Reference

Layout namespace holding info on problem size and machine info. More...

Classes

struct  LocalLayout_t
 Local data specific to all architectures. More...

Functions

multi1d< int > nodeCoord (const multi1d< int > &coord)
 Returns the logical node coordinates for the corresponding lattice coordinate.
multi1d< int > localLexiCoordFromLinear (const int &linearr)
void QDPXX_getSiteCoords (int coord[], int node, int linear) QDP_CONST
int QDPXX_getLinearSiteIndex (const int coord[])
int QDPXX_nodeNumber (const int coord[])
void destroy ()
 Main destruction routine.
void setLattSize (const multi1d< int > &nrows)
 Set virtual grid (problem grid) lattice size.
void setSMPFlag (bool flag)
 Set SMP flag – true if using smp/multiprocessor mode on a node.
void setNumProc (int N)
 Set number of processors in a multi-threaded implementation.
const multi1d< int > & lattSize ()
 Virtual grid (problem grid) lattice size.
int vol ()
 Total lattice volume.
int sitesOnNode ()
 Subgrid lattice volume.
bool primaryNode ()
 Returns whether this is the primary node.
const multi1d< int > & subgridLattSize ()
 Subgrid (grid on each node) lattice size.
int nodeNumber ()
 Returns the node number of this node.
int numNodes ()
 Returns the number of nodes.
const multi1d< int > & nodeCoord ()
 Returns the logical node coordinates for this node.
const multi1d< int > & logicalSize ()
 Returns the logical size of this machine.
int getNodeNumberFrom (const multi1d< int > &node_coord)
 Returns the node number given some logical node coordinate.
multi1d< int > getLogicalCoordFrom (int node)
 Returns the logical node coordinates given some node number.
multi1d< int > minimalLayoutMapping ()
 Return the smallest lattice size per node allowed.
void init ()
 Initializer for layout.
int linearSiteIndex (int site)
 The linearized site index for the corresponding lexicographic site.
bool isIOGridDefined (void) QDP_CONST
 check if I/O grid is defined
int numIONodeGrid (void) QDP_CONST
 number of I/O nodes
void setIONodeGrid (const multi1d< int > &io_grid)
 Set the I/O Node grid – satisfy interface.
const multi1d< int > & getIONodeGrid () QDP_CONST
 Get the I/O Node grid.
void initDefaults ()
 Initializer for all the layout defaults.
void create ()
 Main lattice creation routine.
int outerSitesOnNode ()
 Subgrid lattice volume.
int nodeNumber (const multi1d< int > &coord)
 Returns the logical node number for the corresponding lattice coordinate.
void setIONodeGridDefaults ()
 Default initializer.
LatticeInteger latticeCoordinate (int mu)
 coord[mu] <- mu : fill with lattice coord in mu direction
int linearSiteIndex (const multi1d< int > &coord) QDP_CONST
 The linearized site index within a node for the corresponding lattice coordinate.
multi1d< int > siteCoords (int node, int index) QDP_CONST
 Reconstruct the lattice coordinate from the node and site number.

Variables

struct QDP::Layout::LocalLayout_t _layout

Detailed Description

Layout namespace holding info on problem size and machine info.

This is a namespace instead of a class since it is completely static - no such object should be created

The functions here should be common to all architectures

Function Documentation

◆ create()

◆ destroy()

void QDP::Layout::destroy ( )

Main destruction routine.

Definition at line 89 of file qdp_parscalar_layout.cc.

References QDP::RNG::finalizeRNG().

◆ getIONodeGrid()

const multi1d< int > & QDP::Layout::getIONodeGrid ( )

Get the I/O Node grid.

Definition at line 211 of file qdp_parscalar_layout.cc.

References _layout, and QDP_CONST.

Referenced by QDP::io_node().

◆ getLogicalCoordFrom()

multi1d< int > QDP::Layout::getLogicalCoordFrom ( int node)

Returns the logical node coordinates given some node number.

This is not meant to be speedy

Definition at line 138 of file qdp_parscalar_layout.cc.

References QDP::Nd.

Referenced by create(), QDP::io_node(), and QDP::Map::operator()().

◆ getNodeNumberFrom()

int QDP::Layout::getNodeNumberFrom ( const multi1d< int > & node_coord)

Returns the node number given some logical node coordinate.

This is not meant to be speedy

Definition at line 131 of file qdp_parscalar_layout.cc.

References QDP::multi1d< T >::slice().

Referenced by create(), and QDP::io_node().

◆ init()

void QDP::Layout::init ( )

Initializer for layout.

Initialize some fundamental pieces of the layout.

This routine is used to boostrap the create function below

Definition at line 157 of file qdp_parscalar_layout.cc.

References _layout.

Referenced by QDP::QDP_initialize().

◆ initDefaults()

void QDP::Layout::initDefaults ( )

Initializer for all the layout defaults.

Definition at line 217 of file qdp_parscalar_layout.cc.

References QDP::getProgramProfileLevel(), QDP::initDefaultMaps(), QDP::RNG::initDefaultRNG(), QDP::initDefaultSets(), QDP::QDP_info(), and QDP::setProfileLevel().

Referenced by create().

◆ isIOGridDefined()

bool QDP::Layout::isIOGridDefined ( void )

check if I/O grid is defined

Check if I/O grid is defined.

Always defined for scalar node: it is 1x1x1x1

Definition at line 182 of file qdp_parscalar_layout.cc.

References _layout, and QDP_CONST.

Referenced by QDP::io_node().

◆ latticeCoordinate()

LatticeInteger QDP::Layout::latticeCoordinate ( int mu)

coord[mu] <- mu : fill with lattice coord in mu direction

Definition at line 19 of file qdp_scalarsite_specific.cc.

References QDP::OLattice< T >::elem(), QDP::OScalar< T >::elem(), QDP::Nd, nodeNumber(), QDP::QDP_error_exit(), siteCoords(), and sitesOnNode().

Referenced by QDP::RNG::initRNG().

◆ lattSize()

◆ linearSiteIndex() [1/2]

int QDP::Layout::linearSiteIndex ( const multi1d< int > & coord)

The linearized site index within a node for the corresponding lattice coordinate.

The API requires this function to be here

References QDP_CONST.

◆ linearSiteIndex() [2/2]

◆ localLexiCoordFromLinear()

multi1d< int > QDP::Layout::localLexiCoordFromLinear ( const int & linearr)

Definition at line 28 of file qdp_layout.cc.

References QDP::Nd, and subgridLattSize().

◆ logicalSize()

const multi1d< int > & QDP::Layout::logicalSize ( )

Returns the logical size of this machine.

Definition at line 127 of file qdp_parscalar_layout.cc.

References _layout.

Referenced by QDP::io_node().

◆ minimalLayoutMapping()

multi1d< int > QDP::Layout::minimalLayoutMapping ( )

Return the smallest lattice size per node allowed.

Referenced by create().

◆ nodeCoord() [1/2]

const multi1d< int > & QDP::Layout::nodeCoord ( )

Returns the logical node coordinates for this node.

Definition at line 124 of file qdp_parscalar_layout.cc.

References _layout.

Referenced by QDP::Map::operator()().

◆ nodeCoord() [2/2]

multi1d< int > QDP::Layout::nodeCoord ( const multi1d< int > & coord)

Returns the logical node coordinates for the corresponding lattice coordinate.

Definition at line 18 of file qdp_layout.cc.

References QDP::Nd, and subgridLattSize().

◆ nodeNumber() [1/2]

◆ nodeNumber() [2/2]

int QDP::Layout::nodeNumber ( const multi1d< int > & coord)

Returns the logical node number for the corresponding lattice coordinate.

The API requires this function to be here

Definition at line 96 of file qdp_scalar_layout.cc.

◆ numIONodeGrid()

int QDP::Layout::numIONodeGrid ( void )

number of I/O nodes

Definition at line 188 of file qdp_parscalar_layout.cc.

References _layout, and QDP_CONST.

Referenced by QDP::io_node().

◆ numNodes()

int QDP::Layout::numNodes ( )

Returns the number of nodes.

Definition at line 121 of file qdp_parscalar_layout.cc.

References _layout.

Referenced by create(), QDP::QDPFileReader::open(), QDP::QDPFileWriter::open(), QDP::QDP_error(), QDP::QDP_error_exit(), and QDP::QDP_info().

◆ outerSitesOnNode()

int QDP::Layout::outerSitesOnNode ( )

Subgrid lattice volume.

Number of sites in the outer grid.

Definition at line 105 of file qdp_parscalarvec_layout.cc.

References _layout.

◆ primaryNode()

bool QDP::Layout::primaryNode ( )

Returns whether this is the primary node.

Always true on a scalar platform

Always true on a scalarvec platform

Definition at line 112 of file qdp_parscalar_layout.cc.

References _layout.

Referenced by QDP::BinaryStoreDB< K, D >::binaryKeysAndData(), QDP::BinaryStoreDB< K, D >::BinaryStoreDB(), QDP::QDPInternal::broadcast_str(), QDP::MapObjDiskEnv::checkForNewFile(), QDP::BinaryBufferReader::clear(), QDP::BinaryBufferReaderWriter::clear(), QDP::BinaryBufferWriter::clear(), QDP::BinaryFileReader::close(), QDP::BinaryFileReaderWriter::close(), QDP::BinaryFileWriter::close(), QDP::BinaryStoreDB< K, D >::close(), QDP::TextFileReader::close(), QDP::TextFileWriter::close(), QDP::XMLFileWriter::close(), QDP::XMLReader::close(), QDP::XMLWriter::closeTag(), QDP::XMLReader::count(), QDP::BinaryReader::currentPosition(), QDP::BinaryReaderWriter::currentPosition(), QDP::BinaryWriter::currentPosition(), QDP::BinaryStoreDB< K, D >::disablePageMove(), QDP::Allocator::QDPDefaultAllocator::dump(), QDP::Allocator::QDPPoolAllocator::dump(), QDP::XMLWriter::emptyTag(), QDP::XMLWriter::emptyTag(), QDP::XMLWriter::emptyTag(), QDP::BinaryStoreDB< K, D >::enablePageMove(), QDP::BinaryStoreDB< K, D >::exist(), QDP::BinaryReader::fail(), QDP::BinaryReaderWriter::fail(), QDP::BinaryWriter::fail(), QDP::StandardInputStream::fail(), QDP::StandardOutputStream::fail(), QDP::TextReader::fail(), QDP::TextWriter::fail(), QDP::XMLFileWriter::fail(), QDP::BinaryStoreDB< K, D >::fileExists(), QDP::BinaryFileReaderWriter::flush(), QDP::BinaryFileWriter::flush(), QDP::BinaryStoreDB< K, D >::flush(), QDP::StandardOutputStream::flush(), QDP::TextFileWriter::flush(), QDP::XMLFileWriter::flush(), QDP::BinaryStoreDB< K, D >::get(), QDP::XMLReader::get(), QDP::BinaryStoreDB< K, D >::getBinary(), QDP::BinaryStoreDB< K, D >::getMaxNumberConfigs(), QDP::BinaryStoreDB< K, D >::getMaxUserInfoLen(), QDP::BinaryStoreDB< K, D >::getUserdata(), QDP::BinaryStoreDB< K, D >::insert(), QDP::BinaryStoreDB< K, D >::insertBinary(), QDP::BinaryStoreDB< K, D >::insertUserdata(), QDP::BinaryFileReader::is_open(), QDP::BinaryFileReaderWriter::is_open(), QDP::BinaryFileWriter::is_open(), QDP::TextFileReader::is_open(), QDP::TextFileWriter::is_open(), QDP::XMLFileWriter::is_open(), QDP::BinaryStoreDB< K, D >::keys(), QDP::BinaryStoreDB< K, D >::keysAndData(), QDP::BinaryBufferReader::open(), QDP::BinaryBufferReaderWriter::open(), QDP::BinaryBufferWriter::open(), QDP::BinaryFileReader::open(), QDP::BinaryFileReaderWriter::open(), QDP::BinaryFileWriter::open(), QDP::BinaryStoreDB< K, D >::open(), QDP::QDPFileReader::open(), QDP::TextBufferReader::open(), QDP::TextBufferWriter::open(), QDP::TextFileReader::open(), QDP::TextFileWriter::open(), QDP::XMLBufferWriter::open(), QDP::XMLFileWriter::open(), QDP::XMLReader::open(), QDP::XMLReader::open(), QDP::XMLReader::open(), QDP::XMLWriter::openTag(), QDP::XMLWriter::openTag(), QDP::XMLWriter::openTag(), QDP::XMLWriter::openTag(), QDP::operator<<(), QDP::StandardOutputStream::operator<<(), QDP::StandardOutputStream::operator<<(), QDP::StandardOutputStream::operator<<(), QDP::StandardOutputStream::operator<<(), QDP::StandardOutputStream::operator<<(), QDP::StandardInputStream::operator>>(), QDP::XMLReader::print(), QDP::XMLReader::printCurrentContext(), QDP::QDP_initialize(), QDP::BinaryReader::read(), QDP::QDPFileReader::read(), QDP::QDPFileReader::read(), QDP::QDPFileReader::read(), QDP::QDPFileReader::read(), QDP::QDPFileReader::read(), QDP::QDPFileReader::read(), QDP::TextReader::read(), QDP::readArchiv(), QDP::BinaryReader::readArrayLittleEndian(), QDP::BinaryReader::readArrayPrimaryNode(), QDP::BinaryReader::readArrayPrimaryNodeLittleEndian(), QDP::XMLReader::readAttrPrimitive(), QDP::BinaryReader::readDesc(), QDP::readOLattice(), QDP::readOLattice(), QDP::readOLattice(), QDP::LatticeTimeSliceIO::readOLatticeSlice(), QDP::StandardInputStream::readPrimitive(), QDP::TextReader::readPrimitive(), QDP::XMLReader::readPrimitive(), QDP::XMLReader::registerNamespace(), QDP::BinaryReader::rewind(), QDP::BinaryReaderWriter::rewind(), QDP::BinaryWriter::rewind(), QDP::BinaryReader::seek(), QDP::BinaryReaderWriter::seek(), QDP::BinaryWriter::seek(), QDP::BinaryReader::seekBegin(), QDP::BinaryReaderWriter::seekBegin(), QDP::BinaryWriter::seekBegin(), QDP::BinaryReader::seekEnd(), QDP::BinaryReaderWriter::seekEnd(), QDP::BinaryWriter::seekEnd(), QDP::BinaryReader::seekRelative(), QDP::BinaryReaderWriter::seekRelative(), QDP::BinaryWriter::seekRelative(), QDP::QDPInternal::sendToPrimaryNode(), QDP::XMLReader::set(), QDP::BinaryStoreDB< K, D >::setCacheSize(), QDP::BinaryStoreDB< K, D >::setCacheSizeMB(), QDP::BinaryStoreDB< K, D >::setMaxNumberConfigs(), QDP::BinaryStoreDB< K, D >::setMaxUserInfoLen(), QDP::BinaryStoreDB< K, D >::setNumberBuckets(), QDP::BinaryStoreDB< K, D >::setPageSize(), QDP::BinaryStoreDB< K, D >::storageName(), QDP::BinaryBufferReader::str(), QDP::BinaryBufferReaderWriter::str(), QDP::BinaryBufferWriter::str(), QDP::TextBufferReader::str(), QDP::TextBufferWriter::str(), QDP::XMLBufferWriter::str(), QDP::BinaryBufferReader::strPrimaryNode(), QDP::BinaryBufferReaderWriter::strPrimaryNode(), QDP::BinaryBufferWriter::strPrimaryNode(), QDP::TextBufferReader::strPrimaryNode(), QDP::TextBufferWriter::strPrimaryNode(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::QDPFileWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::XMLWriter::write(), QDP::writeArchiv(), QDP::BinaryWriter::writeArrayPrimaryNode(), QDP::writeOLattice(), QDP::writeOLattice(), QDP::writeOLattice(), QDP::LatticeTimeSliceIO::writeOLatticeSlice(), QDP::StandardOutputStream::writePrimitive(), QDP::TextWriter::writePrimitive(), and QDP::XMLWriter::writeXML().

◆ QDPXX_getLinearSiteIndex()

int QDP::Layout::QDPXX_getLinearSiteIndex ( const int coord[])

Definition at line 50 of file qdp_layout.cc.

References linearSiteIndex(), and QDP::Nd.

Referenced by siteCoords().

◆ QDPXX_getSiteCoords()

void QDP::Layout::QDPXX_getSiteCoords ( int coord[],
int node,
int linear )

Definition at line 43 of file qdp_layout.cc.

References QDP::Nd, QDP_CONST, and siteCoords().

Referenced by siteCoords().

◆ QDPXX_nodeNumber()

int QDP::Layout::QDPXX_nodeNumber ( const int coord[])

Definition at line 58 of file qdp_layout.cc.

References QDP::Nd, and nodeNumber().

Referenced by siteCoords().

◆ setIONodeGrid()

void QDP::Layout::setIONodeGrid ( const multi1d< int > & io_grid)

Set the I/O Node grid – satisfy interface.

set the IO node grid

Definition at line 197 of file qdp_parscalar_layout.cc.

References _layout, and QDP::Nd.

Referenced by QDP::QDP_initialize().

◆ setIONodeGridDefaults()

void QDP::Layout::setIONodeGridDefaults ( )

Default initializer.

Definition at line 136 of file qdp_scalar_layout.cc.

References _layout, and QDP::Nd.

◆ setLattSize()

void QDP::Layout::setLattSize ( const multi1d< int > & nrows)

Set virtual grid (problem grid) lattice size.

Set lattice size – problem size.

Definition at line 92 of file qdp_parscalar_layout.cc.

References _layout.

◆ setNumProc()

void QDP::Layout::setNumProc ( int N)

Set number of processors in a multi-threaded implementation.

For now, this is ignored

Definition at line 100 of file qdp_parscalar_layout.cc.

◆ setSMPFlag()

void QDP::Layout::setSMPFlag ( bool flag)

Set SMP flag – true if using smp/multiprocessor mode on a node.

For now, this is ignored

Definition at line 96 of file qdp_parscalar_layout.cc.

◆ siteCoords()

multi1d< int > QDP::Layout::siteCoords ( int node,
int index )

Reconstruct the lattice coordinate from the node and site number.

This is the inverse of the nodeNumber and linearSiteIndex functions. The API requires this function to be here.

References QDP_CONST, QDPXX_getLinearSiteIndex(), QDPXX_getSiteCoords(), and QDPXX_nodeNumber().

Referenced by create(), QDP::get_coords(), latticeCoordinate(), QDP::Map::make(), QDP::Set::make(), and QDPXX_getSiteCoords().

◆ sitesOnNode()

◆ subgridLattSize()

const multi1d< int > & QDP::Layout::subgridLattSize ( )

◆ vol()

Variable Documentation

◆ _layout