Accelerate Framework vs. OpenBLAS

93 views
Skip to first unread message

Rashid Riboul

unread,
Nov 2, 2024, 2:34:14 AM11/2/24
to cp2k
Hi;

So, I installed the program using the default arch files for MacOS install (thanks Krack!) and tested the install and got no errors during regression testing!

I then proceeded to reinstall CP2K to only utilize Apple's Accelerate Framework as the BLAS and LAPACK libraries and while it did compile, I had one failure and 10 wrong values during the regression testing.

I think that I'm probably not implementing the framework properly. I saw in the instructions that " -D__ACCELERATE" must be defined to account for some interface incompatibilities between Accelerate and reference BLAS/LAPACK, but I'm not entirely sure how to do that. The only thing I did do was add "-framework Accelerate" to the LIBS flag at the end of the arch file. Is there something else that needs to be done to define the framework?

Krack Matthias

unread,
Nov 3, 2024, 3:10:34 PM11/3/24
to cp...@googlegroups.com

Hi

 

Your observation matches my experience. While the compilation using the Accelerate framework works, the subsequent regression test run fails. That is why the OpenBLAS library is still used as the default LAPACK/BLAS instead of the Accelerate framework with Darwin. I have updated the macOS arch files to facilitate the switching between OpenBLAS and the Accelerate framework. Maybe further adjustments are needed to get it working properly.

 

To the best of my knowledge, there is, however, no evidence yet that the Accelerate framework will provide any significant performance gain compared to OpenBLAS.

 

Best

 

Matthias

 

--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%40googlegroups.com.

Rashid Riboul

unread,
Nov 3, 2024, 10:46:09 PM11/3/24
to cp2k
Oh, I see. So with the way the Darwin arch files are written now, it seems that it is using both Accelerate AND OpenBLAS together, right?

Also; I understand that there isn't any significant performance gain with Accelerate vs. OpenBLAS, but I wanted to try to use only Accelerate since according to Apple's own literature, usage of it's linear algebra frameworks has better core utilization efficiency and just wanted to use it for both CP2K and eventually GROMACS.

Krack Matthias

unread,
Nov 4, 2024, 3:36:45 AM11/4/24
to cp...@googlegroups.com



The CP2K toolchain uses (always) OpenBLAS in a first step to detect the CPU type. The subsequent full build and linking of the OpenBLAS library during the make step, however, is optional, e.g. MKL or other libs providing LAPACK/BLAS can be used instead.

 

The latest update of the Darwin arch files either links the OpenBLAS library (default) or the Accelerate framework and tries to separate clearly both choices.

 

Rashid Riboul

unread,
Nov 12, 2024, 2:30:35 AM11/12/24
to cp2k
It would be an interesting development hobby; I think it would involve making sure that the differences in commands between OpenBLAS and Accelerate are accounted for.
Reply all
Reply to author
Forward
0 new messages