CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Issue with linking OpenBLAS with SU2

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pcg

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2021, 06:27
Default Issue with linking OpenBLAS with SU2
  #1
New Member
 
Pappu Visala Sushma
Join Date: Dec 2021
Posts: 5
Rep Power: 4
sushma_pappu is on a distinguished road
Hi

I am trying to build SU2 using GCC with OpenBLAS. I activated BLAS and LAPACK calls using: -DHAVE_BLAS and -DHAVE_LAPACK
My configure line is : ./meson.py /home/sushma/su2/SU2-7.2.0/install_su2 -Dcustom-mpi=true -Dwith-mpi=enabled --prefix=/home/sushma/su2/SU2-7.2.0/install_su2 -Denable-tests=true -Denable-openblas=true -Dblas-name=openblas -DCPPFLAGS="-DHAVE_LAPACK -DHAVE_BLAS" -Dwith-omp=true
I added the following line to 181 of meson.build file :
blas_dep = declare_dependency(link_args: ['-L/home/sushma/install/netlib_3.9.0_gcc831/lib','-lblas','-llapack'])


I tried profiling the INC_Turbulent example(https://su2code.github.io/tutorials/...lent_NACA0012/) .
I am attaching the data of timings between SU2 without libraries and SU with OpenBLAS


The data shows OpenBLAS is not much of a help. Does this mean there is a problem with linking of openBLAS. Am I missing something here? Please let me know the approach
Attached Files
File Type: xlsx OpenBLAS+SU2 GCC.xlsx (17.0 KB, 2 views)
sushma_pappu is offline   Reply With Quote

Old   December 13, 2021, 08:00
Default
  #2
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13
pcg is on a distinguished road
Hi, the relevant linear algebra options that speed up the solver are:
-Denable-mixedprec=true, and to a lesser extend -Denable-mkl=true (if you have it).
See https://su2code.github.io/docs_v7/Bu...lgebra-options
In addition, if you are using GCC I recommend the following optimization flags:
CXXFLAGS="-march=native -funroll-loops -ffast-math -fno-finite-math-only"
and use --optimization=2 in meson.py
ugurtan666 likes this.
pcg is offline   Reply With Quote

Old   December 14, 2021, 01:20
Default
  #3
New Member
 
Pappu Visala Sushma
Join Date: Dec 2021
Posts: 5
Rep Power: 4
sushma_pappu is on a distinguished road
Hi,

Thanks for replying. But my objective is to ensure that OpenBLAS is getting linked properly with GCC build of SU2.
For that I used " -Denable-openblas=true -Dblas-name=openblas " options.
In the benchmarks I carried out, I am unable to see any OpenBLAS APIs in profiling report.

As an alternative, I tried building SU2 with MKL. Here, I can see MKL calls in the profiling report when built with "-Denable-mkl=true" options .

I am concerned if OpenBLAS routines are used at runtime. I need only OpenBLAS support to build with GCC . Could you guide me the steps to link OpenBLAS ?
sushma_pappu is offline   Reply With Quote

Old   December 14, 2021, 14:24
Default
  #4
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13
pcg is on a distinguished road
The problem you are running does not use BLAS routines.
If you used the open-blas options, and the linker gave you an executable, then you have OpenBLAS.
pcg is offline   Reply With Quote

Old   December 15, 2021, 00:45
Default
  #5
New Member
 
Pappu Visala Sushma
Join Date: Dec 2021
Posts: 5
Rep Power: 4
sushma_pappu is on a distinguished road
Hi,

The problem (INC_Turbulent: https://su2code.github.io/tutorials/...lent_NACA0012/) that I profiled reflects BLAS calls when built with MKL.
But profiling the same problem shows no BLAS related calls when built with OpenBLAS and GCC.

I also tried this example: https://github.com/su2code/SU2/tree/...rans/AhmedBody for which BLAS calls of MKL can be seen while for GCC and OpenBLAS the calls are not getting reflected.

I would like to know if there is any other way to confirm the OpenBLAS linking.

Also can you suggest any other example to try out?
sushma_pappu is offline   Reply With Quote

Old   December 31, 2021, 07:54
Default
  #6
New Member
 
Pappu Visala Sushma
Join Date: Dec 2021
Posts: 5
Rep Power: 4
sushma_pappu is on a distinguished road
Hi

For OpenBLAS I have tried to set the PKG_CONFIG_PATH to pkg-config folder for SU2 to find *.pc files .
Also, as an alternative modified meson.build file for it to pick the BLAS library properly.
But both these options are not reflecting blas/lapack calls in profiling of example.
Is not properly setting the PKG_CONFIG_PATH variable be the cause of BLAS calls not being reflected in profiling?

May I know how do I set the variable for OpenBLAS setting? Can you please help me ? Any help is appreciated
sushma_pappu is offline   Reply With Quote

Old   December 31, 2021, 11:29
Default
  #7
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13
pcg is on a distinguished road
MKL is used in places where OpenBLAS is not, because it has features that make that possible, whereas OpenBLAS does not...
The finite volume solvers in SU2 do not use OpenBLAS, but they use MKL.
The high order FEM solvers do use OpenBLAS, see TestCases/hom_euler or hom_navierstokes
pcg is offline   Reply With Quote

Old   January 3, 2022, 07:58
Default
  #8
New Member
 
Pappu Visala Sushma
Join Date: Dec 2021
Posts: 5
Rep Power: 4
sushma_pappu is on a distinguished road
Thank you for the reply.
For higher order FEM solvers, OpenBLAS is getting used.

Could you please elaborate which features are not available in OpenBLAS required for FV (finite volume) solvers?
sushma_pappu is offline   Reply With Quote

Old   January 3, 2022, 12:55
Default
  #9
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13
pcg is on a distinguished road
Just-in-time GEMM kernels:
https://www.intel.com/content/www/us...-jit-code.html
pcg is offline   Reply With Quote

Reply

Tags
library linking issue, linking issues, openblas, su2 7.2.0


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic FSI with SU2 Compressible Solver and SU2 FEM Solver Diverges when restarted sangeet SU2 7 August 3, 2022 01:54
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 18:28
Issues with CGNS formatted mesh in SU2 jlwhelan28 SU2 5 February 13, 2017 11:48
Incorrect calculation of forces/moments coefficients with older versions of SU2 diwakaranant SU2 2 August 16, 2013 04:17
SU2 suite has moved to GitHub! fpalacios SU2 News & Announcements 0 August 12, 2013 02:07


All times are GMT -4. The time now is 06:56.