How to link cluster fft under windows

How to link cluster fft under windows

I have been trying to compile and run my cluster fft code which contains mpi. I have been successful in single core mkl fft with this command

ifort /Qmkl "C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\include\mkl_dfti.f90" fft_single.f90

But when it comes to cluster fft,below fails to link

mpif90 /Qmkl "C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\include\mkl_cdft.f90" fft_mpi.f90

It gives me : There is no matching specific function for this generic function reference DFTICREATEDESCRIPTORDM. I also noticed that when i give these functions a wrong handle or parameter, it gives exactly the same error (for ifort). Error algorithm cannot make a difference between a wrongly written function name and wrongly given parameter in it.

So how can i compile/link cluster fft scripts. Is there a problem in linking or is there a problem in coding? A give a very basic script below, it should be able to at least compile and link this

program main
use mpi
Use MKL_CDFT

complex(8), allocatable :: A(:)

integer :: len(2),ierr,id,numprocs
type(DFTI_DESCRIPTOR), POINTER :: FFT

call MPI_INIT(ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD,numprocs,ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD,id,ierr)

len(1)=4; len(2)=4

status = DftiCreateDescriptorDM(MPI_COMM_WORLD,FFT,DFTI_DOUBLE,DFTI_COMPLEX,2,len)
call mpi_finalize(ierr)

end program main

7 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

I'm not familiar with that function. The message indicates a discrepancy between the function arguments you provided and those required according to MKL_CDFT. Discrepancy could be in number of arguments, type, or rank.

I tried couple of things, i tried linking another libraries, i tried adding another "use - include" packages, all leads to same result.
If i understand correctly you say there is something wrong in code? I should alter the code in order to be able to compile? Is it a compilation error?
I use "use mkl_dfti" header when i write it for single core (ifort). I use " use mkl_cdft" header for multi-core( cluster or mpi). And i link correspondent source code for these. There is more than 1 function (DftiCreateDescriptorDM). These are pack of functions for fft calculations. I wrote first of them to keep it simple.
Interestingly the script above works. When i comply it with ifort for single core. Ofcourse i had to remove mpi calls and i had to change DftiCreateDescriptorDM to DftiCreateDescriptor. I looked at the C examples of cluster fft and it looks like i'm doing it right. My guess is, i fail to link it with proper package.
Any help is appreciated, i'm experienced in fortran and mpi but im very new in intel mkl packages.

Hi, Deniz!

The problem is that /Qmkl doesn't include MKL cluster libraries where DftiCommitDescriptorDM is implemented.
Did you tried to link with /Qmkl:cluster option as it's written in here: http://software.intel.com/en-us/articles/using-mkl-in-intel-compiler-mkl... or http://software.intel.com/sites/products/documentation/doclib/stdxe/2013....

If this doesn't help, please try to set libraries for linker explicitly. I should be something like:
mpif90 ... /LIBPATH:$(MKL_LIB_PATH) $(MKL_LIBS)
where (e.g.)
$(MKL_LIB_PATH) = C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\lib\intel64
$(MKL_LIBS) = mkl_cdft_core.lib mkl_intel_ilp64.lib mkl_intel_thread.lib mkl_core.lib mkl_blacs_intelmpi_ilp64.lib -Qopenmp

Also please find some additional info here: http://software.intel.com/sites/products/documentation/hpc/mkl/mkl_userg...

Hi,

To link with cluster MKL it needs to use /Qmkl:cluster option.
Please try also MKL link Advisor http://software.intel.com/sites/products/mkl/ to specify explicitly MKL libraries in command line

Thanks,
-- Victor

Thank you Victor Pasko

Adding /Qmkl:cluster option did the trick. So working command is now
mpif90 /Qmkl:cluster "C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\include\mkl_cdft.f90" fft_cluster.f90

I also added the working final code for this. For people who learns by examples. I hardly find any fortran example for mkl.
It's a simple fft for 2 dimensional matrix. I compared the results to Matlab's fftn function and its working (same) for my 4 core PC. Feel free to modify :D

This is the file

Allegati: 

AllegatoDimensione
Download fft-cluster.f901.09 KB

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi