[CP2K-user] [CP2K:20852] Accelerate Framework vs. OpenBLAS
Krack Matthias
matthias.krack at psi.ch
Mon Nov 4 08:36:30 UTC 2024
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<https://github.com/cp2k/cp2k/blob/master/arch/Darwin-gnu-arm64.psmp#L267-L276> and tries to separate clearly both choices.
From: cp2k at googlegroups.com <cp2k at googlegroups.com> on behalf of Rashid Riboul <sastargetx at gmail.com>
Date: Monday, 4 November 2024 at 04:46
To: cp2k <cp2k at googlegroups.com>
Subject: Re: [CP2K:20851] Accelerate Framework vs. OpenBLAS
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.
On Sunday, November 3, 2024 at 12:10:34 PM UTC-8 Krack Matthias wrote:
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
From: cp... at googlegroups.com <cp... at googlegroups.com> on behalf of Rashid Riboul <sasta... at gmail.com>
Date: Saturday, 2 November 2024 at 07:34
To: cp2k <cp... at googlegroups.com>
Subject: [CP2K:20846] Accelerate Framework vs. OpenBLAS
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?
--
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... at googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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+unsubscribe at googlegroups.com<mailto:cp2k+unsubscribe at googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/1c9f88e1-34b9-4767-90c0-8a694a03a16bn%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/1c9f88e1-34b9-4767-90c0-8a694a03a16bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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+unsubscribe at googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/ZRAP278MB0827FC347F57FEF777B2F4DCF4512%40ZRAP278MB0827.CHEP278.PROD.OUTLOOK.COM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20241104/a65e002f/attachment-0001.htm>
More information about the CP2K-user
mailing list