[Numpy-discussion] Compiling openmp implemented fortran code by f2py using ifort compiler
koushik naskar
koushik.naskar9 at gmail.com
Wed Jan 30 12:10:46 EST 2019
Hi,
I have a FORTRAN90 code, with openmp implemented for some parts. Now to
compile the fortran code using f2py with openmp support I have to pass the
f90 compiler flags. Now the code should compile with openmp support only if
I provide the openmp relavant flag, unless it must be compiled as a normal
serial code. This works as expected for gfortran but for ifort it doesn't.
Lets explain this,
if I run,
(gfortran serial mode)
*f2py -c adt.f90 -m adt_module*
Gives output (last few lines)
*Fortran f77 compiler: /usr/bin/gfortran -Wall -g -ffixed-form
-fno-second-underscore -fPIC -O3 -funroll-loops*
*Fortran f90 compiler: /usr/bin/gfortran -Wall -g -fno-second-underscore
-fPIC -O3 -funroll-loops*
*Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form
-fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3
-funroll-loops*
(gfortran parallel mode)
*f2py -c adt.f90 -m adt_module --f90flags='-fopenmp' -lgomp *
output
*Fortran f77 compiler: /usr/bin/gfortran -Wall -g -ffixed-form
-fno-second-underscore -fPIC -O3 -funroll-loops*
*Fortran f90 compiler: /usr/bin/gfortran -fopenmp -fPIC -O3 -funroll-loops*
*Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form
-fno-second-underscore -fopenmp -fPIC -O3 -funroll-loops*
As you can clearly see there is no -fopenmp flag during the compilation in
serial mode, as expected as I haven't pass the required flag
*Now for ifort*
(ifort parallel mode)
*f2py -c adt.f90 -m adt_module --fcompiler=intelem --f90flags='-qopenmp'
-liomp5*
Output
*Fortran f77 compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FI
-fPIC -fp-model strict -O1 -qopenmp *
*Fortran f90 compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FR
-qopenmp -fPIC -fp-model strict -O1 -qopenmp *
*Fortran fix compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FI
-qopenmp -fPIC -fp-model strict -O1 -qopenmp*
(ifort serial mode)
*f2py -c adt.f90 -m adt_module --fcompiler=intelem*
Output
*Fortran f77 compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FI
-fPIC -fp-model strict -O1 -qopenmp *
*Fortran f90 compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FR
-fPIC -fp-model strict -O1 -qopenmp *
*Fortran fix compiler:
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort -FI
-fPIC -fp-model strict -O1 -qopenmp*
Now, here's the problem, see here compiling is done with -qopenmp flag for
serial mode but I haven't passed it in command line. Why is it happening
when compiling with ifort but not with gfortran ? And how to resolve this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190130/960fed44/attachment.html>
More information about the NumPy-Discussion
mailing list