Improve the error message for thread creation failure

This commit is contained in:
Martin Kroeker 2024-07-15 18:32:21 +02:00 committed by GitHub
parent 6013b36b16
commit a373d0f107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -595,6 +595,8 @@ int blas_thread_init(void){
struct rlimit rlim; struct rlimit rlim;
const char *msg = strerror(ret); const char *msg = strerror(ret);
fprintf(STDERR, "OpenBLAS blas_thread_init: pthread_create failed for thread %ld of %d: %s\n", i+1,blas_num_threads,msg); fprintf(STDERR, "OpenBLAS blas_thread_init: pthread_create failed for thread %ld of %d: %s\n", i+1,blas_num_threads,msg);
fprintf(STDERR, "OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)\n");
fprintf(STDERR, "OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available\n");
#ifdef RLIMIT_NPROC #ifdef RLIMIT_NPROC
if(0 == getrlimit(RLIMIT_NPROC, &rlim)) { if(0 == getrlimit(RLIMIT_NPROC, &rlim)) {
fprintf(STDERR, "OpenBLAS blas_thread_init: RLIMIT_NPROC " fprintf(STDERR, "OpenBLAS blas_thread_init: RLIMIT_NPROC "