67 auto constexpr row_major_order = std::array<int, 3>{2, 1, 0};
68 auto constexpr col_major_order = std::array<int, 3>{0, 1, 2};
69 auto constexpr in_box_order =
73 auto constexpr out_box_order =
79 auto const global_out_box_full = Box({0, 0, 0}, high, out_box_order);
80 auto const global_out_box =
81 FFTConfig::use_r2c ? global_out_box_full.r2c(FFTConfig::r2c_dir)
82 : global_out_box_full;
83 auto best_grid = node_grid;
84 for (
auto i : {0u, 1u, 2u}) {
85 if (global_mesh[i] % (2 * n_procs) == 0) {
86 best_grid = {n_procs, 1, 1};
91 auto out_boxes = heffte::split_world(global_out_box, to_array(best_grid));
92 out_box = std::make_unique<Box>(out_boxes[comm.rank()]);
94 in_box = std::make_unique<Box>(
95 to_array(rs_local_ld_index),
100 heffte::plan_options options = heffte::default_options<backend_tag>();
106 options.use_reorder =
true;
112 options.algorithm = heffte::reshape_algorithm::p2p_plined;
118 options.use_pencils =
true;
119 if constexpr (FFTConfig::use_r2c) {
120 fft3d = std::make_unique<FFT3D>(*in_box, *out_box, FFTConfig::r2c_dir,
123 fft3d = std::make_unique<FFT3D>(*in_box, *out_box, comm, options);
125 m_workspace.resize(fft3d->size_workspace());