diff --git a/common.mk b/common.mk index 458cdcc03..683d0b0e9 100644 --- a/common.mk +++ b/common.mk @@ -153,9 +153,9 @@ endif ifeq ($(CC_VENDOR),gcc) ifeq ($(THREADING_MODEL),auto) -THREADING_MODEL := omp +THREADING_MODEL := openmp endif -ifeq ($(THREADING_MODEL),omp) +ifeq ($(THREADING_MODEL),openmp) CTHREADFLAGS := -fopenmp LDFLAGS += -fopenmp endif @@ -167,9 +167,9 @@ endif ifeq ($(CC_VENDOR),icc) ifeq ($(THREADING_MODEL),auto) -THREADING_MODEL := omp +THREADING_MODEL := openmp endif -ifeq ($(THREADING_MODEL),omp) +ifeq ($(THREADING_MODEL),openmp) CTHREADFLAGS := -fopenmp LDFLAGS += -fopenmp endif @@ -183,7 +183,7 @@ ifeq ($(CC_VENDOR),clang) ifeq ($(THREADING_MODEL),auto) THREADING_MODEL := pthreads endif -ifeq ($(THREADING_MODEL),omp) +ifeq ($(THREADING_MODEL),openmp) CTHREADFLAGS := -fopenmp LDFLAGS += -fopenmp endif diff --git a/frame/3/bli_l3_thrinfo.c b/frame/3/bli_l3_thrinfo.c index 78b2b775c..33027a1e8 100644 --- a/frame/3/bli_l3_thrinfo.c +++ b/frame/3/bli_l3_thrinfo.c @@ -422,6 +422,7 @@ exit(1); return paths; } +#endif void bli_l3_thrinfo_free_paths ( @@ -436,5 +437,4 @@ void bli_l3_thrinfo_free_paths bli_free_intl( threads ); } -#endif diff --git a/frame/3/bli_l3_thrinfo.h b/frame/3/bli_l3_thrinfo.h index 71dea7645..fcf1f507d 100644 --- a/frame/3/bli_l3_thrinfo.h +++ b/frame/3/bli_l3_thrinfo.h @@ -121,10 +121,10 @@ thrinfo_t** bli_l3_thrinfo_create_full_paths ( cntx_t* cntx ); +#endif void bli_l3_thrinfo_free_paths ( thrinfo_t** threads ); -#endif diff --git a/frame/3/gemm/bli_gemm_front.c b/frame/3/gemm/bli_gemm_front.c index 324655655..533a6dcaf 100644 --- a/frame/3/gemm/bli_gemm_front.c +++ b/frame/3/gemm/bli_gemm_front.c @@ -88,13 +88,6 @@ void bli_gemm_front // Record the threading for each level within the context. bli_cntx_set_thrloop_from_env( BLIS_GEMM, BLIS_LEFT, cntx ); - // Create the first node in the thrinfo_t tree for each thread. -//thrinfo_t** infos = bli_l3_thrinfo_create_full_paths( cntx ); -//bli_l3_thrinfo_print_paths( infos ); -//exit(1); -//cntl = bli_gemm_cntl_create( BLIS_GEMM ); - //thrinfo_t** infos = bli_l3_thrinfo_create_roots( cntx, cntl ); - // Invoke the internal back-end via the thread handler. bli_l3_thread_decorator ( @@ -107,10 +100,5 @@ void bli_gemm_front cntx, cntl ); -//bli_l3_thrinfo_print_paths( infos ); -//exit(1); - - // Free the thrinfo_t structures. - //bli_l3_thrinfo_free_paths( infos ); } diff --git a/frame/thread/bli_thrcomm_openmp.c b/frame/thread/bli_thrcomm_openmp.c index 68d9d7a29..0882d1659 100644 --- a/frame/thread/bli_thrcomm_openmp.c +++ b/frame/thread/bli_thrcomm_openmp.c @@ -199,6 +199,8 @@ void bli_thrcomm_tree_barrier( barrier_t* barack ) #endif +//#define PRINT_THRINFO + void bli_l3_thread_decorator ( l3int_t func, @@ -217,6 +219,10 @@ void bli_l3_thread_decorator // Allcoate a global communicator for the root thrinfo_t structures. thrcomm_t* gl_comm = bli_thrcomm_create( n_threads ); +#ifdef PRINT_THRINFO + thrinfo_t** threads = bli_malloc_intl( n_threads * sizeof( thrinfo_t* ) ); +#endif + _Pragma( "omp parallel num_threads(n_threads)" ) { dim_t id = omp_get_thread_num(); @@ -245,13 +251,24 @@ void bli_l3_thread_decorator // Free the control tree, if one was created locally. bli_l3_cntl_free_if( a, b, c, cntx, cntl, cntl_use, thread ); +#ifdef PRINT_THRINFO + threads[id] = thread; +#else // Free the current thread's thrinfo_t structure. bli_l3_thrinfo_free( thread ); +#endif } // We shouldn't free the global communicator since it was already freed // by the global communicator's chief thread in bli_l3_thrinfo_free() // (called above). + + +#ifdef PRINT_THRINFO + bli_l3_thrinfo_print_paths( threads ); + bli_l3_thrinfo_free_paths( threads ); + exit(1); +#endif } #endif