[petsc-users] using intel mkl for optimized blas/lapack on amd nodes
Junchao Zhang
junchao.zhang at gmail.com
Mon Jun 29 08:56:19 CDT 2026
Hi Chris,
At the end, the "fakeintel" approach we took was to add a macro,
PetscOverrideIntelMKLCPUVendorDetection(),
which users can put before their main() C/C++ function. See
https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/include/petscsys.h*L3006__;Iw!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4B1Ej0v9$ . With
that, users don't need to build libfakeintel.so.
You don't need to test it. But if you like, you can try the example in
that MR
https://urldefense.us/v3/__https://gitlab.com/-/project/13882401/uploads/f35f00db154093600c8f3871ea61f187/ex00.c__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4MWdhJLo$
on your AMD system to see if fakeintel matters.
Thanks,
--Junchao Zhang
On Mon, Jun 29, 2026 at 5:04 AM Klaij, Christiaan <C.Klaij at marin.nl> wrote:
>
> Hi Junchao,
>
> Sorry for the delay but I was out-of-office and won't be able to
> test this anytime soon.
>
> Can you explain me globally what your MR and test do?
>
> As it seems to have been approved and merged, do you still need
> me to test it?
>
> Chris
>
> ________________________________________
> From: Junchao Zhang <junchao.zhang at gmail.com>
> Sent: Monday, June 8, 2026 7:12 PM
> To: Klaij, Christiaan
> Cc: Pierre Jolivet; Richard Tran Mills; PETSc users list
> Subject: Re: [petsc-users] using intel mkl for optimized blas/lapack on
> amd nodes
>
> Hi, Chris,
> Could you check out this MR
> https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/9327__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4B0GOel3$ and test the
> attached ex00.c in your environment to see if it makes a difference?
>
> On my machine, it helps a little, as the MKL version alway optimizes for
> Zen.
>
> Thanks!
> --Junchao Zhang
>
>
> On Fri, Jun 5, 2026 at 2:07 AM Klaij, Christiaan <C.Klaij at marin.nl<mailto:
> C.Klaij at marin.nl>> wrote:
> If the users are supposed to know this and act on it, perhaps an entry in
> the FAQs to raise awareness? With instruction how to check if the user's
> computing center automatically applies the trick.
>
> Chris
>
> ________________________________________
> [cid:ii_19ea811df407f100a2e1]
>
> dr. ir. Christiaan Klaij | senior researcher
> Research & Development | CFD Development
> T +31 317 49 33 44<tel:+31%20317%2049%2033%2044> |
> https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4J9A4SyK$ <https://urldefense.us/v3/__https://www.marin.nl/__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4JBXxvVv$ >
> [Facebook]<https://urldefense.us/v3/__https://www.facebook.com/marin.wageningen__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4Kgz9gSc$ >
> [LinkedIn]<https://urldefense.us/v3/__https://www.linkedin.com/company/marin__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4AVf7R_W$ >
> [YouTube]<https://urldefense.us/v3/__https://www.youtube.com/marinmultimedia__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4HJRYcAP$ >
>
> From: Pierre Jolivet <pierre at joliv.et<mailto:pierre at joliv.et>>
> Sent: Thursday, June 4, 2026 5:03 PM
> To: Junchao Zhang
> Cc: Richard Tran Mills; PETSc users list; Klaij, Christiaan
> Subject: Re: [petsc-users] using intel mkl for optimized blas/lapack on
> amd nodes
>
> You don't often get email from pierre at joliv.et<mailto:pierre at joliv.et>.
> Learn why this is important<https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4InOL3dk$ >
> The libfakeintel.so<https://urldefense.us/v3/__http://libfakeintel.so__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4B2lGGNq$ > trick is as old as I can
> remember and it is available in all computing centers I’m using.
> But it’s the duty of the users to preload it (again, on computing centers
> I have access to, module load’ing the MKL on AMD nodes automatically sets
> LD_PRELOAD).
>
> Thanks,
> Pierre
>
> On 4 Jun 2026, at 4:52 PM, Junchao Zhang <junchao.zhang at gmail.com<mailto:
> junchao.zhang at gmail.com>> wrote:
>
> Richard, do you want to trick Intel?
>
> --Junchao Zhang
>
>
> On Thu, Jun 4, 2026 at 2:29 AM Klaij, Christiaan via petsc-users <
> petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov><mailto:
> petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>>> wrote:
> I came across this issue:
>
> https://urldefense.us/v3/__https://danieldk.eu/software/misc/intel-mkl-on-amd-zen__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4GxrTcyJ$ <
> https://urldefense.us/v3/__https://danieldk.eu/software/misc/intel-mkl-on-amd-zen__;!!G_uCfscf7eWS!fsSSG7b4cHz_fsk3H-3DI4kIopw4fIp1MW93aPTq10vZnZKOx1t7cEg2g4MbGyxZXr15OMM0jg0UU0q2p5ktYkQ$
> >
>
> We do configure petsc with the intel mkl for optimized
> blas/lapack using --with-blas-lapack-dir=${MKL_DIR}.
>
> How much would this issue affect the performance of petsc on amd
> nodes? Do you have the proposed workaround in place?
>
> Chris
> <image455803.png>
>
> dr. ir. Christiaan Klaij | senior researcher
> Research & Development | CFD Development
> T +31 317 49 33 44<tel:+31%20317%2049%2033%2044> | https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4J9A4SyK$ <
> https://urldefense.us/v3/__http://www.marin.nl__;!!G_uCfscf7eWS!YmVvKqXz5Ir7LoquZcGcxLVD96XeLp1ix0_XOR9_hNMMsFbg2pcvKlxh1MULNTeNMu8uxkIu8pXkO1mJbY5Z4J9A4SyK$ ><
> https://urldefense.us/v3/__https://www.marin.nl/__;!!G_uCfscf7eWS!fsSSG7b4cHz_fsk3H-3DI4kIopw4fIp1MW93aPTq10vZnZKOx1t7cEg2g4MbGyxZXr15OMM0jg0UU0q2Ae8qhHs$
> >
> <image705130.png><
> https://urldefense.us/v3/__https://www.facebook.com/marin.wageningen__;!!G_uCfscf7eWS!fsSSG7b4cHz_fsk3H-3DI4kIopw4fIp1MW93aPTq10vZnZKOx1t7cEg2g4MbGyxZXr15OMM0jg0UU0q2P24LxDM$
> >
> <image115249.png><
> https://urldefense.us/v3/__https://www.linkedin.com/company/marin__;!!G_uCfscf7eWS!fsSSG7b4cHz_fsk3H-3DI4kIopw4fIp1MW93aPTq10vZnZKOx1t7cEg2g4MbGyxZXr15OMM0jg0UU0q2D0cffrY$
> >
> <image770232.png><
> https://urldefense.us/v3/__https://www.youtube.com/marinmultimedia__;!!G_uCfscf7eWS!fsSSG7b4cHz_fsk3H-3DI4kIopw4fIp1MW93aPTq10vZnZKOx1t7cEg2g4MbGyxZXr15OMM0jg0UU0q2xfPbYxc$
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260629/b4dd66c9/attachment-0001.html>
More information about the petsc-users
mailing list