diff --git a/driver/others/memory.c b/driver/others/memory.c index a28edeaa63..70b2c9f17a 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -2765,7 +2765,7 @@ static int memory_overflowed = 0; void *blas_memory_alloc(int procpos){ int i; - + int buffer_fault = 999; int position; #if defined(WHEREAMI) && !defined(USE_OPENMP) int mypos = 0; @@ -3163,7 +3163,8 @@ void *blas_memory_alloc(int procpos){ printf("a sufficiently small number. This error typically occurs when the software that relies on\n"); printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n"); printf("cpu cores than what OpenBLAS was configured to handle.\n"); - return NULL; + BLASFUNC(xerbla)("OpenBLAS",&buffer_fault,8); + return NULL; } void blas_memory_free(void *free_area){ diff --git a/driver/others/xerbla.c b/driver/others/xerbla.c index 8e2110c91d..d28153338a 100644 --- a/driver/others/xerbla.c +++ b/driver/others/xerbla.c @@ -65,7 +65,11 @@ static size_t openblas_xerbla_name_length(const char *message, static void openblas_xerbla_default(const char *message, const blasint *info, size_t length) { int precision = length > INT_MAX ? INT_MAX : (int)length; - + + if (*info == 999) { + printf(" ** OpenBLAS ran out of thread buffers - terminating\n"); + exit(1); + } printf(MSGFMT, precision, message == NULL ? "" : message, (long long)*info); }