7#ifndef QDP_PARSCALARVEC_SPECIFIC_H
8#define QDP_PARSCALARVEC_SPECIFIC_H
31 void route(
void *send_buf,
int srce_node,
int dest_node,
int count);
37 void sendToWait(
void *send_buf,
int dest_node,
int count);
40 void recvFromWait(
void *recv_buf,
int srce_node,
int count);
60 *(
unsigned int*)inout += *(
unsigned int*)in;
66 for(
int i=0; i < len; i++, dest++)
67 QMP_binary_reduction(dest,
sizeof(
unsigned int), sumAnUnsigned);
73 for(
unsigned int i=0; i < len; i++, dest++)
80 QMP_sum_float_array(dest, len);
86 QMP_sum_double_array(dest, len);
103 QMP_broadcast((
void *)&dest,
sizeof(T));
110 inline void broadcast(
void* dest,
size_t nbytes)
112 QMP_broadcast(dest, nbytes);
124#define QDP_NOT_IMPLEMENTED
132template<
class T,
class T1,
class Op,
class RHS>
134void evaluate(OLattice<T>& dest,
const Op& op,
const QDPExpr<RHS,OScalar<T1> >& rhs,
139#if defined(QDP_USE_PROFILING)
140 static QDPProfile_t prof(dest, op, rhs);
144#if ! defined(QDP_NOT_IMPLEMENTED)
145 const int *tab = s.siteTable().slice();
146 for(
int j=0; j < s.numSiteTable(); ++j)
154 QDP_error(
"evaluateSubset not implemented");
157#if defined(QDP_USE_PROFILING)
170template<
class T,
class T1,
class Op,
class RHS>
172void evaluate(OLattice<T>& dest,
const Op& op,
const QDPExpr<RHS,OLattice<T1> >& rhs,
177#if defined(QDP_USE_PROFILING)
178 static QDPProfile_t prof(dest, op, rhs);
182#if ! defined(QDP_NOT_IMPLEMENTED)
184 const int *tab = s.siteTable().slice();
185 for(
int j=0; j < s.numSiteTable(); ++j)
189 op(dest.elem(i),
forEach(rhs, EvalLeaf1(i), OpCombine()));
192 QDP_error(
"evaluateSubset not implemented");
195#if defined(QDP_USE_PROFILING)
207template<
class T1,
class T2>
214#if ! defined(QDP_NOT_IMPLEMENTED)
222 QDP_error(
"copymask_Subset not implemented");
228template<
class T1,
class T2>
230copymask(OLattice<T2>& dest,
const OLattice<T1>& mask,
const OLattice<T2>& s1)
233 for(
int i=0; i < iend; ++i)
234 copymask(dest.elem(i), mask.elem(i), s1.elem(i));
268random(OLattice<T>& d,
const Subset& s)
273#if ! defined(QDP_NOT_IMPLEMENTED)
274#error "random(unorderedsubset) broken"
275 const int *tab = s.siteTable().slice();
276 for(
int j=0; j < s.numSiteTable(); ++j)
286 QDP_error(
"random_Subset not implemented");
292template<
class T,
class S>
304void random(OLattice<T>& d)
312void gaussian(OLattice<T>& d,
const Subset& s)
319#if ! defined(QDP_NOT_IMPLEMENTED)
320 const int *tab = s.siteTable().slice();
321 for(
int j=0; j < s.numSiteTable(); ++j)
327 QDP_error(
"gaussianSubset not implemented");
334template<
class T,
class S>
357void zero_rep(OLattice<T>& dest,
const Subset& s)
359#if ! defined(QDP_NOT_IMPLEMENTED)
360 const int *tab = s.siteTable().slice();
361 for(
int j=0; j < s.numSiteTable(); ++j)
367 QDP_error(
"zero_rep_Subset not implemented");
374template<
class T,
class S>
389 for(
int i=0; i < iend; ++i)
402template<
class RHS,
class T>
403typename UnaryReturn<OScalar<T>, FnSum>::Type_t
404sum(
const QDPExpr<RHS,OScalar<T> >& s1,
const Subset& s)
406 typename UnaryReturn<OScalar<T>, FnSum>::Type_t d;
408#if defined(QDP_USE_PROFILING)
409 static QDPProfile_t prof(d, OpAssign(), FnSum(), s1);
415#if defined(QDP_USE_PROFILING)
430template<
class RHS,
class T>
431typename UnaryReturn<OScalar<T>, FnSum>::Type_t
432sum(
const QDPExpr<RHS,OScalar<T> >& s1)
434 typename UnaryReturn<OScalar<T>, FnSum>::Type_t d;
436#if defined(QDP_USE_PROFILING)
437 static QDPProfile_t prof(d, OpAssign(), FnSum(), s1);
443#if defined(QDP_USE_PROFILING)
464template<
class RHS,
class T>
465typename UnaryReturn<OLattice<T>, FnSum>::Type_t
466sum(
const QDPExpr<RHS,OLattice<T> >& s1,
const Subset& s)
468 typename UnaryReturn<OLattice<T>, FnSum>::Type_t d;
471#if defined(QDP_USE_PROFILING)
472 static QDPProfile_t prof(d, OpAssign(), FnSum(), s1);
479 if (s.hasOrderedRep())
481 const int istart = s.start() >>
INNER_LOG;
484 for(
int i=istart; i <= iend; ++i)
486 tmp.elem() =
forEach(s1, EvalLeaf1(i), OpCombine());
487 d.elem() +=
sum(tmp.elem());
492 const int *tab = s.siteTable().slice();
493 for(
int j=0; j < s.numSiteTable(); ++j)
499 tmp.elem() =
forEach(s1, EvalLeaf1(outersite), OpCombine());
500 d.elem() +=
getSite(tmp.elem(),innersite);
507#if defined(QDP_USE_PROFILING)
525template<
class RHS,
class T>
526typename UnaryReturn<OLattice<T>, FnSum>::Type_t
527sum(
const QDPExpr<RHS,OLattice<T> >& s1)
543template<
class RHS,
class T>
544typename UnaryReturn<OScalar<T>, FnSum>::Type_t
549#if defined(QDP_USE_PROFILING)
556 dest[i] =
sum(s1,ss[i]);
558#if defined(QDP_USE_PROFILING)
577template<
class RHS,
class T>
579sumMulti(
const QDPExpr<RHS,OLattice<T> >& s1,
const Set& ss)
583#if defined(QDP_USE_PROFILING)
584 static QDPProfile_t prof(dest[0],
OpAssign(), FnSum(), s1);
589 for(
int i=0; i < ss.numSubsets(); ++i)
590 dest[i] =
sum(s1,ss[i]);
592#if defined(QDP_USE_PROFILING)
613multi2d<typename UnaryReturn<OScalar<T>, FnSum>::Type_t>
614sumMulti(
const multi1d< OScalar<T> >& s1,
const Set& ss)
616 multi2d<typename UnaryReturn<OScalar<T>, FnSum>::Type_t> dest(s1.size(), ss.numSubsets());
618#if defined(QDP_USE_PROFILING)
619 static QDPProfile_t prof(dest(0,0), OpAssign(), FnSum(), s1);
624 for(
int i=0; i < dest.size1(); ++i)
625 for(
int j=0; j < dest.size2(); ++j)
628#if defined(QDP_USE_PROFILING)
648multi2d<typename UnaryReturn<OLattice<T>, FnSum>::Type_t>
649sumMulti(
const multi1d< OLattice<T> >& s1,
const Set& ss)
651 multi2d<typename UnaryReturn<OLattice<T>, FnSum>::Type_t> dest(s1.size(),ss.numSubsets());
653#if defined(QDP_USE_PROFILING)
654 static QDPProfile_t prof(dest(0,0), OpAssign(), FnSum(), s1);
659 for(
int k=0; k < s1.size(); ++k)
660 for(
int i=0; i < ss.numSubsets(); ++i)
661 dest(k,i) =
sum(s1[k],ss[i]);
663#if defined(QDP_USE_PROFILING)
682inline typename UnaryReturn<OScalar<T>, FnNorm2>::Type_t
683norm2(
const multi1d< OScalar<T> >& s1)
685 typename UnaryReturn<OScalar<T>, FnNorm2>::Type_t d;
687#if defined(QDP_USE_PROFILING)
688 static QDPProfile_t prof(d, OpAssign(), FnNorm2(), s1[0]);
695 for(
int n=0; n < s1.size(); ++n)
697 OScalar<T>& ss1 = s1[n];
701#if defined(QDP_USE_PROFILING)
713inline typename UnaryReturn<OScalar<T>, FnNorm2>::Type_t
714norm2(
const multi1d< OScalar<T> >& s1,
const Subset& s)
728inline typename UnaryReturn<OLattice<T>, FnNorm2>::Type_t
729norm2(
const multi1d< OLattice<T> >& s1,
const Subset& s)
731 typename UnaryReturn<OLattice<T>, FnNorm2>::Type_t d;
733#if defined(QDP_USE_PROFILING)
734 static QDPProfile_t prof(d, OpAssign(), FnNorm2(), s1[0]);
741#if ! defined(QDP_NOT_IMPLEMENTED)
742 const int *tab = s.siteTable().slice();
743 for(
int n=0; n < s1.size(); ++n)
745 const OLattice<T>& ss1 = s1[n];
746 for(
int j=0; j < s.numSiteTable(); ++j)
759#if defined(QDP_USE_PROFILING)
778inline typename UnaryReturn<OLattice<T>, FnNorm2>::Type_t
779norm2(
const multi1d< OLattice<T> >& s1)
797inline typename UnaryReturn<OScalar<T1>, FnPeekSite>::Type_t
810template<
class RHS,
class T1>
864template<
class RHS,
class T1>
883template<
class T1,
class T2>
956#if defined(QDP_USE_PROFILING)
958struct TagVisitor<FnMap, PrintTag> :
public ParenPrinter<FnMap>
960 static void visit(FnMap op, PrintTag t)
961 { t.os_m <<
"shift"; }
1010 QDP_info(
"Map: off-node communications required");
1014 typedef Site_t * T1ptr;
1017 Site_t **dest =
new T1ptr[nodeSites];
1019 QDP_error_exit(
"Unable to new memory in OLattice<T1>::operator()\n");
1021 QMP_msgmem_t msg[2];
1022 QMP_msghandle_t mh_a[2], mh;
1026 Site_t *ll =
new Site_t[nodeSites];
1028 QDP_error_exit(
"Unable to new memory in OLattice<T1>::operator()\n");
1030 for(
int i=0; i < nodeSites; ++i)
1040 int dstnum = destnodes_num[0]*
sizeof(Site_t);
1041 int srcnum = srcenodes_num[0]*
sizeof(Site_t);
1042 QMP_mem_t* send_buf_mem_t;
1043 QMP_mem_t* recv_buf_mem_t;
1045 send_buf_mem_t = QMP_allocate_aligned_memory(dstnum,
QDP_ALIGNMENT_SIZE,(QMP_MEM_COMMS|QMP_MEM_FAST));
1046 if( send_buf_mem_t == 0x0 ) {
1047 send_buf_mem_t = QMP_allocate_aligned_memory(dstnum,
QDP_ALIGNMENT_SIZE, QMP_MEM_COMMS);
1048 if( send_buf_mem_t == 0x0) {
1049 QDP_error_exit(
"QMP_allocate_aligned_memory failed (send_buf_mem_t)\n");
1053 Site_t* send_buf=(Site_t *)QMP_get_memory_pointer(send_buf_mem_t);
1054 if( send_buf == 0x0 ) {
1055 QDP_error_exit(
"QMP_get_memory_pointer returned NULL pointer from non NULL QMP_mem_t (send_buf)\n");
1058 recv_buf_mem_t = QMP_allocate_aligned_memory(srcnum,
QDP_ALIGNMENT_SIZE,(QMP_MEM_COMMS|QMP_MEM_FAST));
1059 if( recv_buf_mem_t == 0x0 ) {
1060 recv_buf_mem_t = QMP_allocate_aligned_memory(srcnum,
QDP_ALIGNMENT_SIZE, QMP_MEM_COMMS);
1061 if( recv_buf_mem_t == 0x0 ) {
1062 QDP_error_exit(
"QMP_allocate_aligned_memory failed (recv_buf_mem_t)\n");
1065 Site_t* recv_buf=(Site_t *)QMP_get_memory_pointer(recv_buf_mem_t);
1066 if (recv_buf == 0x0) {
1067 QDP_error_exit(
"QMP_get_memory_pointer returned NULL pointer from non NULL QMP_mem_t (recv_buf)\n");
1074 for(
int si=0; si < soffsets.size(); ++si)
1077 QDP_info(
"Map_scatter_send(buf[%d],olattice[%d])",si,soffsets[si]);
1080 send_buf[si] = ll[soffsets[si]];
1085 for(
int i=0, ri=0; i < nodeSites; ++i)
1087 if (srcnode[i] != my_node)
1090 QDP_info(
"Map_gather_recv(olattice[%d],recv[%d])",i,ri);
1093 dest[i] = &(recv_buf[ri++]);
1098 QDP_info(
"Map_gather_onnode(olattice[%d],olattice[%d])",i,goffsets[i]);
1101 dest[i] = &(ll[goffsets[i]]);
1108 QDP_info(
"Map: send = 0x%x recv = 0x%x",send_buf,recv_buf);
1111 msg[0] = QMP_declare_msgmem(recv_buf, srcnum);
1112 if( msg[0] == (QMP_msgmem_t)NULL ) {
1113 QDP_error_exit(
"QMP_declare_msgmem for msg[0] failed in Map::operator()\n");
1115 msg[1] = QMP_declare_msgmem(send_buf, dstnum);
1116 if( msg[1] == (QMP_msgmem_t)NULL ) {
1117 QDP_error_exit(
"QMP_declare_msgmem for msg[1] failed in Map::operator()\n");
1120 mh_a[0] = QMP_declare_receive_from(msg[0], srcenodes[0], 0);
1121 if( mh_a[0] == (QMP_msghandle_t)NULL ) {
1122 QDP_error_exit(
"QMP_declare_receive_from for mh_a[0] failed in Map::operator()\n");
1125 mh_a[1] = QMP_declare_send_to(msg[1], destnodes[0], 0);
1126 if( mh_a[1] == (QMP_msghandle_t)NULL ) {
1127 QDP_error_exit(
"QMP_declare_send_to for mh_a[1] failed in Map::operator()\n");
1130 mh = QMP_declare_multiple(mh_a, 2);
1131 if( mh == (QMP_msghandle_t)NULL ) {
1132 QDP_error_exit(
"QMP_declare_multiple for mh failed in Map::operator()\n");
1137 QDP_info(
"Map: calling start send=%d recv=%d",destnodes[0],srcenodes[0]);
1141 if ((err = QMP_start(mh)) != QMP_SUCCESS)
1149 if ((err = QMP_wait(mh)) != QMP_SUCCESS)
1153 QDP_info(
"Map: calling free msgs");
1158 QMP_free_msghandle(mh);
1159 QMP_free_msgmem(msg[1]);
1160 QMP_free_msgmem(msg[0]);
1165 for(
int i=0; i < nodeSites; ++i)
1168 QDP_info(
"Map_scatter(olattice[%d],olattice[0x%x])",i,dest[i]);
1177 QMP_free_memory(recv_buf_mem_t);
1178 QMP_free_memory(send_buf_mem_t);
1190 QDP_info(
"Map: copy on node - no communications, try this");
1197 for(
int i=0; i < nodeSites; i+=
INNER_LEN)
1201 int i0 = goffsets[i+0] & (
INNER_LEN - 1);
1204 int i1 = goffsets[i+1] & (
INNER_LEN - 1);
1207 int i2 = goffsets[i+2] & (
INNER_LEN - 1);
1210 int i3 = goffsets[i+3] & (
INNER_LEN - 1);
1213 QDP_info(
"Map(lattice[%d]=lattice([%d,%d],[%d,%d],[%d,%d],[%d,%d])",
1214 ii,o0,i0,o1,i1,o2,i2,o3,i3);
1226#error "Map: this inner grid length is not supported - easy to fix"
1246 template<
class RHS,
class T1>
1259 template<
class RHS,
class T1>
1283 void operator=(
const Map&) {}
1291 multi1d<int> goffsets;
1292 multi1d<int> soffsets;
1293 multi1d<int> srcnode;
1294 multi1d<int> dstnode;
1296 multi1d<int> srcenodes;
1297 multi1d<int> destnodes;
1299 multi1d<int> srcenodes_num;
1300 multi1d<int> destnodes_num;
1340 QDP_info(
"ArrayMap(OLattice,%d)",dir);
1343 return mapsa[dir](l);
1351 QDP_info(
"ArrayMap(OScalar,%d)",dir);
1354 return mapsa[dir](l);
1358 template<
class RHS,
class T1>
1365 return mapsa[dir](l);
1368 template<
class RHS,
class T1>
1375 return mapsa[dir](l);
1384 void operator=(
const ArrayMap&) {}
1393class BiDirectionalMap
1424 QDP_info(
"BiDirectionalMap(OLattice,%d)",isign);
1427 return bimaps[(isign+1)>>1](l);
1436 QDP_info(
"BiDirectionalMap(OScalar,%d)",isign);
1439 return bimaps[(isign+1)>>1](l);
1443 template<
class RHS,
class T1>
1450 return bimaps[(isign+1)>>1](l);
1453 template<
class RHS,
class T1>
1460 return bimaps[(isign+1)>>1](l);
1469 void operator=(
const BiDirectionalMap&) {}
1472 multi1d<Map> bimaps;
1479class ArrayBiDirectionalMap
1518 QDP_info(
"ArrayBiDirectionalMap(OLattice,%d,%d)",isign,dir);
1521 return bimapsa((isign+1)>>1,dir)(l);
1529 QDP_info(
"ArrayBiDirectionalMap(OScalar,%d,%d)",isign,dir);
1532 return bimapsa((isign+1)>>1,dir)(l);
1536 template<
class RHS,
class T1>
1543 return bimapsa((isign+1)>>1,dir)(l);
1546 template<
class RHS,
class T1>
1553 return bimapsa((isign+1)>>1,dir)(l);
1562 void operator=(
const ArrayBiDirectionalMap&) {}
1565 multi2d<Map> bimapsa;
1577void write(BinaryWriter& bin,
const OScalar<T>& d)
1579 bin.writeArray((
const char *)&(d.elem()),
1587void read(BinaryReader& bin, OScalar<T>& d)
1589 bin.readArray((
char*)&(d.elem()),
1605multi1d<int>
crtesn(
int ipos,
const multi1d<int>& latt_size);
1610XMLWriter&
operator<<(XMLWriter& xml,
const OLattice<T>& d)
1615 xml.openTag(
"OLattice");
1616 XMLWriterAPI::AttributeList alist;
1626 int innersite = linear & ((1 <<
INNER_LOG)-1);
1630 recv_buf =
getSite(d.elem(outersite),innersite);
1649 std::ostringstream os;
1651 for(
int i=1; i < coord.size(); ++i)
1652 os <<
" " << coord[i];
1655 alist.push_back(XMLWriterAPI::Attribute(
"site", site));
1656 alist.push_back(XMLWriterAPI::Attribute(
"coord", os.str()));
1658 xml.openTag(
"elem", alist);
1672void write(BinaryWriter& bin,
const OLattice<T>& d)
1685 int innersite = linear & ((1 <<
INNER_LOG)-1);
1689 recv_buf =
getSite(d.elem(outersite),innersite);
1707 bin.writeArray((
char *)&recv_buf,
1716void write(BinaryWriter& bin,
const OLattice<T>& d,
const multi1d<int>& coord)
1725 int innersite = linear & ((1 <<
INNER_LOG)-1);
1729 recv_buf =
getSite(d.elem(outersite),innersite);
1747 bin.writeArray((
char *)&recv_buf,
1756void read(BinaryReader& bin, OLattice<T>& d)
1769 int innersite = linear & ((1 <<
INNER_LOG)-1);
1772 bin.readArrayPrimaryNode((
char *)&recv_buf,
1792 copy_site(d.elem(outersite), innersite, recv_buf);
1799void read(BinaryReader& bin, OLattice<T>& d,
const multi1d<int>& coord)
1808 int innersite = linear & ((1 <<
INNER_LOG)-1);
1811 bin.readArrayPrimaryNode((
char *)&recv_buf,
1831 copy_site(d.elem(outersite), innersite, recv_buf);
ForEach< Expr, FTag, CTag >::Type_t forEach(const Expr &e, const FTag &f, const CTag &c)
#define PETE_EMPTY_CONSTRUCTORS(CLASS)
ArrayBiDirectional of general permutation map class for communications.
~ArrayBiDirectionalMap()
Destructor.
OLattice< T1 > operator()(const OLattice< T1 > &l, int isign, int dir)
Function call operator for a shift.
void make(const ArrayMapFunc &func)
Actual constructor from a function object.
ArrayBiDirectionalMap(const ArrayMapFunc &fn)
Constructor from a function object.
ArrayBiDirectionalMap()
Constructor - does nothing really.
OScalar< T1 > operator()(const QDPExpr< RHS, OScalar< T1 > > &l, int isign, int dir)
OScalar< T1 > operator()(const OScalar< T1 > &l, int isign, int dir)
OLattice< T1 > operator()(const QDPExpr< RHS, OLattice< T1 > > &l, int isign, int dir)
Array of general permutation map class for communications.
OLattice< T1 > operator()(const OLattice< T1 > &l, int dir)
Function call operator for a shift.
ArrayMap()
Constructor - does nothing really.
OScalar< T1 > operator()(const OScalar< T1 > &l, int dir)
OLattice< T1 > operator()(const QDPExpr< RHS, OLattice< T1 > > &l, int dir)
ArrayMap(const ArrayMapFunc &fn)
Constructor from a function object.
OScalar< T1 > operator()(const QDPExpr< RHS, OScalar< T1 > > &l, int dir)
void make(const ArrayMapFunc &func)
Actual constructor from a function object.
BiDirectional of general permutation map class for communications.
OScalar< T1 > operator()(const QDPExpr< RHS, OScalar< T1 > > &l, int isign)
void make(const MapFunc &func)
Actual constructor from a function object.
OLattice< T1 > operator()(const QDPExpr< RHS, OLattice< T1 > > &l, int isign)
~BiDirectionalMap()
Destructor.
BiDirectionalMap(const MapFunc &fn)
Constructor from a function object.
OScalar< T1 > operator()(const OScalar< T1 > &l, int isign)
OLattice< T1 > operator()(const OLattice< T1 > &l, int isign)
Function call operator for a shift.
BiDirectionalMap()
Constructor - does nothing really.
General permutation map class for communications.
OLattice< T1 > operator()(const QDPExpr< RHS, OLattice< T1 > > &l)
Map(const MapFunc &fn)
Constructor from a function object.
OScalar< T1 > operator()(const QDPExpr< RHS, OScalar< T1 > > &l)
OScalar< T1 > operator()(const OScalar< T1 > &l)
const multi1d< int > & goffset() const
Accessor to offsets.
const multi1d< int > & soffset() const
Map()
Constructor - does nothing really.
OLattice< T1 > operator()(const OLattice< T1 > &l)
Function call operator for a shift.
void make(const MapFunc &func)
Actual constructor from a function object.
Outer grid Scalar class */.
OLattice class narrowed to a subset.
const Subset & subset() const
Expression class for QDP.
OScalar< T1 > peekSite(const QDPExpr< RHS, OScalar< T1 > > &l, const multi1d< int > &coord)
Extract site element.
UnaryReturn< OScalar< T1 >, FnPeekSite >::Type_t peekSite(const OScalar< T1 > &l, const multi1d< int > &coord)
Extract site element.
UnaryReturn< OLattice< T1 >, FnPeekSite >::Type_t peekSite(const OLattice< T1 > &l, const multi1d< int > &coord)
Extract site element.
OScalar< T1 > peekSite(const QDPExpr< RHS, OLattice< T1 > > &l, const multi1d< int > &coord)
Extract site element.
Set - collection of subsets controlling which sites are involved in an operation.
int numSubsets() const
Return number of subsets.
Subsets - controls how lattices are looped.
const multi1d< int > & siteTable() const
Container for a multi-dimensional 1D array.
const T * slice() const
Return ref to a column slice.
OLattice< PScalar< PSeed< RScalar< INTEGER32 > > > > LatticeSeed
OScalar< PScalar< PSeed< RScalar< INTEGER32 > > > > Seed
OLattice< PScalar< PScalar< RScalar< INTEGER32 > > > > LatticeInteger
OLattice< T1 > & pokeSite(OLattice< T1 > &l, const OScalar< T2 > &r, const multi1d< int > &coord)
Insert site element.
OScalar< T1 > peekSite(const OScalar< T1 > &l, const multi1d< int > &coord)
Extract site element.
void QDP_extract(multi1d< OScalar< typename UnaryReturn< T, FnGetSite >::Type_t > > &dest, const OLattice< T > &src, const Subset &s)
Copy data values from field src to array dest.
void QDP_insert(OLattice< T > &dest, const multi1d< OScalar< typename UnaryReturn< T, FnGetSite >::Type_t > > &src, const Subset &s)
Inserts data values from site array src.
UnaryReturn< C, FnNorm2 >::Type_t norm2(const QDPType< T, C > &s1)
OScalar = norm2(trace(adj(source)*source)).
UnaryReturn< C, FnSumMulti >::Type_t sumMulti(const QDPType< T, C > &s1, const Set &ss)
dest = sumMulti(source1,Set)
UnaryReturn< C, FnSum >::Type_t sum(const QDPType< T, C > &s1)
OScalar = sum(source).
void gather_sites(ILattice< T, 2 > &d, const ILattice< T1, 2 > &s0, int i0, const ILattice< T1, 2 > &s1, int i1)
gather several inner sites together
TextWriter & operator<<(TextWriter &txt, const std::string &output)
void write(BinaryWriter &bin, const std::string &output)
void read(BinaryReader &bin, std::string &input, size_t maxBytes)
void fill_gaussian(IScalar< T > &d, IScalar< T > &r1, IScalar< T > &r2)
dest = gaussian
void copy_site(IScalar< T > &d, int isite, const IScalar< T1 > &s1)
dest [some type] = source [some type]
void zero_rep(IScalar< T > &dest)
dest = 0
void copymask(IScalar< T > &d, const IScalar< T1 > &mask, const IScalar< T > &s1)
dest = (mask) ? s1 : dest
UnaryReturn< IScalar< T >, FnGetSite >::Type_t getSite(const IScalar< T > &s1, int innersite)
void evaluate(OLattice< DCol > &d, const OpAssign &op, const QDPExpr< BinaryNode< OpMultiply, Reference< QDPType< DCol, OLattice< DCol > > >, Reference< QDPType< DCol, OLattice< DCol > > > >, OLattice< DCol > > &rhs, const Subset &s)
void gaussian(OSubScalar< T > &d)
dest = gaussian
void random(OScalar< T > &d)
dest = random
Subset all
Default all subset.
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.
int outerSitesOnNode()
Subgrid lattice volume.
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
LatticeInteger latticeCoordinate(int mu)
coord[mu] <- mu : fill with lattice coord in mu direction
int vol()
Total lattice volume.
bool primaryNode()
Returns whether this is the primary node.
void broadcast(T &dest)
Broadcast from primary node to all other nodes.
void sendToWait(void *send_buf, int dest_node, int count)
Send to another node (wait).
void globalSum(T &dest)
Sum across all nodes.
void route(void *buffer, int srce_node, int dest_node, int count)
Route to another node (blocking).
void sendToPrimaryNode(T &dest, int srcnode)
Via some mechanism, get the dest to node 0.
void wait(int dir)
Wait on send-receive.
void recvFromWait(void *recv_buf, int srce_node, int count)
Receive from another node (wait).
void broadcast_str(std::string &result)
Broadcast a string from primary node to all other nodes.
void sumAnUnsigned(void *inout, void *in)
Unsigned accumulate.
void globalSumArray(unsigned int *dest, int len)
Wrapper to get a functional unsigned global sum.
Seed ran_mult_n
RNG multiplier raised to the volume+1.
Seed ran_mult
RNG multiplier.
LatticeSeed * lattice_ran_mult
The lattice of skewed RNG multipliers.
Seed ran_seed
Global (current) seed.
Yet another random number generator.
ForEach< Expr, FTag, CTag >::Type_t forEach(const Expr &e, const FTag &f, const CTag &c)
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
QDPTime_t getClockTime()
Get the wallclock time.
int QDP_error(const char *format,...)
Simple error display routine.
multi1d< int > crtesn(int ipos, const multi1d< int > &latt_size)
Decompose a lexicographic site into coordinates.
void fill_random(float &d, T1 &seed, T2 &skewed_seed, const T1 &seed_mult)
dest = random
MakeReturn< UnaryNode< FnLocalNorm2, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnLocalNorm2 >::Type_t >::Expression_t localNorm2(const QDPExpr< T1, C1 > &l)
int QDP_info(const char *format,...)
Simple information display routine.
#define QDP_ALIGNMENT_SIZE