JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

Problems with the scalar build #37

Closed martin-ueding closed 7 years ago

martin-ueding commented 7 years ago

It seems impossible to build the scalar version right now. In the configure.ac, there is the following for the --enable-proc option:

case ${proc} in
AVX|avx) 
    AC_DEFINE([QPHIX_AVX_SOURCE],[1], [ Generate AVX Specializations ])
    AC_DEFINE([QPHIX_LLC_CACHE_ALIGN], [64], [ L2 Cache alignment ] )

    AC_MSG_NOTICE([Configuring AVX Specializations ])
    if test $SOALEN -gt 8;
    then 
      AC_MSG_ERROR([Cannot have SOALEN more than 8 for AVX]);
    fi                  
;;
# ...
*)
    AC_MSG_NOTICE([Not generating any code specializations])
    ;;
esac

In the scalar build I get errors that `QPHIX_LLC_CACHE_ALIGN` is not defined. Since we are generating kernels for the scalar build, it seems to be wanted to have this building properly. To what value to I have to set `QPHIX_LLC_CACHE_ALIGN` for the scalar build? Just `1`? Or also `64`?
martin-ueding commented 7 years ago

Ouch, this is just wrong documentation. So configure --help gives you this:

  --enable-proc=proc      Build code specializations for proc.
                          proc=NONE,SSE,AVX,AVX2,AVX512,MIC

But actually one has to supply SCALAR in order to get a scalar build. NONE will fail the build.

martin-ueding commented 7 years ago

That is fixed, now there are problems with the SoA length. I configure with this:

/home/travis/build/martin-ueding/sources/qphix/configure --prefix=/home/travis/build/martin-ueding/local --disable-shared --enable-static CC=/usr/lib/ccache/gcc-6 CXX=/usr/lib/ccache/g++-6 --disable-testing --enable-proc=SCALAR --enable-soalen=1 --enable-clover --enable-twisted-mass --enable-tm-clover --enable-openmp --enable-mm-malloc --enable-parallel-arch=scalar --with-qdp=/home/travis/build/martin-ueding/local 'CFLAGS=-O2 -finline-limit=50000 -fmax-errors=1  -fopenmp -Drestrict=__restrict__ ' 'CXXFLAGS=-O2 -finline-limit=50000 -fmax-errors=1  -fopenmp --std=c++11 -Drestrict=__restrict__ '

Somewhere it says that SoA length is 1:

configure: Building for SOALEN=1

But then in t_twm_dslash, I get the following output:

VECLEN = 1, SOALEN = 4

To no further surprise, it fails:

Error: Geometry constructor: SOALEN=4 does not divide V=1

Strangely enough, the tests t_clov_dslash and t_dslash succeeded.

kostrzewa commented 7 years ago

I would guess that something was not properly regenerated / copied.

martin-ueding commented 7 years ago

For whatever reason, most test programs contain the following:

#ifndef QPHIX_SOALEN
#define QPHIX_SOALEN 4
#endif

Something like this should not be in there, this option is set via the config.h, if it had been included properly. Somehow it worked out for the previous two tests, the twisted mass test did not contain it. So the twisted mass test would only work on architectures where soalen = 4 was reasonable. Compiling with other SoA length options did not change anything in that particular test. I have replaced all those things with straight #error directives because that's what it really is.

But that was not really the main problem. Furthermore the test driver just called this:

    tests.addTest(new testTWMDslashFull(By_user, Bz_user, NCores_user, Sy_user, Sz_user, PadXY_user, PadXYZ_user, MinCt_user, compress12, prec_user, 4), "testDslashFull_S4" );

That magic number 4 is the SoA length that has been by the person testing that code. The Wilson clover variant contains some #ifdef for the various ISAs. I have now replaced that 4 with QPHIX_SOALEN. Now it works.

kostrzewa commented 7 years ago

For whatever reason, most test programs contain the following: [...]

Okay, I see. We do the same in our in our interface, I will also replace this with an error.