# Parallel fallbacks Netcdf

**URL:** <https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445>\
**Category:** Ground state\
**Created:** [November 16, 2023, 5:07pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445 "2023-11-16T17:07:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 16, 2023, 5:07pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/1 "2023-11-16T17:07:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 22, 2023, 11:24am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/2 "2023-11-22T11:24:59Z")

</div>

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 :

```auto
cd /etc
ln -s python3 python

apt install python3-dev

```

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

```auto
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

```auto
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

```auto
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

```auto
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

```

```auto
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`

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 23, 2023, 9:06am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/3 "2023-11-23T09:06:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 23, 2023, 3:01pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/4 "2023-11-23T15:01:03Z")

</div>

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 :

```auto
make clean
../configure --with-config-file='my_config.ac9'
make -j 12
cd tests
../../tests/runtests.py fast libxc -j 12 --no-logo

```

```auto
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 :**

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

```

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 24, 2023, 12:00pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/5 "2023-11-24T12:00:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 24, 2023, 4:12pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/6 "2023-11-24T16:12:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 24, 2023, 4:42pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/7 "2023-11-24T16:42:09Z")

</div>

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 :

```auto
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

```

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 25, 2023, 8:10pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/8 "2023-11-25T20:10:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 25, 2023, 8:20pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/9 "2023-11-25T20:20:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 27, 2023, 5:40pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/10 "2023-11-27T17:40:59Z")

</div>

Can you sent me the config.log ?

jmb

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 27, 2023, 9:17pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/11 "2023-11-27T21:17:59Z")

</div>

please find attached my config.log.  
Many many thanks,  
samir  
[config.log](https://discourse.abinit.org/uploads/short-url/4vmhq9B9zp4nqpzZh5EAprT0LS9.log) (209.1 KB)

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [November 30, 2023, 6:04pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/12 "2023-11-30T18:04:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [November 30, 2023, 10:32pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/13 "2023-11-30T22:32:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [December 1, 2023, 9:59am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/14 "2023-12-01T09:59:14Z")

</div>

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 )

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [December 1, 2023, 2:16pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/15 "2023-12-01T14:16:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [March 10, 2024, 11:36am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/16 "2024-03-10T11:36:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [March 10, 2024, 11:52am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/17 "2024-03-10T11:52:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [March 11, 2024, 12:46pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/18 "2024-03-11T12:46:48Z")

</div>

> [@](#):
>
> I installed libxc from : apt install libxc-dev

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”

---

<div class="post-metadata">

**Author:** ![samabdel](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@samabdel](https://discourse.abinit.org/u/samabdel)\
**Post date:** [March 17, 2024, 10:20am UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/19 "2024-03-17T10:20:28Z")

</div>

Is CFLAGS\_LIBC the same for the gfortran wrapper (mpif90)?

---

<div class="post-metadata">

**Author:** ![beuken](https://discourse.abinit.org/user_avatar/discourse.abinit.org/beuken/32/93_2.png) [@beuken](https://discourse.abinit.org/u/beuken)\
**Post date:** [March 18, 2024, 2:11pm UTC](https://discourse.abinit.org/t/parallel-fallbacks-netcdf/3445/20 "2024-03-18T14:11:32Z")

</div>

> [@samabdel](#):
>
> CFLAGS\_LIBXC

no need to use CFLAGS\_LIBXC with gfortran

jmb
