Recompiling Abinit with multicore support [SOLVED]
Moderators: fgoudreault, mcote
Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Recompiling Abinit with multicore support [SOLVED]
Hi,
I have installed abinit(8.10.3) and it works fine with only 1 processor. Now I would like to install it with quad core support.
My questions are:
1) Can I recompile and reinstall abinit without problems?
2) How do I explicitly configure with MPI support and subsequently support for multiple cores? I thought the mj4 was for the confiuration but it is apparently only for the installation.
3)At the same time, how do I enable the whole list of flavors for DFT, MATH, TRI and so on.
Since I am new with this and the use of 1 core is hopeless for more demanding calculations on a laptop, I would like to have the exact inputs to use and try. I have done trial and error of different commands that I have seen during installation and in different places during compilation but it doesn't work out.
I am guessing that the MPI support is crucial to enable more than one processor but I am not sure.
I would like to enable GPU later but first I would like to be able to run on all 4 cores to see when I reach the limit.
Many thanks!
ssh77
I have installed abinit(8.10.3) and it works fine with only 1 processor. Now I would like to install it with quad core support.
My questions are:
1) Can I recompile and reinstall abinit without problems?
2) How do I explicitly configure with MPI support and subsequently support for multiple cores? I thought the mj4 was for the confiuration but it is apparently only for the installation.
3)At the same time, how do I enable the whole list of flavors for DFT, MATH, TRI and so on.
Since I am new with this and the use of 1 core is hopeless for more demanding calculations on a laptop, I would like to have the exact inputs to use and try. I have done trial and error of different commands that I have seen during installation and in different places during compilation but it doesn't work out.
I am guessing that the MPI support is crucial to enable more than one processor but I am not sure.
I would like to enable GPU later but first I would like to be able to run on all 4 cores to see when I reach the limit.
Many thanks!
ssh77
Re: Recompiling Abinit with multicore support
Hi ssh7,
Can you give me some information?
What is the OS and version of your laptop?
How did you compile ABINIT ( compiler, linalg ) ?
What is the configure command you used ?
thx
jmb
Can you give me some information?
What is the OS and version of your laptop?
How did you compile ABINIT ( compiler, linalg ) ?
What is the configure command you used ?
thx
jmb
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
Hi jmb
My OS is Fedora scientific 29 intel quad core i7 16 GB ram with a geeforce graphics card 6 GB
I downloaded the abinit 8.10.3 and used the .confgure command and tried a bit different ways in order to see if I can activate different functions.
./configure --with-dft-flavor="libxc+wannier90+atompaw+bigdft" --enable-linalg=yes --with-trio-flavor="netcdf" with_mpi="yes"
I am not sure if this way helped anything, but each time I tried --enable-mpi or enable gpu I get an error message.
Would it be OK to recompile Abinit with the same folder without ruining the functionality?
I hope you can give me some step by step information about how to enable the multi core usage.
When I write module spider in the terminal I get:
---------------------------------------------------------------------------------
The following is a list of the modules currently available:
---------------------------------------------------------------------------------
lmod: lmod
Lmod: An Environment Module System
mpi: mpi/openmpi-x86_64
python-sphinx: python-sphinx/python2-sphinx
settarg: settarg
So Mpi/openmpi is available but abinit cannot detect it when I configure with enable mpi. But maybe you know what is the correct way to do this.
If possible I would like to know how to enable the GPU also if the multi core usage is possible to enable.
Thanks!
ssh77
My OS is Fedora scientific 29 intel quad core i7 16 GB ram with a geeforce graphics card 6 GB
I downloaded the abinit 8.10.3 and used the .confgure command and tried a bit different ways in order to see if I can activate different functions.
./configure --with-dft-flavor="libxc+wannier90+atompaw+bigdft" --enable-linalg=yes --with-trio-flavor="netcdf" with_mpi="yes"
I am not sure if this way helped anything, but each time I tried --enable-mpi or enable gpu I get an error message.
Would it be OK to recompile Abinit with the same folder without ruining the functionality?
I hope you can give me some step by step information about how to enable the multi core usage.
When I write module spider in the terminal I get:
---------------------------------------------------------------------------------
The following is a list of the modules currently available:
---------------------------------------------------------------------------------
lmod: lmod
Lmod: An Environment Module System
mpi: mpi/openmpi-x86_64
python-sphinx: python-sphinx/python2-sphinx
settarg: settarg
So Mpi/openmpi is available but abinit cannot detect it when I configure with enable mpi. But maybe you know what is the correct way to do this.
If possible I would like to know how to enable the GPU also if the multi core usage is possible to enable.
Thanks!
ssh77
Re: Recompiling Abinit with multicore support
Hi ssh77,
can you try this :
can you try this :
Code: Select all
yum install netcdf
yum install lapack blas
module load mpi/openmpi-x86_64
./configure --with-dft-flavor="libxc" --enable-linalg=yes --with-trio-flavor="netcdf" with_mpi="yes"
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
Hi,
I tried it and it still does not work.
==============================================================================
=== Final remarks ===
==============================================================================
Summary of important options:
* C compiler : gnu version 8.3
* Fortran compiler: gnu version 8.3
* architecture : unknown unknown (64 bits)
* debugging : basic
* optimizations : standard
* OpenMP enabled : no (collapse: ignored)
* MPI enabled : no
* MPI-IO enabled : no
* GPU enabled : no (flavor: none)
* TRIO flavor = netcdf-fallback
* TIMER flavor = abinit (libs: ignored)
* LINALG flavor = netlib (libs: auto-detected)
* ALGO flavor = none (libs: ignored)
* FFT flavor = none (libs: ignored)
* MATH flavor = none (libs: ignored)
* DFT flavor = libxc-fallback
Configuration complete.
You may now type "make" to build ABINIT.
(or, on a SMP machine, "make mj4", or "make multi multi_nprocs=<n>")
this is what i got.
I tried it and it still does not work.
==============================================================================
=== Final remarks ===
==============================================================================
Summary of important options:
* C compiler : gnu version 8.3
* Fortran compiler: gnu version 8.3
* architecture : unknown unknown (64 bits)
* debugging : basic
* optimizations : standard
* OpenMP enabled : no (collapse: ignored)
* MPI enabled : no
* MPI-IO enabled : no
* GPU enabled : no (flavor: none)
* TRIO flavor = netcdf-fallback
* TIMER flavor = abinit (libs: ignored)
* LINALG flavor = netlib (libs: auto-detected)
* ALGO flavor = none (libs: ignored)
* FFT flavor = none (libs: ignored)
* MATH flavor = none (libs: ignored)
* DFT flavor = libxc-fallback
Configuration complete.
You may now type "make" to build ABINIT.
(or, on a SMP machine, "make mj4", or "make multi multi_nprocs=<n>")
this is what i got.
Re: Recompiling Abinit with multicore support
using make and make install I get errors now, but probably because it was already installed. Now the SCF runs but the out file is not completed afterwards.
Anyway, I will have to remove the abinit folder and reinstall it again with a fresh folder when you find a way to enable MPI multicore support in a way that the software can accept. I hope you are able to solve it.
ssh77
Anyway, I will have to remove the abinit folder and reinstall it again with a fresh folder when you find a way to enable MPI multicore support in a way that the software can accept. I hope you are able to solve it.
ssh77
-
- Posts: 2
- Joined: Wed Jul 01, 2020 11:14 am
Re: Recompiling Abinit with multicore support
After make try it :
export OMP_NUM_THREADS=n
n = number threads
If it doesnt work , using make multi multi_nprocs =n for using “n” processors on a SMP machine where you have to replace “n” by its value)
Good luck.
export OMP_NUM_THREADS=n
n = number threads
If it doesnt work , using make multi multi_nprocs =n for using “n” processors on a SMP machine where you have to replace “n” by its value)
Good luck.
Re: Recompiling Abinit with multicore support
So is there a way to compile abinit with mpi and multicore support on my system? other than the way you suggested since it does not work in my case.
Thanks,
ssh77
Thanks,
ssh77
Re: Recompiling Abinit with multicore support
Dear ssh77,
still no MPI support -> "MPI enable : no "

if it didn't work , you have no install mpi packagewhich mpif90
then, install it...apt search openmpi
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
I have now tried also to check which mpif90 -->and it gives
which mpif90
/usr/bin/which: no mpif90 in (/usr/libexec/python2-sphinx:/home/universe/.local/bin:/home/universe/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin)
Why is there no mpif90 in those folders?? should there be for the MPI to work properly?
I tried to install the mpif90 according to what I found:
dnf whatprovides "*/mpif90"
tells you what package provides this binary. In Fedora, you can get it from openmpi-devel or mpich packages. So running
yum install openmpi-devel
mpif90 is still the same when I check...nothing changed
However, when I try to install openmpi and mpi from dnf or yum it appears as if they are already installed.
So I don't know how to fix the mpif90 and the mpi.
I tried to change the config by adding enable-mpi to the end:
./configure --with-dft-flavor="libxc" --enable-linalg=yes --with-trio-flavor="netcdf" --enable-openmpi="yes" with_openmpi="yes" with_mpi="yes" --enable-mpi="yes"
But then I get this and the configuration stops:
==============================================================================
=== Multicore architecture support ===
==============================================================================
checking whether to enable OpenMP support... no
checking whether to build MPI code... yes
checking whether the C compiler supports MPI... no
checking whether the C++ compiler supports MPI... no
checking whether the Fortran Compiler supports MPI... no
checking whether MPI is usable... no
configure: error: MPI support is broken - please fix your config parameters and/or MPI installation
Do I need to install something more? for fedora it is yum or dnf, apt does not work it seems.
This multi core configuration is tricky, I hope you can figure out what is wrong since anything I try ends up not working at the config stage.
which mpif90
/usr/bin/which: no mpif90 in (/usr/libexec/python2-sphinx:/home/universe/.local/bin:/home/universe/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin)
Why is there no mpif90 in those folders?? should there be for the MPI to work properly?
I tried to install the mpif90 according to what I found:
dnf whatprovides "*/mpif90"
tells you what package provides this binary. In Fedora, you can get it from openmpi-devel or mpich packages. So running
yum install openmpi-devel
mpif90 is still the same when I check...nothing changed
However, when I try to install openmpi and mpi from dnf or yum it appears as if they are already installed.
So I don't know how to fix the mpif90 and the mpi.
I tried to change the config by adding enable-mpi to the end:
./configure --with-dft-flavor="libxc" --enable-linalg=yes --with-trio-flavor="netcdf" --enable-openmpi="yes" with_openmpi="yes" with_mpi="yes" --enable-mpi="yes"
But then I get this and the configuration stops:
==============================================================================
=== Multicore architecture support ===
==============================================================================
checking whether to enable OpenMP support... no
checking whether to build MPI code... yes
checking whether the C compiler supports MPI... no
checking whether the C++ compiler supports MPI... no
checking whether the Fortran Compiler supports MPI... no
checking whether MPI is usable... no
configure: error: MPI support is broken - please fix your config parameters and/or MPI installation
Do I need to install something more? for fedora it is yum or dnf, apt does not work it seems.
This multi core configuration is tricky, I hope you can figure out what is wrong since anything I try ends up not working at the config stage.
Re: Recompiling Abinit with multicore support
I don't understand what you mean, should I just write export OMP_NUM_THREADS=4 for an i7 quad core processor after the make mj4 step, and then finish by writing make install?nhankg2016 wrote: ↑Wed Jul 01, 2020 4:28 pmAfter make try it :
export OMP_NUM_THREADS=n
n = number threads
If it doesnt work , using make multi multi_nprocs =n for using “n” processors on a SMP machine where you have to replace “n” by its value)
Good luck.
will this fundamentally change the configuration of abinit to multicore support or is it just a workaround?
Re: Recompiling Abinit with multicore support
there are a lot of mistakes/typos in this cmd
try this ( now , really tested under Fedora 29
):
If the cmd succeeded, I can try to start some tests
if you need mpi-io feature, you need to compile your own OpenMPI software because the Fedora package OpenMPI does not support mpi-io...
good luck
Code: Select all
./configure --with-dft-flavor="libxc" --enable-linalg=yes --with-trio-flavor="netcdf" --enable-openmpi="yes" with_openmpi="yes" with_mpi="yes" --enable-mpi="yes"

Code: Select all
yum install -y openmpi openmpi-devel
module purge
module load mpi/openmpi-x86_64
./configure \
--with-mpi-prefix="/usr/lib64/openmpi/" \
--enable-mpi="yes" \
--enable-mpi-io="yes" \
--with-linalg-flavor="netlib" \
--with-linalg-libs="-L/usr/lib/ -llapack -lblas" \
--with-dft-flavor="libxc" \
--with-trio-flavor="netcdf"
make -j 8
Code: Select all
cd tests
./runtest.py fast -j 8 --no-logo
./runtest.py paral -n 4 -j 2 --no-logo
good luck
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
It finally seems to work!
great!! Thanks!
Is it better to have 8 core support despite having only 4 CPUs? Is it for the hyperthreading?
Is it difficult to add GPU support from here?
Do you know how the GPU support should be added correctly?
And how is GPU used when running the calculations? Is there a special command added to the input file or files file or is it automatically used when running with mpi?
Thanks!

Is it better to have 8 core support despite having only 4 CPUs? Is it for the hyperthreading?
Is it difficult to add GPU support from here?
Do you know how the GPU support should be added correctly?
And how is GPU used when running the calculations? Is there a special command added to the input file or files file or is it automatically used when running with mpi?
Thanks!
Re: Recompiling Abinit with multicore support
btw.
Is this type of error in the second test you propose something to worry about:
No YAML Error found in [paral][t77_MPI4][np=4]
[paral][t80_MPI1][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 1
[paral][t80_MPI2][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 2
Is this type of error in the second test you propose something to worry about:
No YAML Error found in [paral][t77_MPI4][np=4]
[paral][t80_MPI1][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 1
[paral][t80_MPI2][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 2
Re: Recompiling Abinit with multicore support
Sorry, I didn't know the actual core count of your machine...
so it's better to use -j 4 or -n 4 -j 1 for parallel jobs
concerning the GPU, it's quite complicated to install the tools to use a GPU ( CUDA, MAGMA, kernel driver,... ).
And finally, not to gain in performance...
it's a matter of a specialist ( read : https://docs.abinit.org/README_gpu/ )
so it's better to use -j 4 or -n 4 -j 1 for parallel jobs
concerning the GPU, it's quite complicated to install the tools to use a GPU ( CUDA, MAGMA, kernel driver,... ).
And finally, not to gain in performance...
it's a matter of a specialist ( read : https://docs.abinit.org/README_gpu/ )
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
concerning the parallel tests...
this is caused either to the compiler version ( GNU 8.3.1 ) or a problem with OpenMPI 2.1.1 ( old
)
If I have some time, I can test with a more recent version of OpenMPI that I will have to compile.
I also observed that some tests ( 21,22,24,26,41,51,77) crashed, all with the same error...No YAML Error found in [paral][t77_MPI4][np=4]

this is caused either to the compiler version ( GNU 8.3.1 ) or a problem with OpenMPI 2.1.1 ( old

as we did the tests with n=4, all the tests planned for n=2 are skipped[paral][t80_MPI1][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 1
If I have some time, I can test with a more recent version of OpenMPI that I will have to compile.
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist
Re: Recompiling Abinit with multicore support
with OpenMPI 4.0.3 compiled by me with GNU 8.3.1, all tests succeeded
the openmpi package is too old and/or not complete 

Code: Select all
Suite failed passed succeeded skipped disabled run_etime tot_etime
paral 0 11 30 75 0 428.21 435.52

------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist