Skip to content

RFE: Change warning to mention OMP_NUM_THREADS when compiled with USE_OPENMP=1? #5638

@sitsofe

Description

@sitsofe

OpenBLAS is often compiled NUM_THREADS=128 (e.g. this is what PyTorch does on aarch64). When run on machines with more than 128 cores the following warning is displayed:

OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
To avoid this warning, please rebuild your copy of OpenBLAS with a larger NUM_THREADS setting
or set the environment variable OPENBLAS_NUM_THREADS to 128 or lower

(warning is printed by

fprintf(stderr,"or set the environment variable OPENBLAS_NUM_THREADS to %d or lower\n", MAX_CPU_NUMBER);
)

Unfortunately there are some souls who end up in a mess because they fail to read the OpenBLAS README warning about how OPENBLAS_NUM_THREADS is ignored when OpenBLAS has been compiled with USE_OPENMP=1:

If you compile this library with USE_OPENMP=1, you should set the OMP_NUM_THREADS environment variable; OpenBLAS ignores OPENBLAS_NUM_THREADS and GOTO_NUM_THREADS when compiled with USE_OPENMP=1.

Something that may help such lost souls is if the warning message changed the variable name mentioned depending on the USE_OPENMP define...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions