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.<br /><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Monday, November 4, 2024 at 12:36:45 AM UTC-8 Krack Matthias wrote:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div lang="en-CH" link="blue" vlink="purple" style="word-wrap:break-word">
<div>
<p class="MsoNormal"><span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"></span></span><span><span style="font-size:11.0pt"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">The latest update of the Darwin arch files
<a href="https://github.com/cp2k/cp2k/blob/master/arch/Darwin-gnu-arm64.psmp#L267-L276" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=en&q=https://github.com/cp2k/cp2k/blob/master/arch/Darwin-gnu-arm64.psmp%23L267-L276&source=gmail&ust=1731482918269000&usg=AOvVaw2b9Tu4d_v4aww6LxeBf_XB">
either links the OpenBLAS library (default) or the Accelerate framework</a> and tries to separate clearly both choices.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<div>
<div>
<div></div></div></div></div></div><div lang="en-CH" link="blue" vlink="purple" style="word-wrap:break-word"><div><div><div><div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">
<b><span style="color:black">From: </span></b><span style="color:black"><a href data-email-masked rel="nofollow">cp...@googlegroups.com</a> <<a href data-email-masked rel="nofollow">cp...@googlegroups.com</a>> on behalf of Rashid Riboul <<a href data-email-masked rel="nofollow">sasta...@gmail.com</a>><br>
<b>Date: </b>Monday, 4 November 2024 at 04:46<br>
<b>To: </b>cp2k <<a href data-email-masked rel="nofollow">cp...@googlegroups.com</a>><br>
<b>Subject: </b>Re: [CP2K:20851] Accelerate Framework vs. OpenBLAS<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">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?</p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">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.</p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">On Sunday, November 3, 2024 at 12:10:34<span style="font-family:"Arial",sans-serif"> </span>PM UTC-8 Krack Matthias wrote:</p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt">Hi</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt">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.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt">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.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt">Best </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt">Matthias</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:11.0pt"> </span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt;margin-left:72.0pt">
<b><span style="color:black">From: </span></b><span style="color:black"><span><a href data-email-masked rel="nofollow">cp...@googlegroups.com</a></span> <<span><a href data-email-masked rel="nofollow">cp...@googlegroups.com</a></span>> on behalf of Rashid Riboul <<span><a href data-email-masked rel="nofollow">sasta...@gmail.com</a></span>><br>
<b>Date: </b>Saturday, 2 November 2024 at 07:34<br>
<b>To: </b>cp2k <<span><a href data-email-masked rel="nofollow">cp...@googlegroups.com</a></span>><br>
<b>Subject: </b>[CP2K:20846] Accelerate Framework vs. OpenBLAS</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
Hi;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
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!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
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?<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:72.0pt">
-- <br>
You received this message because you are subscribed to the Google Groups "cp2k" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to
<span><a href data-email-masked rel="nofollow">cp2k+uns...@googlegroups.com</a></span>.<br>
To view this discussion visit <a href="https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=en&q=https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1731482918269000&usg=AOvVaw0LsA3Z4InZLEDeqnJlLJMK">
https://groups.google.com/d/msgid/cp2k/e9d370dd-eb2b-409d-9d49-eb1625db925bn%40googlegroups.com</a>.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div></div></div></div></div><div lang="en-CH" link="blue" vlink="purple" style="word-wrap:break-word"><div><div><div><div><p class="MsoNormal" style="margin-left:36.0pt">-- <br>
You received this message because you are subscribed to the Google Groups "cp2k" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to
<a href data-email-masked rel="nofollow">cp2k+uns...@googlegroups.com</a>.<br></p></div></div></div></div></div><div lang="en-CH" link="blue" vlink="purple" style="word-wrap:break-word"><div><div><div><div><p class="MsoNormal" style="margin-left:36.0pt">
To view this discussion visit <a href="https://groups.google.com/d/msgid/cp2k/1c9f88e1-34b9-4767-90c0-8a694a03a16bn%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=en&q=https://groups.google.com/d/msgid/cp2k/1c9f88e1-34b9-4767-90c0-8a694a03a16bn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1731482918270000&usg=AOvVaw24c7H_kBgnAeHpqfimKzF5">
https://groups.google.com/d/msgid/cp2k/1c9f88e1-34b9-4767-90c0-8a694a03a16bn%40googlegroups.com</a>.</p>
</div>
</div>
</div>
</div>
</div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "cp2k" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:cp2k+unsubscribe@googlegroups.com">cp2k+unsubscribe@googlegroups.com</a>.<br />
To view this discussion visit <a href="https://groups.google.com/d/msgid/cp2k/3abde0d9-36d8-436d-8872-8ddef51be8b6n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/cp2k/3abde0d9-36d8-436d-8872-8ddef51be8b6n%40googlegroups.com</a>.<br />