HILA
Loading...
Searching...
No Matches
simple_gpu.cpp
1#include "hila.h"
2
3static_assert(NDIM == 3, "NDIM must be 3 here");
4
5using MyType = double;
6
7int main(int argc, char *argv[]) {
8
9 // initialize system
10 hila::initialize(argc, argv);
11
12 // set up the lattice
13 lattice.setup({128, 128, 128});
14
15 // Random numbers are used here - use time to seed
17 double reduce = 0;
18 // lattice field
19 Field<MyType> f = 1;
20 // make f Gaussian random distributed
21 onsites(ALL) reduce += f[X];
22 hila::out0 << reduce/lattice.volume()<< '\n';
23
24 f.random();
25 onsites(ALL) reduce += f[X];
26 hila::out0 << reduce/lattice.volume() << '\n';
27
29 return 0;
30}
Complex definition.
Definition cmplx.h:56
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
Definition field.h:61
void setup(const CoordinateVector &siz)
General lattice setup.
Definition lattice.cpp:33
constexpr Parity ALL
bit pattern: 011
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...
Definition random.cpp:86
void finishrun()
Normal, controlled exit - all nodes must call this. Prints timing information and information about c...