34#pragma omp parallel for
41 multi1d<int> fcoord = func(coord,+1);
49 fprintf(stderr,
"goffsets(%d,%d,%d) = %d\n",ipos,goffsets(ipos));
68 size_t size =
sizeof(
REAL32);
69 size_t su3_size = size*mat_size;
70 uint32_t checksum = 0;
75 for(
int dd=0; dd<
Nd; dd++)
77 sa[dd].resize(nodeSites);
81 char *chk_buf =
new(std::nothrow)
char[su3_size];
82 if( chk_buf == 0x0 ) {
86 for(
int linear=0; linear < nodeSites; ++linear)
88 for(
int dd=0; dd<
Nd; dd++)
96 for(
int kk=0; kk<
Nc; kk++)
97 for(
int ii=0; ii<2; ii++)
104 memcpy(chk_buf, &(su3[0][0][0]), su3_size);
112 for(
int kk=0; kk<
Nc; kk++)
113 for(
int ii=0; ii<
Nc; ii++)
120 memcpy(chk_buf, &(su3[0][0][0]), su3_size);
125 QDPIO::cerr << __func__ <<
": unexpected size" << std::endl;
130 uint32_t* chk_ptr = (uint32_t*)chk_buf;
131 for(
int i=0; i < mat_size*size/
sizeof(uint32_t); ++i)
132 checksum += chk_ptr[i];
156 uint32_t& checksum,
int mat_size,
int float_size)
164 su3_buffer =
new char[
Nc*
Nc*2*float_size ];
165 if( su3_buffer == 0x0 ) {
174 for(
int dd=0; dd<
Nd; dd++)
177 cfg_in.
readArray(su3_buffer, float_size, mat_size);
185 uint32_t* chk_ptr = (uint32_t*)su3_buffer;
186 for(
int i=0; i < mat_size*float_size/
sizeof(uint32_t); ++i)
187 checksum += chk_ptr[i];
192 if ( float_size == 4 )
197 for(
int cp_index=0; cp_index < mat_size; cp_index++) {
198 su3_p[cp_index] = (
REAL)su3_bufp[cp_index];
201 else if ( float_size == 8 )
206 for(
int cp_index =0; cp_index < mat_size; cp_index++) {
208 su3_p[cp_index] = (
REAL)su3_bufp[cp_index];
215 su3[2][0][0] = su3[0][1][0]*su3[1][2][0] - su3[0][1][1]*su3[1][2][1]
216 - su3[0][2][0]*su3[1][1][0] + su3[0][2][1]*su3[1][1][1];
217 su3[2][0][1] = su3[0][2][0]*su3[1][1][1] + su3[0][2][1]*su3[1][1][0]
218 - su3[0][1][0]*su3[1][2][1] - su3[0][1][1]*su3[1][2][0];
220 su3[2][1][0] = su3[0][2][0]*su3[1][0][0] - su3[0][2][1]*su3[1][0][1]
221 - su3[0][0][0]*su3[1][2][0] + su3[0][0][1]*su3[1][2][1];
222 su3[2][1][1] = su3[0][0][0]*su3[1][2][1] + su3[0][0][1]*su3[1][2][0]
223 - su3[0][2][0]*su3[1][0][1] - su3[0][2][1]*su3[1][0][0];
225 su3[2][2][0] = su3[0][0][0]*su3[1][1][0] - su3[0][0][1]*su3[1][1][1]
226 - su3[0][1][0]*su3[1][0][0] + su3[0][1][1]*su3[1][0][1];
227 su3[2][2][1] = su3[0][1][0]*su3[1][0][1] + su3[0][1][1]*su3[1][0][0]
228 - su3[0][0][0]*su3[1][1][1] - su3[0][0][1]*su3[1][1][0];
232 for(
int kk=0; kk<
Nc; kk++)
234 for(
int ii=0; ii<
Nc; ii++)
236 Real re = su3[ii][kk][0];
237 Real im = su3[ii][kk][1];
246 delete [] su3_buffer;
260void writeArchiv(BinaryWriter& cfg_out,
const multi1d<LatticeColorMatrix>& u,
271 for(
int dd=0; dd<
Nd; dd++)
275 if ( mat_size == 12 )
277 for(
int kk=0; kk <
Nc; kk++)
278 for(
int ii=0; ii <
Nc-1; ii++)
287 for(
int kk=0; kk <
Nc; kk++)
288 for(
int ii=0; ii <
Nc; ii++)
297 cfg_out.writeArray((
char *)&(su3[0][0][0]),
sizeof(
float), mat_size);
virtual void readArray(char *output, size_t nbytes, size_t nmemb)
Read data on the primary node and broadcast to all nodes.
virtual bool fail()
Checks status of the previous IO operation.
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
void globalSumArray(unsigned int *dest, int len)
Wrapper to get a functional unsigned global sum.
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)
void QDP_abort(int status)
Panic button.
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.