abinit / abinit

The official github mirror of the Abinit repository. We welcome bug fixes and improvements. Note that most of the active developments are hosted on our https://gitlab.abinit.org/ server. Before embarking on making significant changes, please contact the Abinit group.

Home Page:https://www.abinit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fftw3 with threads

zerothi opened this issue · comments

I cannot compile abinit with fftw and threads enabled.

The problem seems to be that ./src/66_wfs/m_getghc.F90 is using a function defined in m_fftw3, but there is apparently no use statement, resulting in:

 1700 |  fftw3_use_lib_threads_sav=(.not.fftw3_spawn_threads_here(nthreads,nthreads))
      |                                 1
Error: Function ‘fftw3_spawn_threads_here’ at (1) has no IMPLICIT type
make[3]: *** [Makefile:1220: m_getghc.o] Error 1

Can you check whether HAVE_OPENMP is defined in config.h ?

To activate openmp support in Abinit, one has to configure with e.g:

# Tell Abinit buildsys that we want to activate Openmp (necessary condition but not sufficient)
enable_openmp="yes"    

# Activate OpenMP in Abinit Fortran code IMPORTANT
 enable_openmp="yes" is not enough.
# This for the intel compiler
FCFLAGS="-O2 -g -fopenmp"  

I have been trying to debug this a bit further, and it seems there is some weird combination of my fftw versions... I'll debug further and let you know.

But yes, I had the above in my configure step. (for now I'll assume this is on my box).

I'm seeing the same error in the same file while trying to build Abinit 9.10.3. Here is my config summary:

Core build parameters
---------------------

  * C compiler        : gnu version 12.1
  * Fortran compiler  : gnu version 12.1
  * architecture      :   ( bits)
  * debugging         : basic
  * optimizations     : standard

  * OpenMP enabled    : yes (collapse: yes)
  * MPI    enabled    : yes (flavor: auto)
  * MPI    in-place   : no
  * MPI-IO enabled    : yes
  * GPU    enabled    : no (flavor: none)

  * LibXML2 enabled   : yes
  * LibPSML enabled   : no
  * XMLF90  enabled   : no
  * HDF5 enabled      : yes (MPI support: yes)
  * NetCDF enabled    : yes (MPI support: yes)
  * NetCDF-F enabled  : yes (MPI support: yes)

  * FFT flavor        : fftw3-threads (libs: auto-detected)
  * LINALG flavor     : netlib+openblas (libs: auto-detected)
  * SCALAPACK enabled : no
  * ELPA enabled      : unknown
  * MAGMA enabled     : unknown (magma version >= 1.5 ? )

  * FCFLAGS           : -O3 -mcpu=a64fx -fopenmp  -fallow-argument-mismatch -ffree-line-length-none    -I/lustre/software/netcdf/4.8.1/gcc12.1.0/include 
  * NVCC_CFLAGS       : 
  * CPATH             : /lustre/software/fftw3/gcc12.1/openmpi4.1.4/3.3.10/include:/lustre/software/libxc/gcc12.1/6.2.2/include:/lustre/software/openblas/gcc11/0.3.20/include:/lustre/software/netcdf/4.8.1/gcc12.1.0//include:/lustre/software/hdf5-parallel/openmpi/gcc12.1.0/1.12.1//include:/lustre/software/openmpi/gcc12.1/4.1.4/include:/lustre/software/ucx/1.13.0/include:/lustre/software/gcc/12.1.0/include:/cm/shared/apps/slurm/current/include

  * Build workflow    : monolith

0 deprecated options have been used:.

Configuration complete.

Here is the specific compiler command:

mpif90 -DHAVE_CONFIG_H -I. -I../..  -I../../shared/common/src/10_defs -I../../shared/common/src/10_defs -I../../shared/common/src/12_hide_mpi -I../../shared/common/src/12_hide_mpi -I../../shared/common/src/14_hidewrite -I../../shared/common/src/14_hidewrite -I../../shared/common/src/16_hideleave -I../../shared/common/src/16_hideleave -I../../shared/common/src/17_yaml_out -I../../shared/common/src/17_yaml_out -I../../shared/common/src/18_timing -I../../shared/common/src/18_timing -I../../shared/common/src/28_numeric_noabirule -I../../shared/common/src/28_numeric_noabirule -I../../shared/common/src/32_util -I../../shared/common/src/32_util -I../../shared/libpaw/src -I../../shared/libpaw/src -I../../src/41_geometry -I../../src/41_geometry -I../../src/43_ptgroups -I../../src/43_ptgroups -I../../src/44_abitools -I../../src/44_abitools -I../../src/44_abitypes_defs -I../../src/44_abitypes_defs -I../../src/46_manage_cuda -I../../src/46_manage_cuda -I../../src/51_manage_mpi -I../../src/51_manage_mpi -I../../src/52_fft_mpi_noabirule -I../../src/52_fft_mpi_noabirule -I../../src/53_ffts -I../../src/53_ffts -I../../src/54_spacepar -I../../src/54_spacepar -I../../src/56_recipspace -I../../src/56_recipspace -I../../src/62_cg_noabirule -I../../src/62_cg_noabirule -I../../src/65_paw -I../../src/65_paw -I../../src/66_nonlocal -I../../src/66_nonlocal -I../../src/66_wfs -I../../src/66_wfs -I../../shared/common/src/incs -I../../shared/common/src/incs -I../../shared/common/src/mods -I../../shared/common/src/mods -I../../src/incs -I../../src/incs -I../../src/mods -I../../src/mods -I../../shared/libpaw/incs -I../../shared/libpaw/incs -I../../shared/libpaw/mods -I../../shared/libpaw/mods   -ffree-form -J../mods   -O3 -mcpu=a64fx -fopenmp  -fallow-argument-mismatch -ffree-line-length-none    -I/lustre/software/netcdf/4.8.1/gcc12.1.0/include  -c -o m_getghc.o m_getghc.F90

And the error:

m_getghc.F90:1700:33:

 1700 |  fftw3_use_lib_threads_sav=(.not.fftw3_spawn_threads_here(nthreads,nthreads))
      |                                 1
Error: Function ‘fftw3_spawn_threads_here’ at (1) has no IMPLICIT type
make[3]: *** [Makefile:1230: m_getghc.o] Error 1
make[3]: Leaving directory '/lustre/projects/hpc_support_ookami/abinit-9.10.3/src/66_wfs'
make[2]: *** [Makefile:1247: all-recursive] Error 1
make[2]: Leaving directory '/lustre/projects/hpc_support_ookami/abinit-9.10.3/src'
make[1]: *** [Makefile:1465: all-recursive] Error 1
make[1]: Leaving directory '/lustre/projects/hpc_support_ookami/abinit-9.10.3'
make: *** [Makefile:1390: all] Error 2

Any suggestions on how to solve this?

Thanks!
Dave