25 if (mu < 0 || mu >=
Nd)
30#pragma omp parallel for
31 for(
int i=0; i < nodeSites; ++i)
45std::ostream&
operator<<(std::ostream& s,
const multi1d<T>& s1)
47 for(
int i=0; i < s1.size(); ++i)
63 QDP_info(
"Set a subset: nsubset = %d",nsubset_indices);
67 sub.resize(nsubset_indices);
78#pragma omp parallel for
79 for(
int linear=0; linear < nodeSites; ++linear)
85 int icolor = fun(coord);
88 std::cerr<<
"linear="<<linear<<
" coord="<<coord<<
" node="<<node<<
" col="<<icolor << std::endl;
92 if (node != nodeNumber)
98 if (icolor < 0 || icolor >= nsubset_indices)
99 QDP_error_exit(
"Set: coloring is outside legal range: color[%d]=%d",linear,icolor);
117#pragma omp parallel for
118 for(
int cb=0; cb < nsubset_indices; ++cb)
123 int num_sitetable = 0;
126 for(
int linear=0; linear < nodeSites; ++linear) {
134 sitetable.
resize(num_sitetable);
142 if (num_sitetable > 0)
145 for(
int i=0; i < num_sitetable; ++i)
148 for(
int linear=0, j=0; linear < nodeSites; ++linear)
150 sitetable[j++] = linear;
156 start = sitetable[0];
157 end = sitetable[sitetable.
size()-1];
160 for(
int prev=sitetable[0], i=0; i < sitetable.
size(); ++i)
161 if (sitetable[i] != prev++)
164 QDP_info(
"Set(%d): sitetable[%d]=%d",cb,i,sitetable[i]);
179 sub[cb].make(ordRep, start, end, &(
sitetables[cb]), cb,
this);
virtual int numSubsets() const =0
multi1d< int > lat_color
Index or color array of lattice.
void make(const SetFunc &fn)
Constructor from a function object.
multi1d< multi1d< int > > sitetables
Array of sitetable arrays.
multi1d< Subset > sub
A set is composed of an array of subsets.
Container for a multi-dimensional 1D array.
int size() const
Size of array.
void resize(int ns1)
Resize routine, call a templated resize, using *this to disambiguate.
OScalar< PScalar< PScalar< RScalar< INTEGER32 > > > > Integer
OLattice< PScalar< PScalar< RScalar< INTEGER32 > > > > LatticeInteger
TextWriter & operator<<(TextWriter &txt, const std::string &output)
Layout namespace holding info on problem size and machine info.
int nodeNumber()
Returns the node number of this node.
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.
LatticeInteger latticeCoordinate(int mu)
coord[mu] <- mu : fill with lattice coord in mu direction
Yet another random number generator.
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.