Skip to content

BLAS+LAPACK thread safety #24

@DaveOri

Description

@DaveOri

It happens to me once per year and every time I have to dig into it and find the very same problem:
"When I use pamtra in passive simulations and parallel mode the performances are quite horrible".

The issue is caused by the installation on the system of a BLAS version which is not thread-safe. In my case (Ubuntu 16.04) it is the libopenblas-base. This is a high-performance implementation that enables multithreading. If this version of BLAS is used at runtime the parallel jobs compete for resources (each one of them wants to exploit multi-threading) and the performances go down with the number of parallel jobs.

DIAGNOSIS:

  • pamtra+passive+parallel very slow
  • top command shows some jobs taking more than 100% cpu usage and others much less

QUICK SOLUTION:

  • uninstall libopenblas-base

CAVEATS:

  • Uninstalling libopenblas-base might be too much and does not prevent the reappearing of the problem. libopenblas can come back silently every time it is needed as a dependency of another package. In my case, it was due to the installation of a basic julia environment

ACTIONS TO CONSIDER:

  • Is it possible to use compiler flags such that pamtra is statically linked to libblas3 instead of having it calling dynamically the current blas library? like this we might solve the problem and users will be able to have openblas installed for other purposes
  • Should we put some indications of the problem in the documentation? I know it affected other users in the past

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions