39 multi1d<int> fcoord = func(coord,+1);
47 fprintf(stderr,
"goffsets(%d,%d,%d) = %d\n",ipos,goffsets(ipos));
69 size_t size =
sizeof(
REAL32);
70 size_t su3_size = size*mat_size;
76 for(
int dd=0; dd<
Nd; dd++)
78 sa[dd].resize(nodeSites);
82 char *chk_buf =
new(std::nothrow)
char[su3_size];
83 if( chk_buf == 0x0 ) {
87 for(
int linear=0; linear < nodeSites; ++linear)
89 for(
int dd=0; dd<
Nd; dd++)
97 for(
int kk=0; kk<
Nc; kk++)
98 for(
int ii=0; ii<2; ii++)
105 memcpy(chk_buf, &(su3[0][0][0]), su3_size);
113 for(
int kk=0; kk<
Nc; kk++)
114 for(
int ii=0; ii<
Nc; ii++)
121 memcpy(chk_buf, &(su3[0][0][0]), su3_size);
126 QDPIO::cerr << __func__ <<
": unexpected size" << std::endl;
132 for(
int i=0; i < mat_size*size/
sizeof(
n_uint32_t); ++i)
133 checksum += chk_ptr[i];
154 n_uint32_t& checksum,
int mat_size,
int float_size)
162 su3_buffer =
new char[
Nc*
Nc*2*float_size ];
163 if( su3_buffer == 0x0 ) {
172 for(
int dd=0; dd<
Nd; dd++)
175 cfg_in.readArray(su3_buffer, float_size, mat_size);
184 for(
int i=0; i < mat_size*float_size/
sizeof(
n_uint32_t); ++i)
185 checksum += chk_ptr[i];
190 if ( float_size == 4 ) {
194 for(
int cp_index=0; cp_index < mat_size; cp_index++) {
195 su3_p[cp_index] = (
REAL)su3_bufp[cp_index];
198 else if ( float_size == 8 ) {
202 for(
int cp_index =0; cp_index < mat_size; cp_index++) {
204 su3_p[cp_index] = (
REAL)su3_bufp[cp_index];
211 su3[2][0][0] = su3[0][1][0]*su3[1][2][0] - su3[0][1][1]*su3[1][2][1]
212 - su3[0][2][0]*su3[1][1][0] + su3[0][2][1]*su3[1][1][1];
213 su3[2][0][1] = su3[0][2][0]*su3[1][1][1] + su3[0][2][1]*su3[1][1][0]
214 - su3[0][1][0]*su3[1][2][1] - su3[0][1][1]*su3[1][2][0];
216 su3[2][1][0] = su3[0][2][0]*su3[1][0][0] - su3[0][2][1]*su3[1][0][1]
217 - su3[0][0][0]*su3[1][2][0] + su3[0][0][1]*su3[1][2][1];
218 su3[2][1][1] = su3[0][0][0]*su3[1][2][1] + su3[0][0][1]*su3[1][2][0]
219 - su3[0][2][0]*su3[1][0][1] - su3[0][2][1]*su3[1][0][0];
221 su3[2][2][0] = su3[0][0][0]*su3[1][1][0] - su3[0][0][1]*su3[1][1][1]
222 - su3[0][1][0]*su3[1][0][0] + su3[0][1][1]*su3[1][0][1];
223 su3[2][2][1] = su3[0][1][0]*su3[1][0][1] + su3[0][1][1]*su3[1][0][0]
224 - su3[0][0][0]*su3[1][1][1] - su3[0][0][1]*su3[1][1][0];
228 for(
int kk=0; kk<
Nc; kk++)
230 for(
int ii=0; ii<
Nc; ii++)
232 Real re = su3[ii][kk][0];
233 Real im = su3[ii][kk][1];
242 delete [] su3_buffer;
267 for(
int dd=0; dd<
Nd; dd++)
271 if ( mat_size == 12 )
273 for(
int kk=0; kk <
Nc; kk++)
274 for(
int ii=0; ii <
Nc-1; ii++)
283 for(
int kk=0; kk <
Nc; kk++)
284 for(
int ii=0; ii <
Nc; ii++)
293 cfg_out.writeArray((
char *)&(su3[0][0][0]),
sizeof(
float), mat_size);
Binary writer base class.
void make(const MapFunc &func)
Actual constructor from a function object.
Container for a multi-dimensional 1D array.
OScalar< PScalar< PScalar< RComplex< REAL > > > > Complex
OScalar< PScalar< PColorMatrix< RComplex< REAL >, Nc > > > ColorMatrix
OScalar< PScalar< PScalar< RScalar< REAL > > > > Real
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 OScalar< T1 > &l, const multi1d< int > &coord)
Extract site element.
void readArchiv(BinaryReader &cfg_in, multi1d< LatticeColorMatrix > &u, n_uint32_t &checksum, int mat_size, int float_size)
Read a NERSC Gauge Connection Archive file.
void writeArchiv(BinaryWriter &cfg_out, const multi1d< LatticeColorMatrix > &u, int mat_size)
Writes a NERSC Gauge Connection Archive gauge configuration file.
float toFloat(const IScalar< T > &s)
QDP Real to float primitive in conversion routine.
Subset all
Default all subset.
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.
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
int vol()
Total lattice volume.
StandardOutputStream cerr
Yet another random number generator.
MakeReturn< UnaryNode< FnReal, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnReal >::Type_t >::Expression_t real(const QDPExpr< T1, C1 > &l)
MakeReturn< UnaryNode< FnPeekColorMatrix, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, C1 >::Expression_t peekColor(const QDPExpr< T1, C1 > &l, int row, int col)
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
C1 & pokeColor(QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r, int row, int col)
MakeReturn< BinaryNode< FnCmplx, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnCmplx >::Type_t >::Expression_t cmplx(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
n_uint32_t computeChecksum(const multi1d< LatticeColorMatrix > &u, int mat_size)
Compute simple NERSC-like checksum of a gauge field.
MakeReturn< UnaryNode< FnImag, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnImag >::Type_t >::Expression_t imag(const QDPExpr< T1, C1 > &l)
multi1d< int > crtesn(int ipos, const multi1d< int > &latt_size)
Decompose a lexicographic site into coordinates.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.