rfftw_mpi.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 1997-1999, 2003 Massachusetts Institute of Technology
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  16. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  19. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  21. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #ifndef RFFTW_MPI_H
  28. #define RFFTW_MPI_H
  29. #include "fftw_mpi.h"
  30. #include "rfftw.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /* __cplusplus */
  34. #ifndef MKL_INT
  35. #define MKL_INT int
  36. #endif
  37. /***********************************************************************/
  38. typedef struct {
  39. fftw_plan p_fft_x; /* plan for first dimension */
  40. rfftwnd_plan p_fft; /* plan for subsequent dimensions */
  41. transpose_mpi_plan p_transpose, p_transpose_inv;
  42. fftw_complex *work; /* extra workspace, if needed */
  43. } rfftwnd_mpi_plan_data;
  44. typedef rfftwnd_mpi_plan_data *rfftwnd_mpi_plan;
  45. extern rfftwnd_mpi_plan rfftwnd_mpi_create_plan(MPI_Comm comm,
  46. int rank, const MKL_INT *n,
  47. fftw_direction dir,
  48. int flags);
  49. extern rfftwnd_mpi_plan rfftw2d_mpi_create_plan(MPI_Comm comm,
  50. MKL_INT nx, MKL_INT ny,
  51. fftw_direction dir, int flags);
  52. extern rfftwnd_mpi_plan rfftw3d_mpi_create_plan(MPI_Comm comm,
  53. MKL_INT nx, MKL_INT ny, MKL_INT nz,
  54. fftw_direction dir, int flags);
  55. extern void rfftwnd_mpi_destroy_plan(rfftwnd_mpi_plan p);
  56. extern void rfftwnd_mpi_local_sizes(rfftwnd_mpi_plan p,
  57. MKL_INT *local_nx,
  58. MKL_INT *local_x_start,
  59. MKL_INT *local_ny_after_transpose,
  60. MKL_INT *local_y_start_after_transpose,
  61. MKL_INT *total_local_size);
  62. extern void rfftwnd_mpi(rfftwnd_mpi_plan p,
  63. int n_fields,
  64. fftw_real *local_data, fftw_real *work,
  65. fftwnd_mpi_output_order output_order);
  66. /***********************************************************************/
  67. #ifdef __cplusplus
  68. } /* extern "C" */
  69. #endif /* __cplusplus */
  70. #endif /* RFFTW_MPI_H */