Commit 2c12dec3 authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

ENH updated tests Makefile to detect which OpenMP to use #11

parent 2df589e9
# if env variables not set, using GNU compiler as default ######################
################################################################################
# MERIC test applications Makefile #
# reads $CXX, $FC and $MPICXX environment variables #
# if env variables not set, using GNU compiler as default #
# in the second section specify which libraries you use and their paths #
################################################################################
ifeq ($(CXX),)
CXX=g++
......@@ -6,29 +11,33 @@ endif
ifeq ($(FC),)
FC=gfortran
endif
MPICXX=mpicxx
ifeq ($(MPICXX),)
MPICXX=mpicxx
endif
ifeq ($(CXX),g++)
ifeq ($(shell awk '{n=split($$1,A,"/"); print A[n]}' <<< ${CXX}),g++)
OPENMP=-fopenmp
else
OPENMP=-qopenmp
endif
################################################################################
MERIC=-L../lib -I../include
#DAVIDE=-L$(HOME)/rest-client/libs/ -lrestclient-cpp
#HDEEM=-L../hdeem -lhdeem -lfreeipmi
#X86ADAPT=-L/usr/local/lib -lx86_adapt
#CPUFREQ=-L$(HOME)/cpufrequtils-008/ -lcpufreq
#CPUFREQ=-L/usr/lib64/ /lib64/libcpupower.so.0
#CPUFREQ=-L/lib64/ -lcpupower
#PAPI=-lpapi
#PAPI=-L/sw/taurus/libraries/papi/5.5.1/lib/ -lpapi
#PAPI=-L/apps/papi/5.4.3/lib/ -lpapi # PAPI on BSC ARM machines
#RESTCLIENT=-L$(HOME)/rest-client/libs/ -lrestclient-cpp
################################################################################
#if x86_adapt is missing, numa library is required
ifeq ($(X86ADAPT),)
X86ADAPT=-lnuma
endif
MERIC=-L../lib -I../include
LIBS=-lrt $(MERIC) $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(RESTCLIENT)
BINARIES=test test_mpi blasTest samples sleepTest fortTest overHead
################################################################################
......@@ -38,25 +47,25 @@ all: samplesTest mpiTest basicTest sleepTest fortTest overhead blasTestInfo
######
sleepTest: sleep_test.cpp
$(CXX) -O0 -g sleep_test.cpp $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o sleepTest -DUSE_MERIC
$(CXX) -O0 -g sleep_test.cpp -lmeric $(LIBS) -o sleepTest -DUSE_MERIC
mpiTest: test_mpi.cpp
$(MPICXX) -O0 -g test_mpi.cpp $(MERIC) -lmericmpi -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o test_mpi -DUSE_MERIC
$(MPICXX) -O0 -g test_mpi.cpp -lmericmpi $(LIBS) -o test_mpi -DUSE_MERIC
basicTest: test.cpp
$(CXX) -O0 -g test.cpp -o test -DUSE_MERIC $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE)
$(CXX) -O0 -g test.cpp -o test -DUSE_MERIC -lmeric $(LIBS)
scorepTest: test.cpp
scorep --online-access --user --thread=none $(CXX) -O0 -g test.cpp $(MERIC) -lrt -o test -DUSE_SCOREP_MANUAL
overhead: overhead_test.cpp
$(CXX) -g overhead_test.cpp -DUSE_MERIC $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o overHead
$(CXX) -g overhead_test.cpp -DUSE_MERIC -lmeric $(LIBS) -o overHead
samplesTest: samples_test.cpp
$(CXX) -O0 -g samples_test.cpp $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o samples
$(CXX) -O0 -g samples_test.cpp -lmeric $(LIBS) -o samples
blasTest: blas_test.c
$(CXX) -O3 -g blas_test.c $(MERIC) -lmeric -mkl -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o blasTest
$(CXX) -O3 -g blas_test.c -lmeric -mkl $(LIBS) -o blasTest
blasTestInfo:
$(info )
......@@ -64,7 +73,7 @@ blasTestInfo:
$(info )
fortTest:
$(FC) fort_test.f90 -cpp $(MERIC) -lmeric -lrt $(OPENMP) $(HDEEM) $(X86ADAPT) $(CPUFREQ) $(PAPI) $(DAVIDE) -o fortTest -DUSE_MERIC
$(FC) fort_test.f90 -cpp -lmeric $(LIBS) -o fortTest -DUSE_MERIC
######
......@@ -77,10 +86,4 @@ cleanAll:
make clean
rm -rf $(MeasurementDIRS) *.tmp
######
run:
./test
mpirun -n 4 -genv I_MPI_DEBUG=5 ./test_mpi
srun:
srun -N 1 -c 24 --tasks-per-node=1 --exclusive -p haswell --x11 --pty bash
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment