Skip to content

Instantly share code, notes, and snippets.

@erikzenker
Last active May 20, 2016 14:23
Show Gist options
  • Save erikzenker/a6d5dc0d2c3e47d994085564c057927c to your computer and use it in GitHub Desktop.
Save erikzenker/a6d5dc0d2c3e47d994085564c057927c to your computer and use it in GitHub Desktop.
#! /usr/bin/env sh
# Init paths
cd ~
mkdir -p projects
cd projects
# Load modules
module load git
module load intel/2016.2.181
module load cmake/3.3.1
module load boost/1.60.0-intel2016.2.181-intelmpi5.1-knc
module load gcc/4.9.3 # gives hints to icc where to find libstdc++
# Clone matmul
git clone https://github.com/BenjaminW3/matmul.git
cd matmul
git checkout develop
cd ..
# Clone alpaka
git clone https://github.com/ComputationalRadiationPhysics/alpaka.git
cd alpaka
git checkout develop
cd ..
# Load magic environment vars
source /sw/global/compilers/intel/2016/compilers_and_libraries_2016/linux/bin/compilervars.sh intel64
# Export magic shared object path
export SINK_LD_LIBRARY_PATH=/sw/global/compilers/intel/2016/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin_mic/
export CXX=icc
export CC=icc
# Edit matmul/benchmark/CMAKELISTS.txt
# IF(NOT MSVC)
# LIST(APPEND _MATMUL_BENCHMARK_COMPILE_OPTIONS "-std=c99")
#+ LIST(APPEND _MATMUL_BENCHMARK_COMPILE_OPTIONS "-mmic")
# ENDIF()
# Edit matmul/matmulConfig.cmake
#+# MIC HACK
#+LIST(APPEND _MATMUL_COMPILE_OPTIONS_C_PRIVATE "-mmic")
#+LIST(APPEND _MATMUL_COMPILE_OPTIONS_CXX_PRIVATE "-mmic")
#+SET(ICC_MIC_LINK_FLAGS "-mmic")
#+SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ICC_MIC_LINK_FLAGS}" )
# Build Makefile
cd matmul/benchmark
mkdir build
cd build
cmake ..
# set accelerator
ccmake .
# CMAKE_BUILD_TYPE: Release
# Build benchmark
make -j
# Run binary from host
micnativeloadex matmul_benchmark -a "100 7000 100 1"
@erikzenker
Copy link
Author

Output:

# matmul benchmark copyright (c) 2013-2015, Benjamin Worpitz | config:Release; element type:double; index type:int; min n:100; max n:7000; step n:100; repeat count:1; MATMUL_BENCHMARK_COMPUTATION_TIME=OFF; MATMUL_BENCHMARK_PRINT_GFLOPS=ON; MATMUL_BENCHMARK_REPEAT_TAKE_MINIMUM=ON
#GFLOPS
m=n=k   gemm_par_alpaka_cpu_b_omp2_t_seq_tiling
100   0.00697688
200   0.15965035
300   0.63854102
400   2.47976181
500   4.10798698
600   6.79201322
700   8.79701520
800  13.72632565
900  14.66757946
1000     17.02054166
1100     17.59371784
1200     19.75137536
1300     19.08865488
1400     19.89337037
1500     20.44227702
1600     20.85422770
1700     20.95985194
1800     21.39669306
1900     21.20827722
2000     21.66820703
2100     21.30839091
2200     21.63293668
2300     21.59681955
2400     21.97016192
2500     21.58847012
2600     21.92862344
2700     21.75036094
2800     22.09672199
2900     21.70888462
3000     22.07398903
3100     21.74573223
3200     22.29242872
3300     21.70893952
3400     22.12471979
3500     21.84100732
3600     22.20817541
3700     21.76028356
3800     22.18750737
3900     21.81151559
4000     22.24578830
4100     21.74569756
4200     22.15550567
4300     21.86855445
4400     22.24359380
4500     21.75639834
4600     22.19424961
4700     21.82544530
4800     22.24468753
4900     21.75483381
5000     22.18008394
5100     21.80996502
5200     22.24757318
5300     21.77339123
5400     22.20032566
5500     21.79228797
5600     22.24573687
5700     21.74423171
5800     22.20376121
5900     21.78163467
6000     22.20090079
6100     21.73151482
6200     22.16469494
6300     21.78363846
6400     22.26920264
6500     21.73984717
6600     22.17416409
6700     21.78630339
6800     22.18118379
6900     21.70424960
7000     22.17388433
Total runtime:  1133.665232 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment