Skip to content
Snippets Groups Projects

Added test that benchmarks the interaction functions against their vectorised counterparts.

Merged James Willis requested to merge benchmark_interactions into master

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I am getting some compilation errors:

    ./configure
    make
    make check

    leads to

    mpicc -DHAVE_CONFIG_H -I. -I..    -I../src -I/usr/include/hdf5/openmpi -I/usr/include -DTIMER -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -funroll-loops -march=haswell -mavx2  -Wall -Wextra -Wno-unused-parameter -Werror -MT benchmarkInteractions.o -MD -MP -MF .deps/benchmarkInteractions.Tpo -c -o benchmarkInteractions.o benchmarkInteractions.c
    benchmarkInteractions.c: In function ‘make_particles’:
    benchmarkInteractions.c:98:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       for (size_t i = 1; i < count; ++i) {
                            ^
    benchmarkInteractions.c: In function ‘prepare_force’:
    benchmarkInteractions.c:124:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       for (size_t i = 0; i < count; ++i) {
                            ^
    benchmarkInteractions.c: In function ‘test_interactions’:
    benchmarkInteractions.c:268:28: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
           for (size_t i = 0; i < count; i++)
                                ^
    benchmarkInteractions.c:285:0: error: ignoring #pragma novector  [-Werror=unknown-pragmas]
     #pragma novector
     ^
    benchmarkInteractions.c:299:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       for (size_t i = 0; i < count; i++)
                            ^
    benchmarkInteractions.c:342:28: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
           for (size_t i = 0; i < count; i++)
                                ^
    benchmarkInteractions.c:411:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       for (size_t i = 0; i < count; i++)
                            ^
    benchmarkInteractions.c:249:9: error: variable ‘miq’ set but not used [-Werror=unused-but-set-variable]
       float miq[count] __attribute__((aligned(array_align)));
             ^
    benchmarkInteractions.c:242:9: error: variable ‘hjq’ set but not used [-Werror=unused-but-set-variable]
       float hjq[count] __attribute__((aligned(array_align)));
             ^
    benchmarkInteractions.c:235:33: error: variable ‘pi_list_vec’ set but not used [-Werror=unused-but-set-variable]
       struct part pj_serial[count], pi_list_vec[count], pj_vec[count];
                                     ^
    cc1: all warnings being treated as errors
    Makefile:917: recipe for target 'benchmarkInteractions.o' failed
  • Also, as such, the test won't be run when doing make check, just compiled. Is this expected ?

  • Added 1 commit:

    • 005ee8aa - Make git ignore the compiled test.
  • Yeah, it was just for benchmarking interactions. It also checks the accuracy between serial and vector so it could be included in make check if you want? I didn't try it with GCC, which version are you using?

  • 5.4 on my laptop. Similar things happen with 4.8 on cosma-[abcf]

  • James Willis Added 2 commits:

    Added 2 commits:

    • 345b6aa5 - Fixed GCC warnings for signed and unsigned integer comparison.
    • 0605989b - Merge branch 'benchmark_interactions' of gitlab.cosma.dur.ac.uk:swift/swiftsim i…
  • Okay, I've fixed the signed/unsigned errors. I don't what to do about the #pragma novector issue though. It is not supported in GCC and if I remove it the serial loop gets auto-vectorised breaking the benchmark.

  • Is there an equivalent pragma in GCC ?

  • Basically, we need this to run:

    module purge
    module load swift
    module load swift/c5/gcc/intelmpi/5.1.3
    module load utils
    
    ./autogen.sh
    
    echo
    echo "non-MPI build"
    echo "-------------"
    ./configure --disable-optimization
    make
    make check
    make clean
    
    echo
    echo "MPI build"
    echo "---------"
    ./configure --with-metis --disable-optimization
    make
    make check
    make clean
    
    echo
    echo "No vectorisation"
    echo "----------------"
    ./configure --disable-vec
    make
    make check
    make clean
    
    echo
    echo "Basic Vectorisation"
    echo "-------------------"
    ./configure
    make
    make check
    make clean
    
    echo
    echo "MPI/FFTW build"
    echo "--------------"
    module load fftw/3.3.4
    ./configure --with-metis --disable-optimization
    make
    make check
    make clean
    
    echo
    echo "Parallel HDF5 build"
    echo "-------------------"
    module purge
    module load swift
    module load swift/c5/gcc/platform_mpi/9.1.0
    module load utils
    module unload hdf5
    module load parallel_hdf5
    ./configure --with-metis --disable-optimization
    make
    make check
    make clean
    
    echo
    echo "Testing dist target"
    echo "-------------------"
    make dist
    make distclean
    
    #  Try building it.
    module purge
    module load swift
    module load swift/c5/gcc/intelmpi/5.1.3
    module load utils
    
    mkdir build
    cd build
    tar zxvf ../*.tar.gz
    cd swift-*
    ./configure --with-metis --disable-optimization
    make
    make check
    make clean
    cd ../../
    git clean -fdx
    
    # Check that the debugging routines compile
    ./autogen.sh
    ./configure --with-metis --disable-vec --disable-optimization --enable-debugging-checks
    make
    make clean
    
    # Check that the task-debugging output compiles
    ./configure --with-metis --disable-vec --disable-optimization --enable-task-debugging
    make
    make clean
    
    #  Add simple checks of hydro schemes.
    
    # GIZMO
    ./configure --with-metis --disable-vec --disable-optimization --with-hydro=gizmo --with-riemann-solver=exact
    make
    make clean
    
    # MINIMAL
    ./configure --with-metis --disable-vec --disable-optimization --with-hydro=minimal
    make
    make clean
    
    # DEFAULT
    ./configure --with-metis --disable-vec --disable-optimization --with-hydro=default
    make
    make clean
    
    # PRESSURE
    ./configure --with-metis --disable-vec --disable-optimization --with-hydro=hopkins
    make
    make clean
    
    # External gravity.
    
    # Pointmass.
    ./configure --with-metis --disable-vec --disable-optimization --with-ext-potential=point-mass
    make
    make clean
    
    # Disc patch.
    ./configure --with-metis --disable-vec --disable-optimization --with-ext-potential=disc-patch
    make
    make clean
    
    # Isothermal.
    ./configure --with-metis --disable-vec --disable-optimization --with-ext-potential=isothermal
    make
    make clean
    
    # Cooling functions.
    
    # Const du
    ./configure --with-metis --disable-vec --disable-optimization --with-cooling=const-du
    make
    make clean
    
    # Const lambda
    ./configure --with-metis --disable-vec --disable-optimization --with-cooling=const-lambda
    make
    make clean
    
    # More when ready.
  • Or maybe we can just not compile this when using GCC.

  • James Willis Added 1 commit:

    Added 1 commit:

    • 5fe848cb - Only use #pragma novector if compiling with ICC.
  • That should be okay to merge now

  • Thanks. Have you tested the whole script above ?

  • No, not yet. I'll run that next

  • That seems to have worked

  • Matthieu Schaller Status changed to merged

    Status changed to merged

  • mentioned in commit e66c2328

Please register or sign in to reply
Loading