<div dir="ltr"><div>Hi All,<br><br></div>Seeking some discussion about setting the OpenBLAS affinity. Currently this is set when numeric.py is imported:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
try:<br>    # disables openblas affinity setting of the main thread that limits<br>    # python threads or processes to one core<br>    if 'OPENBLAS_MAIN_FREE' not in os.environ:<br>        os.environ['OPENBLAS_MAIN_FREE'] = '1'<br>
    if 'GOTOBLAS_MAIN_FREE' not in os.environ:<br>        os.environ['GOTOBLAS_MAIN_FREE'] = '1'<br>    from ._dotblas import dot, vdot, inner<br>except ImportError:<br>...<br></blockquote><div><br>
</div><div>Note that the affinity is set whether or not the import of _dotblas fails, which it will if cblas was not found at buildtime. This all seems a bit hinky to me. If we are always going to set the affinity, it should be in the core/__init__.py file. If the setting is moved after the import, it will still happen if, say, ATLAS cblas is present. It seems to me that there should be a better, more transparent way to do this, especially as I'm in the process of moving some of the cblas down into multiarray. One option is to make this part of the multiarray module import, but without a bit of work, that would still depend only on cblas being detected during the build process rather than OpenBLAS. Also, is GotoBLAS still a viable option?<br>
<br></div><div>Thoughts?<br><br></div><div>Chuck<br></div></div>