14 if (s != lattice.
volume()) {
15 hila::out0 <<
" Reduction test error! Sum " << s <<
" should be " << lattice.
volume()
27 f1[X] = X.coordinates();
28 f2[X] = (X.coordinates() + d).mod(lattice.
size());
32 dif1 +=
abs(f1[X + d] - f2[X]);
33 dif2 +=
abs(f1[X] - f2[X - d]);
38 << hila::prettyprint(d) <<
" dif1 " << dif1 <<
'\n';
42 if (dif2.squarenorm() != 0) {
44 << hila::prettyprint(d) <<
" dif2 " << dif2 <<
'\n';
49 dif1 +=
abs(f1[X + d] - f2[X]);
50 dif2 +=
abs(f1[X] - f2[X - d]);
55 <<
" direction " << hila::prettyprint(d) <<
" dif1 " << dif1 <<
'\n';
59 if (dif2.squarenorm() != 0) {
61 <<
" direction " << hila::prettyprint(d) <<
" dif2 " << dif2 <<
'\n';
66#if 0 && defined(SPECIAL_BOUNDARY_CONDITIONS)
68 if (next_direction(d) == NDIM) {
72 if (X.coordinate(d) == lattice.
size(d) - 1)
79 onsites(
ALL) { dif1 += f1[X] - f2[X - d]; }
83 <<
" direction " << (unsigned)d <<
'\n';
91void test_std_gathers() {
95#ifdef MPI_BENCHMARK_TEST
96 hila::out0 <<
"MPI_BENCHMARK_TEST defined, not doing communication tests!\n";
102#if defined(CUDA) || defined(HIP)
109 hila::print_dashed_line();
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
void set_boundary_condition(Direction dir, hila::bc bc)
Set the boundary condition in a given Direction (periodic or antiperiodic)
int size(Direction d) const
lattice.size() -> CoordinateVector or lattice.size(d) -> int returns the dimensions of the lattice,...
bool is_base() const
lattice.is_base() is used to check if the current lattice is the original one, i.e....
int64_t volume() const
lattice.volume() returns lattice volume Can be used inside onsites()-loops
hila::arithmetic_type< T > squarenorm() const
Calculate square norm - sum of squared elements.
T abs(const Complex< T > &a)
Return absolute value of Complex number.
constexpr Parity EVEN
bit pattern: 001
#define foralldir(d)
Macro to loop over (all) Direction(s)
constexpr Parity ALL
bit pattern: 011
int myrank()
rank of this node
std::ostream out
this is our default output file stream
std::ostream out0
This writes output only from main process (node 0)
void terminate(int status)