flame / blis

BLAS-like Library Instantiation Software Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BLIS tree barrier is broken

jeffhammond opened this issue · comments

I have an 80-core AArch64 CPU (Ampere Altra) and think it prudent to use the more scalable tree barrier designed for Xeon Phi on it.

Sadly, this code appears to have rotted.

Compiling obj/thunderx2/frame/thread/bli_thrcomm_openmp.o ('thunderx2' CFLAGS for framework code)
frame/thread/bli_thrcomm_openmp.c: In function ‘bli_thrcomm_init’:
frame/thread/bli_thrcomm_openmp.c:119:8: error: ‘thrcomm_t’ {aka ‘struct thrcomm_s’} has no member named ‘barriers’; did you mean ‘barrier_sense’?
  119 |  comm->barriers = bli_malloc_intl( sizeof( barrier_t* ) * n_threads, &r_val );
      |        ^~~~~~~~
      |        barrier_sense
compilation terminated due to -Wfatal-errors.

You can reproduce by making this change:

--- a/config/thunderx2/bli_family_thunderx2.h
+++ b/config/thunderx2/bli_family_thunderx2.h
@@ -36,6 +36,12 @@
 //#define BLIS_FAMILY_H
 
 
+// -- THREADING PARAMTERS ------------------------------------------------------
+
+#define BLIS_TREE_BARRIER
+#define BLIS_TREE_BARRIER_ARITY        4
+
+

Ah, it seems that BLIS_TREE_BARRIER does not get defined in frame/thread/bli_thrcomm_openmp.h when it is defined in the above config file.

@jeffhammond I'm not sure what you mean by this? I gather there is still a bug? but I'm not sure what

This is a trivial bug where struct members need to be updated to track the usage, when the preprocessor switch is on.

frame/thread/bli_thrcomm_openmp.c:119:8: error: ‘thrcomm_t’ {aka ‘struct thrcomm_s’} has no member named ‘barriers’; did you mean ‘barrier_sense’?
  119 |  comm->barriers = bli_malloc_intl( sizeof( barrier_t* ) * n_threads, &r_val );
      |        ^~~~~~~~
      |        barrier_sense

Whether there is a preprocessor/configuration bug here is TBD.