Recompiling Abinit with multicore support  [SOLVED]

option, parallelism,...

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.
Locked
ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Recompiling Abinit with multicore support  [SOLVED]

Post by ssh77 » Fri Jun 12, 2020 1:10 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Sat Jun 20, 2020 10:18 am

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
------
Jean-Michel Beuken
Computer Scientist

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Thu Jun 25, 2020 3:08 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Fri Jun 26, 2020 6:11 pm

Hi ssh77,

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

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Sat Jun 27, 2020 11:19 am

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.

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Sat Jun 27, 2020 5:14 pm

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

nhankg2016
Posts: 2
Joined: Wed Jul 01, 2020 11:14 am

Re: Recompiling Abinit with multicore support

Post by nhankg2016 » Wed Jul 01, 2020 4:28 pm

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.

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Thu Jul 02, 2020 5:09 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Fri Jul 03, 2020 8:40 pm

Dear ssh77,
ssh77 wrote:
Sat Jun 27, 2020 11:19 am
* C compiler : gnu version 8.3
* Fortran compiler: gnu version 8.3
* architecture : unknown unknown (64 bits)
...
* OpenMP enabled : no (collapse: ignored)
* MPI enabled : no
* MPI-IO enabled : no
* GPU enabled : no (flavor: none)
still no MPI support -> "MPI enable : no " :roll:
which mpif90
if it didn't work , you have no install mpi package
apt search openmpi
then, install it...
------
Jean-Michel Beuken
Computer Scientist

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Sun Jul 05, 2020 6:35 pm

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.

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Sun Jul 05, 2020 6:39 pm

nhankg2016 wrote:
Wed Jul 01, 2020 4:28 pm
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.
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?
will this fundamentally change the configuration of abinit to multicore support or is it just a workaround?

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Wed Jul 08, 2020 7:36 pm

there are a lot of mistakes/typos in this cmd

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"
try this ( now , really tested under Fedora 29 ;) ):

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
If the cmd succeeded, I can try to start some tests

Code: Select all

cd tests
./runtest.py fast -j 8 --no-logo
./runtest.py paral -n 4 -j 2 --no-logo
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
------
Jean-Michel Beuken
Computer Scientist

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Wed Jul 08, 2020 10:23 pm

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!

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: Recompiling Abinit with multicore support

Post by ssh77 » Wed Jul 08, 2020 10:38 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Thu Jul 09, 2020 11:54 am

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/ )
------
Jean-Michel Beuken
Computer Scientist

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Thu Jul 09, 2020 12:03 pm

concerning the parallel tests...
No YAML Error found in [paral][t77_MPI4][np=4]
I also observed that some tests ( 21,22,24,26,41,51,77) crashed, all with the same error... :cry:
this is caused either to the compiler version ( GNU 8.3.1 ) or a problem with OpenMPI 2.1.1 ( old ;) )
[paral][t80_MPI1][np=0]: Skipped.
nprocs: 4 != nprocs_to_test: 1
as we did the tests with n=4, all the tests planned for n=2 are skipped

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Recompiling Abinit with multicore support

Post by jbeuken » Thu Jul 09, 2020 12:51 pm

with OpenMPI 4.0.3 compiled by me with GNU 8.3.1, all tests succeeded :)

Code: Select all

Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
paral        0      11         30       75         0     428.21     435.52
the openmpi package is too old and/or not complete :?
------
Jean-Michel Beuken
Computer Scientist

Locked