-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdistributed_fft3d.h
58 lines (55 loc) · 1.44 KB
/
distributed_fft3d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef DISTRIBUTED_FFT3D_H_
#define DISTRIBUTED_FFT3D_H_
#include <fftw3.h>
#include <fftw3-mpi.h>
#include <vector>
#include <string>
#include "boost/shared_ptr.hpp"
#include "multi_array_typedefs.h"
#include "commxx.h"
class Distributed_fft3d
{
private:
fftw_plan plan, inv_plan;
double *data;
fftw_complex *workspace;
int lower, upper;
std::vector<int> uppers, lengths;
int local_size_real, local_size_complex;
std::vector<int > shape;
bool have_local_data;
Commxx_sptr comm_sptr;
void
calculate_uppers_lengths();
public:
Distributed_fft3d(std::vector<int > const& shape, Commxx_sptr comm_sptr,
int planner_flags = FFTW_ESTIMATE,
std::string const& wisdom_filename = "");
Commxx_sptr
get_comm_sptr();
Commxx &
get_comm();
int
get_lower() const;
int
get_upper() const;
std::vector<int > const&
get_uppers();
std::vector<int > const&
get_lengths();
std::vector<int > const&
get_shape() const;
std::vector<int >
get_padded_shape_real() const;
std::vector<int >
get_padded_shape_complex() const;
void
transform(MArray3d_ref & in, MArray3dc_ref & out);
void
inv_transform(MArray3dc_ref & in, MArray3d_ref & out);
double
get_roundtrip_normalization() const;
~Distributed_fft3d();
};
typedef boost::shared_ptr<Distributed_fft3d > Distributed_fft3d_sptr; // syndoc:include
#endif /* DISTRIBUTED_FFT3D_H_ */