Skip to content

Commit b5858c4

Browse files
authored
Merge pull request #3330 from xianyi/issue3321
Improve the "tried to allocate too many buffers" error message
2 parents e6d6d3e + 898212e commit b5858c4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

driver/others/memory.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,12 @@ UNLOCK_COMMAND(&alloc_lock);
12911291
return (void *)(((char *)alloc_info) + sizeof(struct alloc_t));
12921292

12931293
error:
1294-
printf("OpenBLAS : Program will terminate because you tried to allocate too many memory regions.\n");
1294+
printf("OpenBLAS : Program will terminate because you tried to allocate too many TLS memory regions.\n");
1295+
printf("This library was built to support a maximum of %d threads - either rebuild OpenBLAS\n", NUM_BUFFERS);
1296+
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
1297+
printf("a sufficiently small number. This error typically occurs when the software that relies on\n");
1298+
printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n");
1299+
printf("cpu cores than what OpenBLAS was configured to handle.\n");
12951300

12961301
return NULL;
12971302
}
@@ -2878,8 +2883,12 @@ void *blas_memory_alloc(int procpos){
28782883
return (void *)memory[position].addr;
28792884

28802885
error:
2881-
printf("BLAS : Program is Terminated. Because you tried to allocate too many memory regions.\n");
2882-
2886+
printf("OpenBLAS : Program is Terminated. Because you tried to allocate too many memory regions.\n");
2887+
printf("This library was built to support a maximum of %d threads - either rebuild OpenBLAS\n", NUM_BUFFERS);
2888+
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
2889+
printf("a sufficiently small number. This error typically occurs when the software that relies on\n");
2890+
printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n");
2891+
printf("cpu cores than what OpenBLAS was configured to handle.\n");
28832892
return NULL;
28842893
}
28852894

0 commit comments

Comments
 (0)