5#include "plumbing/timing.h"
13hila::timer pencil_reshuffle_timer(
" pencil reshuffle");
21std::vector<pencil_struct> hila_pencil_comms[NDIM];
22unsigned hila_fft_my_columns[NDIM];
23size_t pencil_recv_buf_size[NDIM];
26#if (defined(HIP) || defined(CUDA)) && !defined(HILAPP)
27hila_saved_fftplan_t hila_saved_fftplan;
31void FFT_delete_plans() {
32#if (defined(HIP) || defined(CUDA)) && !defined(HILAPP)
33 hila_saved_fftplan.delete_plans();
39size_t pencil_get_buffer_offsets(
const Direction dir,
const size_t elements,
43 nmin = lattice.mynode.min;
45 size_t element_offset = lattice.mynode.size[dir];
46 size_t s = element_offset * elements;
50 s *= lattice.mynode.size[d];
53 return element_offset;
63 if (hila_pencil_comms[dir].size() == 0) {
66 hila_pencil_comms[dir].resize(lattice.nodes.n_divisions[dir]);
69 for (
const node_info &n : lattice.nodes.nodelist) {
70 bool is_in_column =
true;
71 foralldir(d)
if (d != dir && n.min[d] != lattice.mynode.min[d]) {
81 fn.size_to_dir = n.size[dir];
82 for (
int i = 0; i < lattice.nodes.n_divisions[dir]; i++) {
83 if (n.min[dir] == lattice.nodes.divisors[dir][i]) {
84 hila_pencil_comms[dir].at(i) = fn;
91 size_t total_columns = lattice.mynode.sites / lattice.mynode.size[dir];
93 size_t nodes = hila_pencil_comms[dir].size();
97 for (pencil_struct &fn : hila_pencil_comms[dir]) {
99 ((i * total_columns) / nodes) * lattice.mynode.size[dir];
100 fn.column_number = (((i + 1) * total_columns) / nodes) -
101 fn.column_offset / lattice.mynode.size[dir];
104 hila_fft_my_columns[dir] = fn.column_number;
109 pencil_recv_buf_size[dir] = 0;
111 for (pencil_struct &fn : hila_pencil_comms[dir]) {
112 fn.recv_buf_size = hila_fft_my_columns[dir] * fn.size_to_dir;
116 pencil_recv_buf_size[dir] += fn.recv_buf_size;
#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.
This file defines all includes for HILA.
int myrank()
rank of this node
useful information about a node