18 ghost( ), ghostNorm( ), ghostFace( ),
19 bytes(0), norm_bytes(0), even(0), odd(0),
20 composite_descr(
param.is_composite,
param.composite_dim,
param.is_component,
param.component_id),
30 ghost( ), ghostNorm( ), ghostFace( ),
31 bytes(0), norm_bytes(0), even(0), odd(0),
32 composite_descr(field.composite_descr), components(0)
49 int num_faces = ((
nSpin == 4 && spin_project) ? 1 : 2) * nFace;
50 int num_norm_faces = 2*nFace;
55 int x5 =
nDim == 5 ?
x[4] : 1;
56 for (
int i=0;
i<dims;
i++) {
60 for (
int j=0; j<dims; j++) {
99 int ghostNormVolume = num_norm_faces * ghostVolume;
100 ghostVolume *= num_faces;
106 printfQuda(
"Allocated ghost volume = %d, ghost norm volume %d\n", ghostVolume, ghostNormVolume);
107 printfQuda(
"ghost length = %lu, ghost norm length = %lu\n", ghost_length, ghost_norm_length);
128 for (
int j=0; j<4; j++) face[j] =
X[j];
201 errorQuda(
"Must be two flavors for non-degenerate twisted mass spinor (while provided with %d number of components)\n",
x[4]);
274 check =
snprintf(
aux_string, aux_string_n,
"vol=%d,stride=%d,precision=%d,Ns=%d,Nc=%d",
276 if (check < 0 || check >= aux_string_n)
errorQuda(
"Error writing aux string");
281 if (check < 0 || check >= aux_string_n)
errorQuda(
"Error writing aux string");
291 if(
src.composite_descr.is_composite){
306 src.siteOrder,
src.fieldOrder,
src.gammaBasis,
src.PCtype);
336 errorQuda(
"Must be two flavors for non-degenerate twisted mass spinor (provided with %d)\n",
x[4]);
393 if (!
init)
errorQuda(
"Shouldn't be resetting a non-inited field\n");
397 std::cout << *
this << std::endl;
415 param.is_component =
false;
416 param.component_id = 0;
444 void *total_send =
nullptr;
445 void *total_recv =
nullptr;
452 bool no_comms_fill =
false;
458 bool fine_grained_memcpy =
false;
463 send_back[
i] = sendbuf[2*
i + 0];
464 send_fwd[
i] = sendbuf[2*
i + 1];
467 }
else if (no_comms_fill) {
480 send_back[
i] =
static_cast<char*
>(total_send) +
offset;
481 recv_back[
i] =
static_cast<char*
>(total_recv) +
offset;
483 send_fwd[
i] =
static_cast<char*
>(total_send) +
offset;
484 recv_fwd[
i] =
static_cast<char*
>(total_recv) +
offset;
486 if (fine_grained_memcpy) {
490 }
else if (no_comms_fill) {
497 void *send_ptr =
nullptr;
500 send_ptr = sendbuf[2*
i];
536 if (fine_grained_memcpy) {
544 void *ghost_ptr =
nullptr;
576 }
else if (
nSpin == 2) {
578 }
else if (
nSpin == 1) {
587 if (
a.Length() !=
b.Length()) {
588 errorQuda(
"checkSpinor: lengths do not match: %lu %lu",
a.Length(),
b.Length());
591 if (
a.Ncolor() !=
b.Ncolor()) {
592 errorQuda(
"checkSpinor: colors do not match: %d %d",
a.Ncolor(),
b.Ncolor());
595 if (
a.Nspin() !=
b.Nspin()) {
596 errorQuda(
"checkSpinor: spins do not match: %d %d",
a.Nspin(),
b.Nspin());
599 if (
a.TwistFlavor() !=
b.TwistFlavor()) {
600 errorQuda(
"checkSpinor: twist flavors do not match: %d %d",
a.TwistFlavor(),
b.TwistFlavor());
608 errorQuda(
"Cannot return even subset of QDPJIT field");
616 errorQuda(
"Cannot return even subset of QDPJIT field");
624 errorQuda(
"Cannot return even subset of QDPJIT field");
632 errorQuda(
"Cannot return even subset of QDPJIT field");
642 errorQuda(
"Incorrect component index...");
645 errorQuda(
"Cannot get requested component");
655 errorQuda(
"Incorrect component index...");
658 errorQuda(
"Cannot get requested component");
712 for (
int d=1;
d<
nDim;
d++) oddBit +=
y[
d];
715 y[0] = 2*
y[0] + oddBit;
738 for (
int d=
nDim-1;
d>=0;
d--) {
779 for (
int d=0;
d<
nDim;
d++) coarseParam.
x[
d] =
x[
d]/geoBlockSize[
d];
798 errorQuda(
"Invalid field location %d", new_location);
807 for (
int d=0;
d<
nDim;
d++) fineParam.
x[
d] =
x[
d] * geoBlockSize[
d];
828 errorQuda(
"Invalid field location %d", new_location);
834 out <<
"typedid = " <<
typeid(
a).name() << std::endl;
835 out <<
"nColor = " <<
a.nColor << std::endl;
836 out <<
"nSpin = " <<
a.nSpin << std::endl;
837 out <<
"twistFlavor = " <<
a.twistFlavor << std::endl;
838 out <<
"nDim = " <<
a.nDim << std::endl;
839 for (
int d=0;
d<
a.nDim;
d++)
out <<
"x[" <<
d <<
"] = " <<
a.x[
d] << std::endl;
840 out <<
"volume = " <<
a.volume << std::endl;
841 out <<
"precision = " <<
a.precision << std::endl;
842 out <<
"pad = " <<
a.pad << std::endl;
843 out <<
"stride = " <<
a.stride << std::endl;
844 out <<
"real_length = " <<
a.real_length << std::endl;
845 out <<
"length = " <<
a.length << std::endl;
846 out <<
"bytes = " <<
a.bytes << std::endl;
847 out <<
"norm_bytes = " <<
a.norm_bytes << std::endl;
848 out <<
"siteSubset = " <<
a.siteSubset << std::endl;
849 out <<
"siteOrder = " <<
a.siteOrder << std::endl;
850 out <<
"fieldOrder = " <<
a.fieldOrder << std::endl;
851 out <<
"gammaBasis = " <<
a.gammaBasis << std::endl;
852 out <<
"Is composite = " <<
a.composite_descr.is_composite << std::endl;
853 if(
a.composite_descr.is_composite)
855 out <<
"Composite Dim = " <<
a.composite_descr.dim << std::endl;
856 out <<
"Composite Volume = " <<
a.composite_descr.volume << std::endl;
857 out <<
"Composite Stride = " <<
a.composite_descr.stride << std::endl;
858 out <<
"Composite Length = " <<
a.composite_descr.length << std::endl;
860 out <<
"Is component = " <<
a.composite_descr.is_component << std::endl;
861 if(
a.composite_descr.is_composite)
out <<
"Component ID = " <<
a.composite_descr.id << std::endl;
862 out <<
"PC type = " <<
a.PCtype << std::endl;
#define qudaMemcpy(dst, src, count, kind)
CompositeColorSpinorField components
void OffsetIndex(int &i, int *y) const
QudaFieldOrder fieldOrder
#define pool_pinned_free(ptr)
int ghostNormOffset[QUDA_MAX_DIM][2]
enum QudaPrecision_s QudaPrecision
int snprintf(char *__str, size_t __size, const char *__format,...) __attribute__((__format__(__printf__
char aux_tmp[TuneKey::aux_n]
void * ghostNorm[2][QUDA_MAX_DIM]
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
int ghostFace[QUDA_MAX_DIM]
QudaVerbosity getVerbosity()
enum QudaFieldOrder_s QudaFieldOrder
CompositeColorSpinorFieldDescriptor composite_descr
used for deflation eigenvector sets etc.:
virtual ~ColorSpinorField()
static __inline__ dim3 dim3 void size_t cudaStream_t int dim
const ColorSpinorField & Even() const
enum QudaSiteOrder_s QudaSiteOrder
const ColorSpinorField & Odd() const
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
QudaGammaBasis gammaBasis
char * strcpy(char *__dst, const char *__src)
ColorSpinorField * CreateFine(const int *geoblockSize, int spinBlockSize, int Nvec, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION)
DslashConstant dslash_constant
ColorSpinorField & Component(const int idx) const
QudaSiteSubset siteSubset
void exit(int) __attribute__((noreturn))
ColorSpinorField(const ColorSpinorField &)
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)
void comm_free(MsgHandle *mh)
int_fastdiv Xh[QUDA_MAX_DIM]
enum QudaDWFPCType_s QudaDWFPCType
int_fastdiv X[QUDA_MAX_DIM]
#define comm_declare_send_relative(buffer, dim, dir, nbytes)
static void checkField(const ColorSpinorField &, const ColorSpinorField &)
#define comm_declare_receive_relative(buffer, dim, dir, nbytes)
void create(int nDim, const int *x, int Nc, int Ns, QudaTwistFlavorType Twistflavor, QudaPrecision precision, int pad, QudaSiteSubset subset, QudaSiteOrder siteOrder, QudaFieldOrder fieldOrder, QudaGammaBasis gammaBasis, QudaDWFPCType PCtype)
void exchange(void **ghost, void **sendbuf, int nFace=1) const
void reset(const ColorSpinorParam &)
QudaFieldOrder fieldOrder
#define ALIGNMENT_ADJUST(n)
void * GhostNorm(const int i)
void comm_start(MsgHandle *mh)
void * ghost[2][QUDA_MAX_DIM]
char vol_string[TuneKey::volume_n]
size_t ghost_face_bytes[QUDA_MAX_DIM]
QudaTwistFlavorType twistFlavor
void * memcpy(void *__dst, const void *__src, size_t __n)
MsgHandle * mh_send_fwd[2][QUDA_MAX_DIM]
int GhostOffset(const int i) const
virtual ColorSpinorField & operator=(const ColorSpinorField &)
enum QudaSiteSubset_s QudaSiteSubset
QudaFieldLocation Location() const
#define pool_pinned_malloc(size)
ColorSpinorField * CreateCoarse(const int *geoblockSize, int spinBlockSize, int Nvec, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION)
enum QudaFieldLocation_s QudaFieldLocation
char aux_string[TuneKey::aux_n]
QudaFieldLocation location
cpuColorSpinorField * out
int ghostOffset[QUDA_MAX_DIM][2]
void createGhostZone(int nFace, bool spin_project=true) const
enum QudaGammaBasis_s QudaGammaBasis
void fill(ColorSpinorParam &) const
int ghostFace[QUDA_MAX_DIM+1]
void LatticeIndex(int *y, int i) const
int surfaceCB[QUDA_MAX_DIM]
void *const * Ghost() const
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
void comm_wait(MsgHandle *mh)
static const int volume_n
void * ghost_buf[2 *QUDA_MAX_DIM]
static __inline__ size_t size_t d
QudaSiteSubset siteSubset
MsgHandle * mh_send_back[2][QUDA_MAX_DIM]
QudaFieldOrder FieldOrder() const
int comm_dim_partitioned(int dim)
enum QudaTwistFlavorType_s QudaTwistFlavorType