7#ifndef QDP_PARSCALAR_SPECIFIC_H
8#define QDP_PARSCALAR_SPECIFIC_H
31 void route(
void *send_buf,
int srce_node,
int dest_node,
int count);
38 void sendToWait(
void *send_buf,
int dest_node,
int count);
41 void recvFromWait(
void *recv_buf,
int srce_node,
int count);
61 *(
unsigned int*)inout += *(
unsigned int*)in;
67 for(
int i=0; i < len; i++, dest++)
68 QMP_binary_reduction(dest,
sizeof(
unsigned int),
sumAnUnsigned);
74 for(
int i=0; i < len; i++, dest++)
81 QMP_sum_float_array(dest, len);
87 QMP_sum_double_array(dest, len);
100 QDPIO::cout <<
"sizeof(W) = " <<
sizeof(W) << endl;
101 QDPIO::cout <<
"Calling multi1d global sum array with length " << dest.
size()*
sizeof(T)/
sizeof(W) << endl;
115 QDPIO::cout <<
"sizeof(T) = " <<
sizeof(T) << endl;
116 QDPIO::cout <<
"sizeof(W) = " <<
sizeof(W) << endl;
117 QDPIO::cout <<
"Calling multi2d global sum array with length " << dest.
size1()*dest.
size2()*
sizeof(T)/
sizeof(W) << endl;
132 QDPIO::cout <<
"sizeof(T) = " <<
sizeof(T) << endl;
133 QDPIO::cout <<
"sizeof(W) = " <<
sizeof(W) << endl;
134 QDPIO::cout <<
"Calling global sum array with length " <<
sizeof(T)/
sizeof(W) << endl;
145 QMP_sum_double(&dest);
158 QMP_max_double(dest);
181 QMP_min_double(dest);
198 *(
unsigned int*)inout = *(
unsigned int*)inout & *(
unsigned int*)in;
212 *(
unsigned int*)inout = *(
unsigned int*)inout | *(
unsigned int*)in;
225 QMP_broadcast((
void *)&dest,
sizeof(T));
234 QMP_broadcast(dest, nbytes);
255template<
class T,
class T1,
class Op,
class RHS>
262 ) :
d(d_),
r(r_),
op(op_),
tab(tab_) {}
273template<
class T,
class T1,
class Op,
class RHS>
278 const int* tab = a->
tab;
282 for(
int j=lo; j < hi; ++j)
292template<
class T,
class T1,
class Op,
class RHS>
298 const int *tab_ ) :
d(d_),
r(r_),
op(op_),
tab(tab_) {}
309template<
class T,
class T1,
class Op,
class RHS>
315 const int* tab = a->
tab;
319 for(
int j=lo; j < hi; ++j)
337template<
class T,
class T1,
class Op,
class RHS>
344#if defined(QDP_USE_PROFILING)
345 static QDPProfile_t prof(dest, op, rhs);
361#pragma omp parallel for
362 for(
int j=0; j < numSiteTable; ++j)
369#if defined(QDP_USE_PROFILING)
382template<
class T,
class T1,
class Op,
class RHS>
389#if defined(QDP_USE_PROFILING)
390 static QDPProfile_t prof(dest, op, rhs);
403#pragma omp parallel for
404 for(
int j=0; j < numSiteTable; ++j)
410#if defined(QDP_USE_PROFILING)
420template<
class T,
class T1,
class Op,
class RHS>
427#if defined(QDP_USE_PROFILING)
428 static QDPProfile_t prof(dest, op, rhs);
451#if defined(QDP_USE_PROFILING)
461template<
class T1,
class T2>
469#pragma omp parallel for
470 for(
int j=0; j < nodeSites; ++j)
478template<
class T1,
class T2>
483#pragma omp parallel for
484 for(
int i=0; i < nodeSites; ++i)
529 for(
int j=0; j < nodeSites; ++j)
539 if( myId < nodeSites ) {
540#pragma omp critical (random)
581#pragma omp parallel for
582 for(
int j=0; j < nodeSites; ++j)
621#pragma omp parallel for
622 for(
int j=0; j < nodeSites; ++j)
636 OLattice<T>& d = dd.field();
637 const Subset& s = dd.subset();
651#pragma omp parallel for
652 for(
int i=0; i < nodeSites; ++i)
665template<
class RHS,
class T>
671#if defined(QDP_USE_PROFILING)
678#if defined(QDP_USE_PROFILING)
693template<
class RHS,
class T>
699#if defined(QDP_USE_PROFILING)
706#if defined(QDP_USE_PROFILING)
722template<
class RHS,
class T>
728#if defined(QDP_USE_PROFILING)
745 for(
int j=0; j < nodeSites; ++j)
752 if( myId < nodeSites ) {
755 d.elem() += dthread.elem();
763#if defined(QDP_USE_PROFILING)
778template<
class RHS,
class T>
784#if defined(QDP_USE_PROFILING)
798#pragma omp for nowait
799 for(
int i=0; i < nodeSites; ++i)
804 if( myId < nodeSites ) {
807 d.elem() += dthread.elem();
815#if defined(QDP_USE_PROFILING)
835template<
class RHS,
class T>
841#if defined(QDP_USE_PROFILING)
851#if defined(QDP_USE_PROFILING)
870template<
class RHS,
class T>
876#if defined(QDP_USE_PROFILING)
889 for(
int i=0; i < nodeSites; ++i)
891 int j = lat_color[i];
898#if defined(QDP_USE_PROFILING)
919multi2d<typename UnaryReturn<OScalar<T>, FnSum>
::Type_t>
924#if defined(QDP_USE_PROFILING)
925 static QDPProfile_t prof(dest(0,0),
OpAssign(),
FnSum(), s1);
930 for(
int i=0; i < dest.
size1(); ++i)
931 for(
int j=0; j < dest.
size2(); ++j)
934#if defined(QDP_USE_PROFILING)
954multi2d<typename UnaryReturn<OLattice<T>, FnSum>
::Type_t>
959#if defined(QDP_USE_PROFILING)
965 for(
int i=0; i < dest.
size1(); ++i)
966 for(
int j=0; j < dest.
size2(); ++j)
972 for(
int k=0; k < s1.size(); ++k)
976 for(
int i=0; i < nodeSites; ++i)
978 int j = lat_color[i];
979 dest(k,j).elem() += ss1.
elem(i);
986#if defined(QDP_USE_PROFILING)
1010#if defined(QDP_USE_PROFILING)
1018 for(
int n=0; n < s1.size(); ++n)
1024#if defined(QDP_USE_PROFILING)
1056#if defined(QDP_USE_PROFILING)
1067 for(
int n=0; n < s1.size(); ++n)
1071 #pragma omp parallel
1077 for(
int j=0; j < nodeSites; ++j)
1084 if ( myId < nodeSites ) {
1085 #pragma omp critical
1087 d.elem() += dthread.elem();
1096#if defined(QDP_USE_PROFILING)
1130template<
class T1,
class T2>
1136#if defined(QDP_USE_PROFILING)
1144 for(
int n=0; n < s1.size(); ++n)
1151#if defined(QDP_USE_PROFILING)
1162template<
class T1,
class T2>
1179template<
class T1,
class T2>
1186#if defined(QDP_USE_PROFILING)
1196 for(
int n=0; n < s1.size(); ++n)
1201 #pragma omp parallel
1207 for(
int j=0; j < nodeSites; ++j)
1214 if( myId < nodeSites ) {
1215 #pragma omp critical
1217 d.elem() += dthread.elem();
1226#if defined(QDP_USE_PROFILING)
1243template<
class T1,
class T2>
1260template<
class T1,
class T2>
1266#if defined(QDP_USE_PROFILING)
1274 for(
int n=0; n < s1.size(); ++n)
1281#if defined(QDP_USE_PROFILING)
1292template<
class T1,
class T2>
1309template<
class T1,
class T2>
1316#if defined(QDP_USE_PROFILING)
1327 for(
int n=0; n < s1.size(); ++n)
1332 #pragma omp parallel
1338 for(
int j=0; j < nodeSites; ++j)
1345 if( myId < nodeSites ) {
1346 #pragma omp critical
1348 d.elem() += dthread.elem();
1357#if defined(QDP_USE_PROFILING)
1374template<
class T1,
class T2>
1392template<
class RHS,
class T>
1398#if defined(QDP_USE_PROFILING)
1405#if defined(QDP_USE_PROFILING)
1419template<
class RHS,
class T>
1425#if defined(QDP_USE_PROFILING)
1434 for(
int i=1; i < vvol; ++i)
1439 if (
toBool(dd > d.elem()))
1446#if defined(QDP_USE_PROFILING)
1460template<
class RHS,
class T>
1466#if defined(QDP_USE_PROFILING)
1473#if defined(QDP_USE_PROFILING)
1487template<
class RHS,
class T>
1493#if defined(QDP_USE_PROFILING)
1502 for(
int i=1; i < vvol; ++i)
1507 if (
toBool(dd < d.elem()))
1514#if defined(QDP_USE_PROFILING)
1535 return isnan(s1.elem());
1549#if defined(QDP_USE_PROFILING)
1555 for(
int i=0; i < nodeSites; ++i)
1562#if defined(QDP_USE_PROFILING)
1580 return isinf(s1.elem());
1594#if defined(QDP_USE_PROFILING)
1600 for(
int i=0; i < nodeSites; ++i)
1607#if defined(QDP_USE_PROFILING)
1639#if defined(QDP_USE_PROFILING)
1645 for(
int i=0; i < nodeSites; ++i)
1652#if defined(QDP_USE_PROFILING)
1684#if defined(QDP_USE_PROFILING)
1690 for(
int i=0; i < nodeSites; ++i)
1697#if defined(QDP_USE_PROFILING)
1732template<
class RHS,
class T1>
1782template<
class RHS,
class T1>
1826#pragma omp parallel for
1827 for(
int j=0; j < nodeSites; ++j)
1830 dest[i].elem() = src.
elem(i);
1848#pragma omp parallel for
1849 for(
int j=0; j < nodeSites; ++j)
1852 dest.
elem(i) = src[i].elem();
1868#if defined(QDP_USE_PROFILING)
1872 static void visit(
FnMap op, PrintTag t)
1873 { t.os_m <<
"shift"; }
1920 QDP_info(
"Map: off-node communications required");
1925 T1 **dest =
new(std::nothrow) T1ptr[nodeSites];
1927 QDP_error_exit(
"Unable to new T1ptr in OLattice<T1>::operator()\n");
1929 QMP_msgmem_t msg[2];
1930 QMP_msghandle_t mh_a[2], mh;
1936 if (srcenodes.size() != 1)
1939 if (destnodes.size() != 1)
1943 int dstnum = destnodes_num[0]*
sizeof(T1);
1944 int srcnum = srcenodes_num[0]*
sizeof(T1);
1948 (QMP_MEM_COMMS|QMP_MEM_FAST) );
1949 if( send_buf_mem == 0x0 ) {
1952 if( send_buf_mem == 0x0 ) {
1958 (QMP_MEM_COMMS|QMP_MEM_FAST));
1959 if( recv_buf_mem == 0x0 ) {
1960 recv_buf_mem = QMP_allocate_aligned_memory(srcnum,
QDP_ALIGNMENT_SIZE, QMP_MEM_COMMS);
1961 if( recv_buf_mem == 0x0 ) {
1966 T1 *send_buf = (T1 *)QMP_get_memory_pointer(send_buf_mem);
1967 T1 *recv_buf = (T1 *)QMP_get_memory_pointer(recv_buf_mem);
1970 if ( send_buf == 0x0 ) {
1971 QDP_error_exit(
"QMP_get_memory_pointer returned NULL pointer from non NULL QMP_mem_t (send_buf)\n");
1974 if ( recv_buf == 0x0 ) {
1975 QDP_error_exit(
"QMP_get_memory_pointer returned NULL pointer from non NULL QMP_mem_t (recv_buf)\n");
1982 for(
int si=0; si < soffsets.size(); ++si)
1985 QDP_info(
"Map_scatter_send(buf[%d],olattice[%d])",si,soffsets[si]);
1988 send_buf[si] = l.
elem(soffsets[si]);
1995 for(
int i=0, ri=0; i < nodeSites; ++i)
1997 if (srcnode[i] != my_node)
2000 QDP_info(
"Map_gather_recv(olattice[%d],recv[%d])",i,ri);
2003 dest[i] = &(recv_buf[ri++]);
2008 QDP_info(
"Map_gather_onnode(olattice[%d],olattice[%d])",i,goffsets[i]);
2011 dest[i] = &(
const_cast<T1&
>(l.
elem(goffsets[i])));
2018 QDP_info(
"Map: send = 0x%x recv = 0x%x",send_buf,recv_buf);
2019 QDP_info(
"Map: establish send=%d recv=%d",destnodes[0],srcenodes[0]);
2025 QDP_info(
"Map: establish-info my_crds=[%d,%d,%d,%d]",me[0],me[1],me[2],me[3]);
2026 QDP_info(
"Map: establish-info send_crds=[%d,%d,%d,%d]",scrd[0],scrd[1],scrd[2],scrd[3]);
2027 QDP_info(
"Map: establish-info recv_crds=[%d,%d,%d,%d]",rcrd[0],rcrd[1],rcrd[2],rcrd[3]);
2031 msg[0] = QMP_declare_msgmem(recv_buf, srcnum);
2032 if( msg[0] == (QMP_msgmem_t)NULL ) {
2033 QDP_error_exit(
"QMP_declare_msgmem for msg[0] failed in Map::operator()\n");
2035 msg[1] = QMP_declare_msgmem(send_buf, dstnum);
2036 if( msg[1] == (QMP_msgmem_t)NULL ) {
2037 QDP_error_exit(
"QMP_declare_msgmem for msg[1] failed in Map::operator()\n");
2040 mh_a[0] = QMP_declare_receive_from(msg[0], srcenodes[0], 0);
2041 if( mh_a[0] == (QMP_msghandle_t)NULL ) {
2042 QDP_error_exit(
"QMP_declare_receive_from for mh_a[0] failed in Map::operator()\n");
2045 mh_a[1] = QMP_declare_send_to(msg[1], destnodes[0], 0);
2046 if( mh_a[1] == (QMP_msghandle_t)NULL ) {
2047 QDP_error_exit(
"QMP_declare_send_to for mh_a[1] failed in Map::operator()\n");
2050 mh = QMP_declare_multiple(mh_a, 2);
2051 if( mh == (QMP_msghandle_t)NULL ) {
2052 QDP_error_exit(
"QMP_declare_multiple for mh failed in Map::operator()\n");
2056 QDP_info(
"Map: calling start send=%d recv=%d",destnodes[0],srcenodes[0]);
2060 if ((err = QMP_start(mh)) != QMP_SUCCESS)
2068 if ((err = QMP_wait(mh)) != QMP_SUCCESS)
2072 QDP_info(
"Map: calling free msgs");
2077 QMP_free_msghandle(mh);
2078 QMP_free_msgmem(msg[1]);
2079 QMP_free_msgmem(msg[0]);
2084#pragma omp parallel for
2085 for(
int i=0; i < nodeSites; ++i)
2088 QDP_info(
"Map_scatter(olattice[%d],olattice[0x%x])",i,dest[i]);
2090 d.
elem(i) = *(dest[i]);
2094 QMP_free_memory(recv_buf_mem);
2095 QMP_free_memory(send_buf_mem);
2106 QDP_info(
"Map: copy on node - no communications, try this");
2110#pragma omp parallel for
2111 for(
int i=0; i < nodeSites; ++i)
2114 QDP_info(
"Map(olattice[%d],olattice[%d])",i,goffsets[i]);
2135 template<
class RHS,
class T1>
2148 template<
class RHS,
class T1>
2172 void operator=(
const Map&) {}
2180 multi1d<int> goffsets;
2181 multi1d<int> soffsets;
2182 multi1d<int> srcnode;
2183 multi1d<int> dstnode;
2185 multi1d<int> srcenodes;
2186 multi1d<int> destnodes;
2188 multi1d<int> srcenodes_num;
2189 multi1d<int> destnodes_num;
2229 QDP_info(
"ArrayMap(OLattice,%d)",dir);
2232 return mapsa[dir](l);
2240 QDP_info(
"ArrayMap(OScalar,%d)",dir);
2243 return mapsa[dir](l);
2247 template<
class RHS,
class T1>
2254 return mapsa[dir](l);
2257 template<
class RHS,
class T1>
2264 return mapsa[dir](l);
2313 QDP_info(
"BiDirectionalMap(OLattice,%d)",isign);
2316 return bimaps[(isign+1)>>1](l);
2325 QDP_info(
"BiDirectionalMap(OScalar,%d)",isign);
2328 return bimaps[(isign+1)>>1](l);
2332 template<
class RHS,
class T1>
2339 return bimaps[(isign+1)>>1](l);
2342 template<
class RHS,
class T1>
2349 return bimaps[(isign+1)>>1](l);
2361 multi1d<Map> bimaps;
2407 QDP_info(
"ArrayBiDirectionalMap(OLattice,%d,%d)",isign,dir);
2410 return bimapsa((isign+1)>>1,dir)(l);
2418 QDP_info(
"ArrayBiDirectionalMap(OScalar,%d,%d)",isign,dir);
2421 return bimapsa((isign+1)>>1,dir)(l);
2425 template<
class RHS,
class T1>
2432 return bimapsa((isign+1)>>1,dir)(l);
2435 template<
class RHS,
class T1>
2442 return bimapsa((isign+1)>>1,dir)(l);
2454 multi2d<Map> bimapsa;
2494multi1d<int>
crtesn(
int ipos,
const multi1d<int>& latt_size);
2503 XMLWriterAPI::AttributeList alist;
2515 recv_buf = d.
elem(linear);
2534 std::ostringstream os;
2536 for(
int i=1; i < coord.size(); ++i)
2537 os <<
" " << coord[i];
2540 alist.push_back(XMLWriterAPI::Attribute(
"site", site));
2541 alist.push_back(XMLWriterAPI::Attribute(
"coord", os.str()));
2557 const char* output,
size_t size,
size_t nmemb);
2572 const char* output,
size_t size,
size_t nmemb,
2573 const multi1d<int>& coord);
2589 const char* output,
size_t size,
size_t nmemb,
2609 char* input,
size_t size,
size_t nmemb);
2624 char* input,
size_t size,
size_t nmemb,
2625 const multi1d<int>& coord);
2641 char* input,
size_t size,
size_t nmemb,
2659namespace LatticeTimeSliceIO
2663 size_t size,
size_t nmemb,
2664 int start_lexico,
int stop_lexico);
2667 size_t size,
size_t nmemb,
2668 int start_lexico,
int stop_lexico);
2674 int start_lexico,
int stop_lexico)
2679 start_lexico, stop_lexico);
2686 int start_lexico,
int stop_lexico)
2691 start_lexico, stop_lexico);
#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.
virtual void readArray(char *output, size_t nbytes, size_t nmemb)
Read data on the primary node and broadcast to all nodes.
Binary writer base class.
virtual void writeArray(const char *output, size_t nbytes, size_t nmemb)
Write data from the primary node.
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.
QDPType - major type class/container for all QDP objects.
Set - collection of subsets controlling which sites are involved in an operation.
int numSubsets() const
Return number of subsets.
const multi1d< int > & latticeColoring() const
The coloring of the lattice sites.
Subsets - controls how lattices are looped.
const multi1d< int > & siteTable() const
void openTag(const std::string &tagname)
Writes an opening XML tag.
void closeTag()
Closes a tag.
Container for a multi-dimensional 1D array.
int size() const
Size of array.
const T * slice() const
Return ref to a column slice.
Container for a multi-dimensional 2D array.
const T * slice(int j) const
Return ref to a row slice.
int size1() const
Size of array.
OLattice< PScalar< PSeed< RScalar< INTEGER32 > > > > LatticeSeed
OScalar< PScalar< PSeed< RScalar< INTEGER32 > > > > Seed
OLattice< PScalar< PScalar< RScalar< INTEGER32 > > > > LatticeInteger
void QDP_extract(multi1d< OScalar< T > > &dest, const OLattice< T > &src, const Subset &s)
Copy data values from field src to array dest.
OLattice< T1 > & pokeSite(OLattice< T1 > &l, const OScalar< T1 > &r, const multi1d< int > &coord)
Insert site element.
OScalar< T1 > peekSite(const QDPExpr< RHS, OScalar< T1 > > &l, const multi1d< int > &coord)
Extract site element.
void QDP_insert(OLattice< T > &dest, const multi1d< OScalar< T > > &src, const Subset &s)
Inserts data values from site array src.
OScalar< T1 > peekSite(const OScalar< T1 > &l, const multi1d< int > &coord)
Extract site element.
OScalar< T1 > 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.
BinaryReturn< C1, C2, FnInnerProductReal >::Type_t innerProductReal(const QDPType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
OScalar = innerProductReal(adj(source1)*source2).
UnaryReturn< C, FnGlobalMin >::Type_t globalMin(const QDPType< T, C > &s1)
OScalar = globalMin(source).
UnaryReturn< C, FnNorm2 >::Type_t norm2(const QDPType< T, C > &s1)
OScalar = norm2(trace(adj(source)*source)).
bool isnan(const QDPExpr< T, C > &s1)
bool = isnan(source)
bool isfinite(const QDPExpr< T, C > &s1)
bool = isfinite(source)
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
OScalar = innerProduct(adj(source1)*source2).
bool isnormal(const QDPExpr< T, C > &s1)
bool = isnormal(source)
bool isinf(const QDPExpr< T, C > &s1)
bool = isinf(source)
UnaryReturn< C, FnGlobalMax >::Type_t globalMax(const QDPType< T, C > &s1)
OScalar = globalMax(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).
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 zero_rep(IScalar< T > &dest)
dest = 0
void copymask(IScalar< T > &d, const IScalar< T1 > &mask, const IScalar< T > &s1)
dest = (mask) ? s1 : dest
bool toBool(const IScalar< T > &s)
QDP Boolean to bool primitive in conversion routine.
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.
void readSlice(BinaryReader &bin, OLattice< T > &data, int start_lexico, int stop_lexico)
void writeOLatticeSlice(BinaryWriter &bin, const char *output, size_t size, size_t nmemb, int start_lexico, int stop_lexico)
void readOLatticeSlice(BinaryReader &bin, char *input, size_t size, size_t nmemb, int start_lexico, int stop_lexico)
Lattice time slice reader.
void writeSlice(BinaryWriter &bin, const OLattice< T > &data, int start_lexico, int stop_lexico)
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.
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
multi1d< int > getLogicalCoordFrom(int node)
Returns the logical node coordinates given some node number.
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.
const multi1d< int > & nodeCoord()
Returns the logical node coordinates for this node.
StandardOutputStream cout
void globalOr(bool &dest)
Wrapper to get a functional global Or.
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 globalMax(T &dest)
Global max across all nodes.
void globalCheckAnd(void *inout, void *in)
Global And.
void globalSum(T &dest)
Sum across all nodes.
void globalCheckOr(void *inout, void *in)
Global Or.
void route(void *buffer, int srce_node, int dest_node, int count)
Route to another node (blocking).
void globalMinValue(float *dest)
Low level hook to QMP_min_float.
void sendToPrimaryNode(T &dest, int srcnode)
Via some mechanism, get the dest to node 0.
void wait(int dir)
Wait on send-receive.
void globalAnd(bool &dest)
Wrapper to get a functional global And.
void recvFromWait(void *recv_buf, int srce_node, int count)
Receive from another node (wait).
void globalMin(T &dest)
Global min across all nodes.
void broadcast_str(std::string &result)
Broadcast a string from primary node to all other nodes.
void globalMaxValue(float *dest)
Low level hook to QMP_max_double.
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.
void dispatch_to_threads(int numSiteTable, Arg a, void(*func)(int, int, int, Arg *))
ForEach< Expr, FTag, CTag >::Type_t forEach(const Expr &e, const FTag &f, const CTag &c)
void evaluate_userfunc(int lo, int hi, int myId, user_arg< T, T1, Op, RHS > *a)
user function for the evaluate function:
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
MakeReturn< BinaryNode< FnLocalInnerProductReal, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnLocalInnerProductReal >::Type_t >::Expression_t localInnerProductReal(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
QDPTime_t getClockTime()
Get the wallclock time.
void evaluate_F(T *dest, const Op &op, const QDPExpr< RHS, OScalar< T1 > > &rhs, const Subset &s)
void readOLattice(BinaryReader &bin, char *input, size_t size, size_t nmemb)
Read a lattice quantity.
MakeReturn< BinaryNode< FnLocalInnerProduct, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Expression_t localInnerProduct(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
void writeOLattice(BinaryWriter &bin, const char *output, size_t size, size_t nmemb)
Write a lattice quantity.
void ev_userfunc(int lo, int hi, int myId, u_arg< T, T1, Op, RHS > *a)
user function for the evaluate function:
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
FnMap(const int *goffsets)
user argument for the evaluate function:
u_arg(OLattice< T > &d_, const QDPExpr< RHS, OScalar< T1 > > &r_, const Op &op_, const int *tab_)
const QDPExpr< RHS, OScalar< T1 > > & r
user argument for the evaluate function:
user_arg(OLattice< T > &d_, const QDPExpr< RHS, OLattice< T1 > > &r_, const Op &op_, const int *tab_)
const QDPExpr< RHS, OLattice< T1 > > & r