1 /*
2  * Copyright (c) 2003, 2007-14 Matteo Frigo
3  * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  */
20 
21 #include "ifftw-mpi.h"
22 
23 /* tproblem.c: */
24 typedef struct {
25      problem super;
26      INT vn; /* vector length (vector stride 1) */
27      INT nx, ny; /* nx x ny transposed to ny x nx */
28      R *I, *O; /* contiguous real arrays (both same size!) */
29 
30      unsigned flags; /* TRANSPOSED_IN: input is *locally* transposed
31 			TRANSPOSED_OUT: output is *locally* transposed */
32 
33      INT block, tblock; /* block size, slab decomposition;
34 			   tblock is for transposed blocks on output */
35 
36      MPI_Comm comm;
37 } problem_mpi_transpose;
38 
39 problem *XM(mkproblem_transpose)(INT nx, INT ny, INT vn,
40 				 R *I, R *O,
41 				 INT block, INT tblock,
42 				 MPI_Comm comm,
43 				 unsigned flags);
44 
45 /* tsolve.c: */
46 void XM(transpose_solve)(const plan *ego_, const problem *p_);
47 
48 /* plans have same operands as rdft plans, so just re-use */
49 typedef plan_rdft plan_mpi_transpose;
50 #define MKPLAN_MPI_TRANSPOSE(type, adt, apply) \
51   (type *)X(mkplan_rdft)(sizeof(type), adt, apply)
52 
53 /* transpose-pairwise.c: */
54 int XM(mkplans_posttranspose)(const problem_mpi_transpose *p, planner *plnr,
55 			      R *I, R *O, int my_pe,
56 			      plan **cld2, plan **cld2rest, plan **cld3,
57 			      INT *rest_Ioff, INT *rest_Ooff);
58 /* various solvers */
59 void XM(transpose_pairwise_register)(planner *p);
60 void XM(transpose_alltoall_register)(planner *p);
61 void XM(transpose_recurse_register)(planner *p);
62