Skip to content

ompstub causes problems with existing OpenMP code #3632

@JonMarbach

Description

@JonMarbach

I'm part of a larger project where we use OpenMP and someone added a dependency to OpenBLAS recently, and I've just noticed that now omp_get_max_threads, omp_get_thread_num, and omp_get_num_threads return unexpected results (1, 0, and 1 respectively), presumably due to ompstub.dll overriding these functions. Our OpenMP code does appear to run with multiple threads despite omp_get_max_threads returning 1 which is a bit confusing if nothing else. (This is on Windows, using dynamic linking; I don't know how the other parts of our team are using OpenBLAS unfortunately.)

I don't see much documented about this ompstub library or why it's needed (other than a few old issues here.) Can someone explain? If it can't be avoided, what are the strategies for working around the inconsistent omp function returns. (And apologies in advance since I don't know anything about OpenBLAS itself.)

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