⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.f77

📁 FFTW, a collection of fast C routines to compute the Discrete Fourier Transform in one or more dime
💻 F77
字号:
		     Using MPI FFTW from FortranFFTW 2.1.3 contains *experimental* wrapper functions for calling theMPI FFTW routines from Fortran.  We are interested in feedback on thewrapper interface, as well as on whether or not these routines workfor you.  The interface may change in future releases.You should first read the "Calling FFTW from Fortran" section of theFFTW manual, as most of what is said there also applies here.  Youshould also read the "MPI FFTW" section of the manual.Wrapper routines:The wrapper routines have the same names as the corresponding FFTWroutines, but prefixed with "fftw_f77" or "rfftw_f77"(e.g. fftw_f77_mpi_create_plan).  The parameters are the same, withthe following exceptions:1) The caveats described in "Calling FFTW from Fortran" hold here aswell; e.g. function return values become the first parameter.2) The MPI transform routines take a "work" parameter, which can beNULL in C.  Since there is no way to pass NULL from Fortran, the workparameter is followed by an *extra* parameter, use_work, which shouldbe either 0 or 1.  If use_work is 0, then the work parameter isignored (just like passing NULL in C), and if use_work is 1, the workparameter should be an array of the same size as the local data (justlike when work is non-NULL in C).3) Use the following definitions:      integer FFTW_TRANSPOSED_ORDER, FFTW_NORMAL_ORDER      parameter(FFTW_TRANSPOSED_ORDER=1, FFTW_NORMAL_ORDER=0)            integer FFTW_SCRAMBLED_INPUT, FFTW_SCRAMBLED_OUTPUT      parameter(FFTW_SCRAMBLED_INPUT=8192)      parameter(FFTW_SCRAMBLED_OUTPUT=16384)4) The array is divided among the processors for fftwnd in the lastdimension, not the first.  See below.MPI Communicator Parameters:It's not clear how one passes MPI_Comm parameters from Fortran to C.Your feedback on how this can be done in various MPI implementationswould be appreciated--especially ways for the configure script toautomatically detect how it is being done.MPICH, for example, has an MPI_Comm_f2c macro that is used to convertbetween the two representations--the configure script detects this anduses it if available.Otherwise, we currently ignore the comm parameter and use a default ofMPI_COMM_WORLD.Allocating Arrays:Just as in C, you have to call FFTW at runtime to find out the portionof the array local to each process (using fftw_f77_mpi_local_sizes,etcetera).  This means, however, that you have to allocate your data(and work) arrays dynamically.  There are a few options for doing this:1) Use Fortran 90, which allows dynamically-allocated arrays.2) Use a "compile-twice" scheme: Run the program once to get & outputthe local size by calling the *_mpi_local_sizes routine.  Then,substitute this value into the array declaration and recompile.  Sincethe local size may be different on different processors, and you onlycompile one executable, you will need to take the maximum of the localsizes when declaring the array.3) Use C.The arguments to fftwnd_f77_mpi_local_sizes are interpreted as follows:call fftwnd_f77_mpi_local_sizes(plan,                                local_nlast,                                local_last_start,                                local_nlast2_after_transform,                                local_last2_start_after_transform,                                total_local_size)As in C, your array must contain at least total_local_size elements(which may be slightly larger than you expect).  "last" refers to thelast dimension of your data and "last2" refers to the second-to-lastdimension (for when you do the transform with transposed-orderoutput)--this it the opposite of C, where those arguments refer to thefirst and second dimensions, respectively.For example, if you are doing a 3d nx x ny x nz transform, your arraywill be declared as data(total_local_size) and should be interpretedas a Fortran (column-major) array data(0:nx-1, 0:ny-1,0:local_nlast-1), where the last dimension corresponds to the nzindices starting at local_last_start.  Note that the indices arezero-based.  If you transform the array with transposed-order output,the array should then be interpreted as data(0:nx-1, 0:nz-1,0:local_nlast2_after_transform-1), where the last dimensioncorresponds to the ny indices starting atlocal_last2_start_after_transform.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -