HW2: A local only version of the distbitonic
This commit is contained in:
+56
-57
@@ -20,12 +20,17 @@
|
||||
# ============== Project settings ==============
|
||||
# Project's name
|
||||
PROJECT := PDS_homework_2
|
||||
|
||||
# Excecutable's name
|
||||
TARGET := distbitonic
|
||||
TARGET := bitonic
|
||||
|
||||
# Source directories list(space seperated). Makefile-relative path, UNDER current directory.
|
||||
SRC_DIR_LIST := src
|
||||
SRC_DIR_LIST := src test test/gtest
|
||||
|
||||
# Include directories list(space seperated). Makefile-relative path.
|
||||
INC_DIR_LIST := include \
|
||||
test \
|
||||
test/gtest/ \
|
||||
/usr/lib/x86_64-linux-gnu/openmpi/include/ \
|
||||
src
|
||||
|
||||
@@ -148,6 +153,14 @@ $(BUILD_DIR)/$(TARGET): $(OBJ)
|
||||
@$(CSIZE) $(@D)/$(TARGET)
|
||||
@echo Done
|
||||
|
||||
|
||||
#
|
||||
# ================ Default local build rules =================
|
||||
# example:
|
||||
# make debug
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo Cleaning build directories
|
||||
@@ -155,67 +168,53 @@ clean:
|
||||
@rm -rf $(DEP_DIR)
|
||||
@rm -rf $(BUILD_DIR)
|
||||
|
||||
#
|
||||
# ================ Local build rules =================
|
||||
# example:
|
||||
# make debug
|
||||
|
||||
debug: CFLAGS := $(DEB_CFLAGS)
|
||||
debug: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
release: CFLAGS := $(REL_CFLAGS)
|
||||
release: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
all: release
|
||||
|
||||
hpc-results/post:
|
||||
$(CXX) $(CFLAGS) -o $@ hpc-results/main.cpp
|
||||
|
||||
hpc-clean:
|
||||
rm hpc-results/post
|
||||
|
||||
#
|
||||
# ================ Local (and/or) via docker build rules =================
|
||||
#
|
||||
# examples:
|
||||
# make IMAGE=hpcimage v0
|
||||
# make IMAGE=hpcimage v1_cilk
|
||||
#
|
||||
dist_v05: CC := mpicc
|
||||
dist_v05: CXX := mpic++
|
||||
dist_v05: CFLAGS := $(DEB_CFLAGS) -DCODE_VERSION=50
|
||||
dist_v05: CXXFLAGS := $(DEB_CXXFLAGS) -DCODE_VERSION=50
|
||||
dist_v05: TARGET := dist_v05
|
||||
dist_v05: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
dist_v1: CC := mpicc
|
||||
dist_v1: CXX := mpic++
|
||||
dist_v1: CFLAGS := $(DEB_CFLAGS) -DCODE_VERSION=100
|
||||
dist_v1: CXXFLAGS := $(DEB_CXXFLAGS) -DCODE_VERSION=100
|
||||
dist_v1: TARGET := dist_v1
|
||||
dist_v1: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
#
|
||||
# ========= Inside CSAL Image build rules ===========
|
||||
#
|
||||
# 1) first jump into image (make sure you are in the directory where Makefile is):
|
||||
# > docker run -it -v ${PWD}:/usr/src/exercise_1 -w /usr/src/exercise_1/ hpcimage
|
||||
# 2) Clean binaries first **important**
|
||||
# > make clean
|
||||
# 3) for v4 cilk for example:
|
||||
# > make csal_v4_cilk
|
||||
# 4) run executables from `bin/`. Examples:
|
||||
# > ./bin/tcount_ompv3 -i mtx/NACA0015.mtx --timing -r 3 -o /dev/null
|
||||
# > ./bin/tcount_pthv4 -i mtx/com_Youtube.mtx --timing --dynamic --print_count
|
||||
|
||||
|
||||
|
||||
#
|
||||
# ======== Run from container =========
|
||||
#
|
||||
# examples:
|
||||
#
|
||||
# make IMAGE=hpcimage EXEC=knnsearch_v1 run
|
||||
# make IMAGE=hpcimage EXEC=knnsearch_v1 run
|
||||
# ================ Build rules =================
|
||||
#
|
||||
|
||||
# Local or inside HPC rules
|
||||
distbubbletonic: CC := mpicc
|
||||
distbubbletonic: CXX := mpic++
|
||||
distbubbletonic: CFLAGS := $(REL_CFLAGS) -DCODE_VERSION=BUBBLETONIC
|
||||
distbubbletonic: CXXFLAGS := $(REL_CXXFLAGS) -DCODE_VERSION=BUBBLETONIC
|
||||
distbubbletonic: TARGET := distbubbletonic
|
||||
distbubbletonic: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
distbitonic: CC := mpicc
|
||||
distbitonic: CXX := mpic++
|
||||
distbitonic: CFLAGS := $(REL_CFLAGS) -DCODE_VERSION=BITONIC
|
||||
distbitonic: CXXFLAGS := $(REL_CXXFLAGS) -DCODE_VERSION=BITONIC
|
||||
distbitonic: TARGET := distbitonic
|
||||
distbitonic: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
deb_distbubbletonic: CC := mpicc
|
||||
deb_distbubbletonic: CXX := mpic++
|
||||
deb_distbubbletonic: CFLAGS := $(DEB_CFLAGS) -DCODE_VERSION=BUBBLETONIC -DDEBUG
|
||||
deb_distbubbletonic: CXXFLAGS := $(DEB_CXXFLAGS) -DCODE_VERSION=BUBBLETONIC -DDEBUG
|
||||
deb_distbubbletonic: TARGET := deb_distbubbletonic
|
||||
deb_distbubbletonic: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
deb_distbitonic: CC := mpicc
|
||||
deb_distbitonic: CXX := mpic++
|
||||
deb_distbitonic: CFLAGS := $(DEB_CFLAGS) -DCODE_VERSION=BITONIC -DDEBUG
|
||||
deb_distbitonic: CXXFLAGS := $(DEB_CXXFLAGS) -DCODE_VERSION=BITONIC -DDEBUG
|
||||
deb_distbitonic: TARGET := deb_distbitonic
|
||||
deb_distbitonic: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
tests: CFLAGS := $(DEB_CFLAGS) -DCODE_VERSION=BITONIC -DDEBUG -DTESTING
|
||||
tests: CXXFLAGS := $(DEB_CXXFLAGS) -DCODE_VERSION=BITONIC -DDEBUG -DTESTING
|
||||
tests: TARGET := tests
|
||||
tests: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
|
||||
all: debug distbubbletonic distbitonic
|
||||
# Note:
|
||||
# Add a gcc based make rule here in order for clangd to successfully scan the project files.
|
||||
# Otherwise we do not need the gcc build.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user