blis icon indicating copy to clipboard operation
blis copied to clipboard

BLIS tree barrier is broken

Open jeffhammond opened this issue 3 years ago • 3 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
+
+

jeffhammond avatar Jan 17 '22 12:01 jeffhammond

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 avatar Jan 17 '22 12:01 jeffhammond

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

devinamatthews avatar Jan 25 '22 21:01 devinamatthews

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.

jeffhammond avatar Jan 28 '22 12:01 jeffhammond