Skip to content

OpenBLAS hanged when testing multithreaded affinity #2341

Closed
@MacChen02

Description

@MacChen02

OpenBLAS hanged when testing multithreaded affinity.

hang

Enviroment: ARMV8 CentOS 7.6, OpenBLAS-0.3.7
Compile cmd: make TARGET=ARMV8 CC=gcc FC=gfortran DEBUG=1 NO_AFFINITY=0 -j96
Execute cmd: export OMP_NUM_THREADS=32 && ./dgemm.goto 6000 6000

The problem can be reproduced by simulating an abnormal situation. During the region of code manually stopping the process, OpenBLAS-0.3.7/driver/others/init.c
code

First exit abnormally before blas_unlock(&common -> lock) , the value of common->lock is 1. This shared memory already exist,common->lock=1 and common->magic=SH_MAGIC,function blas_lock entering infinite loop in next time, the programme will be hanged.

If the problem happened, it makes openblas unavailable.

I provide a patch file, checking the value of common->lock first.
0001-hang-multithread-affinity.patch.txt

@brada4 @martin-frbg

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