<div dir="ltr"><div>Thanks, yes, I figured out the OMP_NUM_THREADS=1 way while triaging it, and the --download-fblaslapack way occurred to me. <br></div><div><br></div><div>I was hoping for something that "just worked" (refuse to build in this case) but I don't know if it's programmatically possible for petsc to tell whether or not it's linking to a threaded BLAS?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 7, 2022 at 4:35 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you don't specify a blas to use - petsc configure will guess and use what it can find.<br>
<br>
So only way to force it use a particular blas is to specify one [one way is --download-fblaslapack]<br>
<br>
Wrt multi-thread openblas -  you can force it run single threaded [by one of these 2 env variables]<br>
<br>
    # Use single thread openblas<br>
    export OPENBLAS_NUM_THREADS=1<br>
    export OMP_NUM_THREADS=1<br>
<br>
Satish<br>
<br>
<br>
On Wed, 7 Dec 2022, Mark Lohry wrote:<br>
<br>
> I ran into an unexpected issue -- on an NP-core machine, each MPI rank of<br>
> my application was launching NP threads, such that when running with<br>
> multiple ranks the machine was quickly oversubscribed and performance<br>
> tanked.<br>
> <br>
> The root cause of this was petsc linking against the system-provided<br>
> library (libopenblas0-pthread in this case) set by the update-alternatives<br>
> in ubuntu. At some point this machine got updated to using the threaded<br>
> blas implementation instead of serial; not sure how, and I wouldn't have<br>
> noticed if I weren't running interactively.<br>
> <br>
> Is there any mechanism in petsc or its build system to prevent linking<br>
> against an inappropriate BLAS, or do I need to be diligent about manually<br>
> setting the BLAS library in the configuration stage?<br>
> <br>
> Thanks,<br>
> Mark<br>
> <br>
<br>
</blockquote></div>