Parallel fallbacks Netcdf

after upgrade of my ubuntu I had to recompile abinit with the new gcc.
The compilation went well…but when I started running abinit I’ve got an error message:
— !ERROR
src_file: m_nctk.F90
src_line: 2788
mpi_rank: 0
message: |
nf90_def_var - NetCDF library returned: NetCDF: Name contains illegal characters
the hdf5 and Netcdf I am using are those of the fallbacks.
I thought the problem comes from the parallelization of theses libraries…but the summary of the configuration says that hdf5 and Netcdf are both parallel.

I don’t know your Ubuntu version
but here is a recipe with a fresh Ubuntu 23.10 with abinit 9.10.3 built with Ubuntu fallbacks !

Checks if python exists :

which python

if not but python3 exists then :

cd /etc
ln -s python3 python

apt install python3-dev

Packages to be installed ( gcc (Ubuntu 13.2.0-4ubuntu3) )

apt install gfortran

apt install openmpi-common openmpi-bin 

apt install libhdf5-openmpi-fortran-102 libhdf5-openmpi-dev
apt install libnetcdf-dev libnetcdff-dev
apt install libnetcdf-mpi-dev
apt install libpnetcdf-dev libnetcdf-pnetcdf-dev

Linalg : OpenBLAS

export OPENBLAS_NUM_THREADS=1
export GOTO_NUM_THREADS=1
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1

apt install libopenblas-dev

LibXC

caution : The LibXC package does not provide the 3rd derivatives of energy!
You should recompile it using --enable-kxc configure option.
Otherwise Abinit will not be able to provide nonlinear response properties (Raman intensities, ...).

apt install libxc-dev

Need for parallel NetCDF

export CPPFLAGS_EXTRA="-I/usr/lib/x86_64-linux-gnu/netcdf/pnetcdf/include"

Building abinit

wget https://www.abinit.org/sites/default/files/packages/abinit-9.10.3.tar.gz
cd abinit-9.10.3 && mkdir -p build && cd build
../configure
Core build parameters
---------------------
  * C compiler        : gnu version 13.2
  * Fortran compiler  : gnu version 13.2
  * architecture      : intel xeon (64 bits)
  * debugging         : basic
  * optimizations     : standard

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

  * HDF5 enabled      : yes (MPI support: yes)
  * NetCDF enabled    : yes (MPI support: yes)
  * NetCDF-F enabled  : yes (MPI support: yes)

  * FFT flavor        : goedecker (libs: auto-detected)
  * LINALG flavor     : netlib+openblas (libs: auto-detected)
  * SCALAPACK enabled : no

  * FCFLAGS           : -g -ffree-line-length-none -fallow-argument-mismatch

Compilation

make -j 12

Testsuite

../../runtests.py fast -j 12 --no-logo

Thanks a lot for your help.
Concerning the libxc, I am using the one from the fallbacks (version 6.0.0)…do I have to recompile it as well with --enable-kxc or it’s already compiled with that option.
Many many thanks,
Samir

Let’s assume that you have already compiled abinit-9.10.3 in the build/ folder.

cd build/fallbacks

A priori, you should find the following files:

INSTALL
Makefile
README
abinit-fallbacks-9.8
build-abinit-fallbacks.sh
install_fb

you need to edit the file build-abinit-fallbacks.sh
and add after the line: "–disable-libpsml --disable-xmlf90 "

--disable_hdf5 --disable-netcdf4 --disable-netcdf4_fortran \

( this compiles only the libXC fallback )

then run the command :

./build-abinit-fallbacks.sh

when libXC compilation is complete, the script displays a line like ( corrects the beginning of path! ):

with_libxc=/root/WorkSpace/abinit-9.10.3/build/fallbacks/install_fb/gnu/13.2/libxc/6.0.0

go to the build dir :

cd ..

copy this line to a file : my_config.ac9

and restart the full compilation :

make clean
../configure --with-config-file='my_config.ac9'
make -j 12
cd tests
../../tests/runtests.py fast libxc -j 12 --no-logo
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
fast         0       2          9        0         0      86.75      87.77
libxc        0      14         22        0         0     847.71     850.54

PS : in the configure output, you must see :

checking whether the LibXC library works... yes
checking whether the LibXC was compiled with Kxc derivatives... yes

I checked that LibXC was compiled with Kxc and I thought every thing will run smoothly!!!
Unfortunately, and as you see in the configuration summary below, I followed the steps you recommended one by one, I am still having the problem of parallelization for hdf5, NETCDF and NETCDF-Fortran:

  • C compiler : gnu version 13.2
    • Fortran compiler : gnu version 13.2

    • architecture : intel core_i7 (64 bits)

    • debugging : basic

    • optimizations : standard

    • OpenMP enabled : no (collapse: ignored)

    • 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: no)

    • NetCDF enabled : yes (MPI support: no)

    • NetCDF-F enabled : yes (MPI support: no)

    • FFT flavor : fftw3-threads (libs: auto-detected)

    • LINALG flavor : none (libs: ignored)

    • SCALAPACK enabled : no

    • ELPA enabled : no

    • MAGMA enabled : unknown (magma version >= 1.5 ? )

    • FCFLAGS : -g -ffree-line-length-none -fallow-argument-mismatch -fno-frontend-optimize -O2 -g -Wall -Wno-maybe-uninitialized -fbacktrace -pedantic -fcheck=all -I/usr/lib/x86_64-linux-gnu/netcdf/pnetcdf/include -I/usr/lib/x86_64-linux-gnu/include

    • NVCC_CFLAGS :

    • CPATH :

    • Build workflow : monolith

Did you see my remark in the first post :

Need for parallel NetCDF

export CPPFLAGS_EXTRA="-I/usr/lib/x86_64-linux-gnu/netcdf/pnetcdf/include"

copy/paste this line in shell

and restart configure

I noticed a small difference in the MPI :
in my config :
MPI enabled : yes (flavor: none)

in your config
MPI enabled : yes (flavor: auto)

can you execute this command :
dpkg -l | egrep "openmpi|hdf5|netcdf"

the result for my env :

ii  hdf5-helpers                         1.10.8+repack1-1ubuntu1
ii  libcaf-openmpi-3:amd64               2.10.1-1               
ii  libcoarrays-openmpi-dev:amd64        2.10.1-1               
ii  libhdf5-103-1:amd64                  1.10.8+repack1-1ubuntu1
ii  libhdf5-cpp-103-1:amd64              1.10.8+repack1-1ubuntu1
ii  libhdf5-dev                          1.10.8+repack1-1ubuntu1
ii  libhdf5-fortran-102:amd64            1.10.8+repack1-1ubuntu1
ii  libhdf5-hl-100:amd64                 1.10.8+repack1-1ubuntu1
ii  libhdf5-hl-cpp-100:amd64             1.10.8+repack1-1ubuntu1
ii  libhdf5-hl-fortran-100:amd64         1.10.8+repack1-1ubuntu1
ii  libhdf5-mpi-dev                      1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-103-1:amd64          1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-cpp-103-1:amd64      1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-dev                  1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-fortran-102:amd64    1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-hl-100:amd64         1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-hl-cpp-100:amd64     1.10.8+repack1-1ubuntu1
ii  libhdf5-openmpi-hl-fortran-100:amd64 1.10.8+repack1-1ubuntu1
ii  libnetcdf-dev                        1:4.9.2-2ubuntu1       
ii  libnetcdf-mpi-19:amd64               1:4.9.0-1ubuntu1       
ii  libnetcdf-mpi-dev:amd64              1:4.9.0-1ubuntu1       
ii  libnetcdf-pnetcdf-19:amd64           1:4.9.0-1ubuntu1       
ii  libnetcdf-pnetcdf-dev:amd64          1:4.9.0-1ubuntu1       
ii  libnetcdf19:amd64                    1:4.9.2-2ubuntu1       
ii  libnetcdff-dev                       4.6.0+really4.5.4+ds-3 
ii  libnetcdff7:amd64                    4.6.0+really4.5.4+ds-3 
ii  libopenmpi-dev:amd64                 4.1.5-3ubuntu1         
ii  libopenmpi3:amd64                    4.1.5-3ubuntu1         
ii  libpnetcdf-dev:amd64                 1.12.3-2               
ii  libpnetcdf0d:amd64                   1.12.3-2               
ii  openmpi-bin                          4.1.5-3ubuntu1         
ii  openmpi-common                       4.1.5-3ubuntu1

for the parallel NetCDF environment variable CPPFLAGS_EXTRA exported it again but still the same problem…
the command line dpkg -l | egrep "openmpi|hdf5|netcdf" gives:
ii hdf5-helpers 1.10.8+repack1-1ubuntu1 amd64 HDF5 - Helper tools
ii libcaf-openmpi-3:amd64 2.10.1-1 amd64 Co-Array Fortran libraries (OpenMPI)
ii libcoarrays-openmpi-dev:amd64 2.10.1-1 amd64 Co-Array Fortran libraries - development files (OpenMPI)
ii libhdf5-103-1:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 C runtime files - serial version
ii libhdf5-cpp-103-1:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 - C++ runtime files - serial version
ii libhdf5-dev 1.10.8+repack1-1ubuntu1 amd64 HDF5 - development files - serial version
ii libhdf5-fortran-102:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 Fortran runtime files - serial version
ii libhdf5-hl-100:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 High Level runtime files - serial version
ii libhdf5-hl-cpp-100:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 High Level C++ runtime files - serial version
ii libhdf5-hl-fortran-100:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 High Level Fortran runtime files - serial version
ii libhdf5-mpi-dev 1.10.8+repack1-1ubuntu1 amd64 HDF5 - development files - default MPI version
ii libhdf5-openmpi-103-1:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 - C runtime files - OpenMPI version
ii libhdf5-openmpi-cpp-103-1:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 - C++ runtime files - OpenMPI version - unsupported
ii libhdf5-openmpi-dev 1.10.8+repack1-1ubuntu1 amd64 HDF5 - development files - OpenMPI version
ii libhdf5-openmpi-fortran-102:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 Fortran runtime files - OpenMPI version
ii libhdf5-openmpi-hl-100:amd64 1.10.8+repack1-1ubuntu1 amd64 HDF5 High Level runtime files - OpenMPI version
ii libnetcdf-dev 1:4.9.2-2ubuntu1 amd64 creation, access, and sharing of scientific data
ii libnetcdf-mpi-19:amd64 1:4.9.0-1ubuntu1 amd64 Interface for scientific data access to large binary data
ii libnetcdf-mpi-dev:amd64 1:4.9.0-1ubuntu1 amd64 creation, access, and sharing of array-oriented scientific data
ii libnetcdf-pnetcdf-19:amd64 1:4.9.0-1ubuntu1 amd64 Interface for scientific data access to large binary data
ii libnetcdf-pnetcdf-dev:amd64 1:4.9.0-1ubuntu1 amd64 creation, access, and sharing of array-oriented scientific data
ii libnetcdf19:amd64 1:4.9.2-2ubuntu1 amd64 Interface for scientific data access to large binary data
ii libnetcdff-dev 4.6.0+really4.5.4+ds-3 amd64 creation, access, and sharing of scientific data in Fortran
ii libnetcdff7:amd64 4.6.0+really4.5.4+ds-3 amd64 Fortran interface for scientific data access to large binary data
ii libopenmpi-dev:amd64 4.1.5-3ubuntu1 amd64 high performance message passing library – header files
ii libopenmpi3:amd64 4.1.5-3ubuntu1 amd64 high performance message passing library – shared library
ii libpnetcdf-dev:amd64 1.12.3-2 amd64 Development files for the parallel netCDF library
ii libpnetcdf0d:amd64 1.12.3-2 amd64 Libraryfor reading and writing parallel NetCDF files
ii openmpi-bin 4.1.5-3ubuntu1 amd64 high performance message passing library – binaries
ii openmpi-common 4.1.5-3ubuntu1 all high performance message passing library – common files

the auto for my openmpi configuration may come from the fact that I am configuring with --with-mpi : …/configure --with-mpi --with-config-file=‘my_config.ac9’
Otherwise abinit cannot find my mpi and it stops with:
configure: error: invalid MPI settings

Can you sent me the config.log ?

jmb

please find attached my config.log.
Many many thanks,
samir
config.log (209.1 KB)

At the beginning of the config.log :

PATH: /home/samir/anaconda3/condabin

Ha! you use anaconda3: Right?
If some libraries are installed under the OS and also under Conda, it can cause some problems…

Give me some time to test under conda…

jmb

I am not sure that I’ve got your point!!!
Yes I used anaconda for some time but as far as I know the only think that is common between anaconda and abinit is python…and there is no a special setting for python in anaconda…so I don’t see how can this affect the setting/libraries needed for abinit?
many many thanks,
Samir

Perhaps I wasn’t precise: is conda activated when you run ./configure?

I once had a configuration in which the OS packages were installed ( e.g. :apt install hdf5 ) AND the packages installed in conda ( conda install hdf5 ) : the ./configure found the OS libs while make found the libs installed by conda…
my config only installs OS packages ( no conda installed )

Now I understand…
No, Conda is not activated when I configure abinit.
Samir

I finally successfully installed abinit-9.10.5 with parallel hdf5 and netcdf.
But I still have:
WARNING: unrecognized options: --enable-kxc
Or should we compile this version (9.10.5) without this option?
Many thanks

1 Like

I installed libxc from : apt install libxc-dev
then I make: …/configure --enable-kxc
but in the config.log I get:
checking whether the LibXC library works
result: yes
checking whether the LibXC was compiled with Kxc derivatives
result: no

the libxc-dev library in ubuntu 23 has not been compiled with the kxc option!

libxc 6.x.y must be compiled from source with the option: --enable-kxc

with intel compilers, add :

CFLAGS_LIBXC=“${CFLAGS_LIBXC} -traceback -Wall -O0 -fp-model=precise”

Is CFLAGS_LIBC the same for the gfortran wrapper (mpif90)?

no need to use CFLAGS_LIBXC with gfortran

jmb