23 hila::out0 <<
"\n-------------------------------------\n";
33 for (
int i = 0; i < 10; ++i) {
39 int n_loops = 50.0 / time;
43 for (
int i = 0; i < n_loops; ++i) {
49 hila::out0 <<
" In separate onsites loops: " << time <<
" seconds, " << time / n_loops
50 <<
" per loop, " << time / n_loops / lattice.volume() <<
" per site\n";
55 for (
int i = 0; i < n_loops; ++i) {
63 hila::out0 <<
" In a single onsites loop: " << time <<
" seconds, " << time / n_loops
64 <<
" per loop, " << time / n_loops / lattice.volume() <<
" per site\n";
73 hila::out0 <<
"\n-------------------------------------\n";
74 hila::out0 <<
"3x3 Complex double matrix multiply: ";
84 for (
int i = 0; i < 10; ++i) {
90 int n_loops = 50.0 / time;
94 for (
int i = 0; i < n_loops; ++i) {
100 hila::out0 <<
" In separate onsites loops: " << time <<
" seconds, " << time / n_loops
101 <<
" per loop, " << time / n_loops / lattice.volume() <<
" per site\n";
105 for (
int i = 0; i < n_loops; ++i) {
112 hila::out0 <<
" In a single onsites loop: " << time <<
" seconds, " << time / n_loops
113 <<
" per loop, " << time / n_loops / lattice.volume() <<
" per site\n";
122 constexpr int n_gathers = 300;
124 hila::out0 <<
"\n-------------------------------------\n";
125 hila::out0 <<
"Nearest neighbour communication: complex field\n";
131 for (
int i = 0; i < 3; i++) {
134 df.mark_changed(
ALL);
138 for (
Direction d = e_x; d < NDIRECTIONS; ++d) {
140 df.mark_changed(
ALL);
144 for (
int i = 0; i < n_gathers; i++) {
146 df.mark_changed(
ALL);
150 hila::out0 <<
" Gather from direction " << hila::prettyprint(d) <<
": " << time / n_gathers
162 constexpr int n_fft = 20;
164 hila::out0 <<
"\n-------------------------------------\n";
165 hila::out0 <<
"FFT of a double complex field\n";
169 df.gaussian_random();
175 for (
int i = 0; i < n_fft; ++i) {
181 hila::out0 <<
" " << n_fft <<
" FFTs " << time <<
" sec, " << time / n_fft
182 <<
" for single FFT\n";
190 constexpr int n_update = 500;
192 hila::out0 <<
"\n-------------------------------------\n";
193 hila::out0 <<
"NN-smear complex field " << n_update <<
" times\n";
197 df.gaussian_random();
201 foralldir(d) rf[X] += df[X + d] + df[X - d];
203 df.mark_changed(
ALL);
206 for (
int i = 0; i < n_update; i++) {
209 foralldir(d) rf[X] += df[X + d] + df[X - d];
216 hila::out0 <<
" Total time " << time <<
" s, one update " << time / n_update <<
", per site "
217 << time / n_update / lattice.volume() <<
'\n';
223void bench_matrix_update() {
225 constexpr int n_update = 50;
227 hila::out0 <<
"\n-------------------------------------\n";
228 hila::out0 <<
"NN-mult SU(5) matrix field " << n_update <<
" times\n";
236 rf[X] = rf[X] * df[X + d] * df[X - d];
238 df.mark_changed(
ALL);
241 for (
int i = 0; i < n_update; i++) {
243 foralldir(d) rf[X] += df[X + d] * df[X - d];
245 df.mark_changed(
ALL);
250 hila::out0 <<
" Total time " << time <<
" s, one update " << time / n_update <<
", per site "
251 << time / n_update / lattice.volume() <<
'\n';
257int main(
int argc,
char **argv) {
266 long seed = par.get(
"random seed");
272 lattice.
setup(lsize);
281 hila::out0 <<
"###################################\n\n";
293 bench_matrix_update();
295 hila::out0 <<
"\n##################################\n";
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
void setup(const CoordinateVector &siz)
General lattice setup.
#define foralldir(d)
Macro to loop over (all) Direction(s)
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
constexpr Parity ALL
bit pattern: 011
void synchronize()
synchronize mpi
double random()
Real valued uniform random number generator.
std::ostream out0
This writes output only from main process (node 0)
void initialize(int argc, char **argv)
Read in command line arguments. Initialise default stream and MPI communication.
void seed_random(uint64_t seed, bool device_rng=true)
Seed random generators with 64-bit unsigned value. On MPI shuffles the seed so that different MPI ran...
void finishrun()
Normal, controlled exit - all nodes must call this. Prints timing information and information about c...