Skip to content

Commit

Permalink
working benchmarg, but bugged pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
fmontoto committed Sep 15, 2016
1 parent 914340b commit 1b24ddb
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 575 deletions.
74 changes: 37 additions & 37 deletions benchmark/document_retrieval/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include ../Make.helper
CXX_FLAGS = $(MY_CXX_FLAGS) $(MY_CXX_OPT_FLAGS) -I$(INC_DIR) -L$(LIB_DIR)
CXX_FLAGS = $(MY_CXX_FLAGS) $(MY_CXX_OPT_FLAGS) -I$(INC_DIR) -L$(LIB_DIR)
LIBS = -lsdsl -ldivsufsort -ldivsufsort64
SRC_DIR = src
TMP_DIR = ../tmp
Expand Down Expand Up @@ -83,52 +83,52 @@ timing: input indexes pattern $(TIME_FILES) $(TIME_FILES_INT) compression info

# results/[TC_ID].[IDX_ID].[PAT_LEN].byte
results/%.byte: $(BUILD_EXECS) $(QUERY_EXECS) $(INDEXES) $(PATTERNS)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval PAT_LEN:=$(call dim,3,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval PAT_LEN:=$(call dim,3,$*))
$(eval TC_NAME:=$(call config_select,test_case.config,$(TC_ID),3))
@echo "# TC_ID = $(TC_ID)" > $@
@echo "# IDX_ID = $(IDX_ID)" >> $@
@echo "# test_case = $(TC_NAME)" >> $@
@echo "Run timing for $(IDX_ID) on $(TC_ID) with patterns of length $(PAT_LEN)"
@$(BIN_DIR)/query_idx_$(IDX_ID) indexes/$(TC_ID).$(IDX_ID).byte \
$(PAT_DIR)/$(TC_ID).$(PAT_LEN).pattern >> $@
$(PAT_DIR)/$(TC_ID).$(PAT_LEN).pattern >> $@

# results/[TC_ID].[IDX_ID].[PAT_LEN].byte
results/%.int: $(BUILD_EXECS) $(QUERY_EXECS_INT) $(INDEXES_INT) $(PATTERNS_INT)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval PAT_LEN:=$(call dim,3,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval PAT_LEN:=$(call dim,3,$*))
$(eval TC_NAME:=$(call config_select,test_case_int.config,$(TC_ID),3))
@echo "# TC_ID = $(TC_ID)" > $@
@echo "# IDX_ID = $(IDX_ID)" >> $@
@echo "# test_case = $(TC_NAME)" >> $@
@echo "Run timing for $(IDX_ID) on $(TC_ID) with patterns of length $(PAT_LEN)"
@$(BIN_DIR)/query_int_idx_$(IDX_ID) indexes/$(TC_ID).$(IDX_ID).int \
$(PAT_DIR)/$(TC_ID).$(PAT_LEN).pattern.int >> $@
$(PAT_DIR)/$(TC_ID).$(PAT_LEN).pattern.int >> $@



# indexes/[TC_ID].[IDX_ID].byte
indexes/%.byte: $(BUILD_EXECS)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case.config,$(TC_ID),2))
@echo "Building index $(IDX_ID) on $(TC)"
@$(BIN_DIR)/build_idx_$(IDX_ID) $(TC) $(TMP_DIR) $@

# indexes/[TC_ID].[IDX_ID].int
indexes/%.int: $(BUILD_EXECS_INT)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case_int.config,$(TC_ID),2))
@echo "Building index $(IDX_ID) on $(TC)"
@$(BIN_DIR)/build_int_idx_$(IDX_ID) $(TC) $(TMP_DIR) $@

# info/[TC_ID].[IDX_ID]
info/%.size: $(INDEXES)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case.config,$(TC_ID),2))
$(eval SIZE:=$(call file_size,$(TC)))
@echo "# TC_ID = $(TC_ID)" > $@
Expand All @@ -139,8 +139,8 @@ info/%.size: $(INDEXES)

# info/[TC_ID].[IDX_ID]
info/%.size.int: $(INDEXES_INT)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case_int.config,$(TC_ID),2))
$(eval SIZE:=$(call file_size,$(TC)))
@echo "# TC_ID = $(TC_ID)" > $@
Expand All @@ -151,8 +151,8 @@ info/%.size.int: $(INDEXES_INT)

# info/[TC_ID].[IDX_ID]
info/%.byte.html: $(INDEXES)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case.config,$(TC_ID),2))
$(eval SIZE:=$(call file_size,$(TC)))
@echo "# TC_ID = $(TC_ID)" > $@
Expand All @@ -163,8 +163,8 @@ info/%.byte.html: $(INDEXES)

# info/[TC_ID].[IDX_ID]
info/%.int.html: $(INDEXES)
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval IDX_ID:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case_int.config,$(TC_ID),2))
$(eval SIZE:=$(call file_size,$(TC)))
@echo "# TC_ID = $(TC_ID)" > $@
Expand All @@ -178,18 +178,18 @@ info/%.int.html: $(INDEXES)
# $(PAT_DIR)/[TC_ID].[PAT_LEN].pattern.int
$(PAT_DIR)/%.pattern.int: $(BIN_DIR)/gen_pattern_int $(BIN_DIR)/word_pat2char_pat
@echo $*
$(eval TC_ID:=$(call dim,1,$*))
$(eval PAT_LEN:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval PAT_LEN:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case_int.config,$(TC_ID),2))
$(BIN_DIR)/gen_pattern_int $(TC) $(TMP_DIR)/$(TC_ID).pat.csa $(TMP_DIR) $(PAT_LEN) 200 $@
$(eval DIC_PATH:=$(call config_select,dic.config,$(TC_ID),2))
$(BIN_DIR)/word_pat2char_pat $@ $(DIC_PATH) > $@.txt

# $(PAT_DIR)/[TC_ID].[PAT_LEN].pattern
# $(PAT_DIR)/[TC_ID].[PAT_LEN].pattern
$(PAT_DIR)/%.pattern: $(BIN_DIR)/gen_pattern
@echo $*
$(eval TC_ID:=$(call dim,1,$*))
$(eval PAT_LEN:=$(call dim,2,$*))
$(eval TC_ID:=$(call dim,1,$*))
$(eval PAT_LEN:=$(call dim,2,$*))
$(eval TC:=$(call config_select,test_case.config,$(TC_ID),2))
$(BIN_DIR)/gen_pattern $(TC) $(TMP_DIR)/$(TC_ID).pat.csa $(TMP_DIR) $(PAT_LEN) 200 $@

Expand All @@ -198,7 +198,7 @@ $(BIN_DIR)/gen_pattern: $(SRC_DIR)/gen_pattern.cpp
$(MY_CXX) $(CXX_FLAGS) $(SRC_DIR)/gen_pattern.cpp \
-L$(LIB_DIR) -I$(INC_DIR) -o $@ $(LIBS)

$(BIN_DIR)/gen_pattern_int: $(SRC_DIR)/gen_pattern.cpp
$(BIN_DIR)/gen_pattern_int: $(SRC_DIR)/gen_pattern.cpp
@echo "Build pattern generation program"
$(MY_CXX) $(CXX_FLAGS) $(SRC_DIR)/gen_pattern.cpp \
-DINT_ALPHABET \
Expand Down Expand Up @@ -237,7 +237,7 @@ $(BIN_DIR)/build_int_idx_%: $(SRC_DIR)/build_idx.cpp index_int.config
-I$(INC_DIR) -o $@ $(LIBS)

# Targets for the count experiment. $(BIN_DIR)/query_idx_[IDX_ID]
$(BIN_DIR)/query_idx_%: $(SRC_DIR)/query_idx.cpp index.config
$(BIN_DIR)/query_idx_%: $(SRC_DIR)/query_idx.cpp index.config
$(eval IDX_TYPE:=$(call config_select,index.config,$*,2))
@echo "Compiling query_idx_$*"
$(MY_CXX) $(CXX_FLAGS) \
Expand All @@ -246,7 +246,7 @@ $(BIN_DIR)/query_idx_%: $(SRC_DIR)/query_idx.cpp index.config
-I$(INC_DIR) -o $@ $(LIBS)

# Targets for the count experiment. $(BIN_DIR)/query_idx_[IDX_ID]
$(BIN_DIR)/query_int_idx_%: $(SRC_DIR)/query_idx.cpp index_int.config
$(BIN_DIR)/query_int_idx_%: $(SRC_DIR)/query_idx.cpp index_int.config
$(eval IDX_TYPE:=$(call config_select,index_int.config,$*,2))
@echo "Compiling query_int_idx_$*"
$(MY_CXX) $(CXX_FLAGS) \
Expand All @@ -258,11 +258,11 @@ $(BIN_DIR)/word_pat2char_pat: $(SRC_DIR)/word_pat2char_pat.cpp
@echo "Compiling word_pat2char_pat.cpp"
$(MY_CXX) $(CXX_FLAGS) \
$(SRC_DIR)/word_pat2char_pat.cpp \
-o $@
-o $@



dic/%:
dic/%:
$(eval URL:=$(call config_filter,dic.config,$@,4))
@$(if $(URL),,\
$(error "No download link for dictionary $@") )
Expand All @@ -274,15 +274,15 @@ dic/%:
echo "Extract file $(FILE) using gunzip";\
gunzip $(FILE))

../data/%.int.sdsl:
../data/%.int.sdsl:
$(eval URL:=$(call config_filter,test_case_int.config,$@,4))
@$(if $(URL),,\
$(error "No download link nor generation program specified for test case $@") )
@echo "Download input from $(URL) using curl"
$(eval DEST_DIR:=$(shell dirname $@))
cd $(DEST_DIR); curl -O $(URL)
$(eval FILE:=$(DEST_DIR)/$(notdir $(URL)))
@$(if $(filter-out ".gz",$(FILE)),\
@$(if $(filter "%.gz",$(FILE)),\
echo "Extract file $(FILE) using gunzip";\
gunzip $(FILE))

Expand All @@ -299,7 +299,7 @@ clean: clean-build
@echo "Remove info files and indexes"
rm -f $(INDEXES) $(INDEXES_INT)

cleanresults:
cleanresults:
@echo "Remove result files and pattern"
rm -f $(TIME_FILES) \
$(RESULT_FILE) \
Expand All @@ -311,6 +311,6 @@ cleanresults:

cleanall: clean cleanresults
@echo "Remove all generated files."
rm -f $(TMP_DIR)/*
rm -f $(TMP_DIR)/*
rm -f $(PAT_DIR)/*
cd visualize; make clean
31 changes: 18 additions & 13 deletions benchmark/k2_trees/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include ../../Make.helper
# CFLAGS = $(MY_CXX_FLAGS)
CFLAGS = -std=c++11 -g -stdlib=libc++
CFLAGS = $(MY_CXX_FLAGS)
SRC_DIR = src
BIN_DIR = bin
LIBS = -lsdsl
Expand All @@ -11,17 +10,22 @@ K2_IDS:=$(call config_ids,k2tree.config)

DL = $(foreach TC_ID,$(TC_IDS),\
$(call config_select,test_case.config,$(TC_ID),2))
DL_K2T = $(foreach TC_ID,$(TC_IDS),../tmp/K2T.$(TC_ID))
DL_K2T = $(foreach TC_ID,$(TC_IDS),\
$(foreach K2_ID,$(K2_IDS),\
../tmp/K2T.$(TC_ID).$(K2_ID)))

K2_EXECS = $(foreach K2_ID,$(K2_IDS),$(BIN_DIR)/build_$(K2_ID))

RES_FILES = $(foreach K2_ID,$(K2_IDS),\
$(foreach TC_ID,$(TC_IDS),\
results/$(K2_ID).$(TC_ID)))

GEN_FILES = $(foreach K2_ID,$(K2_IDS),\
$(BIN_DIR)/gen_k2_$(K2_ID))

K2T_RES_FILES = $(foreach K2_ID,$(K2_IDS),\
$(foreach TC_ID,$(TC_IDS),\
results-bwt/$(K2_ID).$(TC_ID)))
results-k2t/$(K2_ID).$(TC_ID)))

RESULT_FILE=results/all.txt

Expand All @@ -33,12 +37,12 @@ timing: execs $(RES_FILES)
@cat $(RES_FILES) > $(RESULT_FILE)
@cd visualize;make

../tmp/K2T.%: $(DL) $(BIN_DIR)/gen_k2t
$(eval TC_ID:=$*)
../tmp/K2T.%: $(DL) $(GEN_FILES)
$(eval TC_ID:=$(call dim,1,$*))
$(eval K2_ID:=$(call dim,2,$*))
$(eval TC_PATH:=$(call config_select,test_case.config,$(TC_ID),2))
$(eval K2T:=$(strip $(call config_select,test_case.config,$(TC_ID),6)))
$(eval NUM_BYTE:=$(call config_select,test_case.config,$(TC_ID),5))
@$(BIN_DIR)/gen_k2t $(TC_PATH) ../tmp/K2T.$(TC_ID) ../tmp $(K2T) $(NUM_BYTE)
@$(BIN_DIR)/gen_k2_$(K2_ID) $(TC_PATH) "../tmp/K2T.$(TC_ID).$(K2_ID)" "../tmp"

# Execute $(BIN_DIR)/build_[K2_ID] and write result
results/%: test_case.config $(DL) $(DL_K2T) execs
Expand All @@ -47,10 +51,10 @@ results/%: test_case.config $(DL) $(DL_K2T) execs
$(eval K2_TEX_NAME:=$(call config_select,k2tree.config,$(K2_ID),3))
$(eval TC_TEX_NAME:=$(call config_select,test_case.config,$(TC_ID),3))
$(eval K2T:=$(strip $(call config_select,test_case.config,$(TC_ID),6)))
$(eval TC_PATH:=$(if $(findstring K2T,$(K2T)),"../tmp/K2T.$(TC_ID)",$(call config_select,test_case.config,$(TC_ID),2)))
$(eval TC_PATH:=$(call config_select,test_case.config,$(TC_ID),2))
$(eval TC_TYPE:=$(call config_select,test_case.config,$(TC_ID),5))
$(eval TC_SIZE:=$(shell wc -c <$(TC_PATH)))
$(eval ARGS:=$(TC_PATH) $(TC_TYPE) $(TC_ID) $(K2_ID))
$(eval ARGS:="../tmp/K2T.$(TC_ID).$(K2_ID)")
@echo "Running bin/build_$(K2_ID) on $(TC_ID)"
@echo "# K2_ID = $(K2_ID)" > $@
@echo "# TC_ID = $(TC_ID)" >> $@
Expand All @@ -63,12 +67,13 @@ results/%: test_case.config $(DL) $(DL_K2T) execs
$(BIN_DIR)/build_%: $(SRC_DIR)/k2_time_and_space.cpp k2tree.config
$(eval K2_ID:=$(call dim,1,$*))
$(eval K2_TYPE:=$(call config_select,k2tree.config,$(K2_ID),2))
@echo "Compiling build_$*"
@$(MY_CXX) $(CFLAGS) $(C_OPTIONS) -DK2_TYPE="$(K2_TYPE)" -L$(LIB_DIR)\
$(SRC_DIR)/k2_time_and_space.cpp -I$(INC_DIR) -o $@ $(LIBS)

$(BIN_DIR)/gen_k2t: $(SRC_DIR)/gen_k2t.cpp
@$(MY_CXX) $(CFLAGS) $(C_OPTIONS) -L$(LIB_DIR)\
$(BIN_DIR)/gen_k2_%: $(SRC_DIR)/gen_k2t.cpp
$(eval K2_ID:=$(call dim,1,$*))
$(eval K2_TYPE:=$(call config_select,k2tree.config,$(K2_ID),2))
@$(MY_CXX) $(CFLAGS) $(C_OPTIONS) -DK2_TYPE="$(K2_TYPE)" -L$(LIB_DIR)\
$(SRC_DIR)/gen_k2t.cpp -I$(INC_DIR) -o $@ $(LIBS) -ldivsufsort -ldivsufsort64

include ../Make.download
Expand Down
3 changes: 1 addition & 2 deletions benchmark/k2_trees/compile_options.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Compile options
# -O3 -funroll-loops -fomit-frame-pointer -ffast-math -NDEBUG
-Wall
-O3 -funroll-loops -fomit-frame-pointer -ffast-math -DNDEBUG
Loading

0 comments on commit 1b24ddb

Please sign in to comment.