Skip to content

Commit

Permalink
Merge branch 'master' into doc_list_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
simongog committed Aug 29, 2013
2 parents 81441de + 59a441d commit b19913c
Show file tree
Hide file tree
Showing 71 changed files with 888 additions and 3,330 deletions.
32 changes: 0 additions & 32 deletions CHANGES

This file was deleted.

8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ add_subdirectory(lib)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Make.helper.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/Make.helper" @ONLY)

## Add 'uninstall' target ##
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake")
19 changes: 0 additions & 19 deletions CMakeModules/Finddivsufsort.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions CMakeModules/Finddivsufsort64.cmake

This file was deleted.

File renamed without changes.
8 changes: 6 additions & 2 deletions benchmark/indexing_count/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TIME_FILES = $(foreach IDX_ID,$(IDX_IDS),\
$(foreach COMPILE_ID,$(COMPILE_IDS),results/$(TC_ID).$(IDX_ID).$(COMPILE_ID))))
COMP_FILES = $(addsuffix .z.info,$(TC_PATHS))

all: $(BUILD_EXECS) $(QUERY_EXECS) pattern
all: $(BUILD_EXECS) $(QUERY_EXECS) $(INFO_EXECS)

info: $(INFO_EXECS) $(INFO_FILES)
cd ../../examples; make json2html.x
Expand Down Expand Up @@ -116,9 +116,13 @@ $(BIN_DIR)/info_%: $(SRC_DIR)/info.cpp index.config

include ../Make.download

clean-build:
@echo "Remove executables"
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS)

clean:
@echo "Remove executables and indexes"
@rm -f $(QUERY_EXECS) $(LOCATE_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
$(INFO_FILES) $(INDEXES) $(BIN_DIR)/genpatterns

cleanresults:
Expand Down
1 change: 0 additions & 1 deletion benchmark/indexing_count/src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using namespace std;

int main(int argc, char* argv[])
{
char* filename;
if (argc < 2) {
cout << "./" << argv[0] << " index_file " << endl;
return 1;
Expand Down
2 changes: 1 addition & 1 deletion benchmark/indexing_count/src/run_queries_sdsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char* argv[])
querytype = *argv[2];

CSA_TYPE csa;
fprintf(stderr, "# File = %s\n",(string(argv[1]) + "." + string(SUF)).c_str());
fprintf(stderr, "# File = %s\n",(string(filename) + "." + string(SUF)).c_str());
fprintf(stderr, "# program = %s\n",string(SUF).c_str());
Load_time = getTime();
load_from_file(csa, (string(argv[1]) + "." + string(SUF)).c_str());
Expand Down
8 changes: 6 additions & 2 deletions benchmark/indexing_extract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TIME_FILES = $(foreach IDX_ID,$(IDX_IDS),\
$(foreach SAMPLE_ID,$(SAMPLE_IDS),results/$(TC_ID).$(IDX_ID).$(SAMPLE_ID))))
COMP_FILES = $(addsuffix .z.info,$(TC_PATHS))

all: $(BUILD_EXECS) $(QUERY_EXECS) intervals
all: $(BUILD_EXECS) $(QUERY_EXECS) $(INFO_EXECS)

info: $(INFO_EXECS) $(INFO_FILES)

Expand Down Expand Up @@ -139,9 +139,13 @@ $(BIN_DIR)/info_%: $(SRC_DIR)/info.cpp index.config

include ../Make.download

clean-build:
@echo "Remove executables"
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS)

clean:
@echo "Remove executables"
@rm -f $(QUERY_EXECS) $(LOCATE_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
$(BIN_DIR)/genintervals

cleanresults:
Expand Down
3 changes: 0 additions & 3 deletions benchmark/indexing_extract/src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
#include <sdsl/suffix_arrays.hpp>
#include <string>

#include <cstdlib>

using namespace sdsl;
using namespace std;

int main(int argc, char* argv[])
{
char* filename;
if (argc < 2) {
cout << "./" << argv[0] << " index_file " << endl;
return 1;
Expand Down
110 changes: 2 additions & 108 deletions benchmark/indexing_extract/src/run_queries_sdsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#define DISPLAY ('D')
#define VERBOSE ('V')

/* macro to detect and to notify errors */
#define IFERROR(error) {{if (error) { fprintf(stderr, "%s\n", error_index(error)); exit(1); }}}

using namespace sdsl;
using namespace std;

Expand All @@ -36,7 +33,6 @@ void pfile_info(ulong* length, ulong* numpatt);
double getTime(void);
void usage(char* progname);

static void* Index; /* opaque data type */
static int Verbose = 0;
static ulong Index_size, Text_length;
static double Load_time;
Expand All @@ -46,7 +42,6 @@ static double Load_time;
*/
int main(int argc, char* argv[])
{
int error = 0;
char* filename;
char querytype;

Expand All @@ -59,20 +54,15 @@ int main(int argc, char* argv[])
querytype = *argv[2];

CSA_TYPE csa;
fprintf(stderr, "Load from file %s\n",(string(argv[1]) + "." + string(SDSL_XSTR(SUF))).c_str());
fprintf(stderr, "Load from file %s\n",(string(filename) + "." + string(SDSL_XSTR(SUF))).c_str());
Load_time = getTime();
load_from_file(csa, (string(argv[1]) + "." + string(SDSL_XSTR(SUF))).c_str());
IFERROR(error);
Load_time = getTime() - Load_time;
fprintf(stderr, "# Load_index_time_in_sec = %.2f\n", Load_time);
std::cerr << "# text_size = " << csa.size()-1 << std::endl;

Index_size = size_in_bytes(csa);
IFERROR(error);
Text_length = csa.size()-1; // -1 since we added a sentinel character
// error = get_length(Index, &Text_length);
IFERROR(error);
/* Index_size /=1024; */
fprintf(stderr, "# Index_size_in_bytes = %lu\n", Index_size);
#ifdef USE_HP
bool mapped = mm::map_hp();
Expand Down Expand Up @@ -105,20 +95,7 @@ int main(int argc, char* argv[])

do_extract(csa);
break;
/* case DISPLAY:
if (argc < 4) {
usage(argv[0]);
exit (1);
}
if (argc > 4)
if (*argv[4] == VERBOSE){
Verbose = 1;
fprintf(stdout,"%c", DISPLAY);
}
do_display((ulong) atol(argv[3]));
break;
*/ default:
default:
fprintf(stderr, "Unknow option: main ru\n");
exit(1);
}
Expand All @@ -127,18 +104,13 @@ int main(int argc, char* argv[])
mm::unmap_hp();
}
#endif

// error = free_index(Index);
IFERROR(error);

return 0;
}


void
do_count(const CSA_TYPE& csa)
{
int error = 0;
ulong numocc, length, tot_numocc = 0, numpatt, res_patt;
double time, tot_time = 0;
uchar* pattern;
Expand All @@ -163,8 +135,6 @@ do_count(const CSA_TYPE& csa)
/* Count */
time = getTime();
numocc = count(csa, pattern, pattern+length);
// error = count (Index, pattern, length, &numocc);
IFERROR(error);

if (Verbose) {
fwrite(&length, sizeof(length), 1, stdout);
Expand Down Expand Up @@ -194,7 +164,6 @@ do_count(const CSA_TYPE& csa)
void
do_locate(const CSA_TYPE& csa)
{
int error = 0;
ulong numocc, length; //, *occ,
int_vector<32> occ;
ulong tot_numocc = 0, numpatt = 0, processed_pat = 0;
Expand All @@ -219,7 +188,6 @@ do_locate(const CSA_TYPE& csa)
// Locate
time = getTime();
numocc = locate(csa, pattern, pattern+length, occ);
IFERROR(error);
tot_time += (getTime() - time);
++processed_pat;

Expand All @@ -242,80 +210,6 @@ do_locate(const CSA_TYPE& csa)
free(pattern);
}


/*
void do_display(ulong numc) {
int error = 0;
ulong numocc, length, i, *snippet_len, tot_numcharext = 0, numpatt;
double time, tot_time = 0;
uchar *pattern, *snippet_text;
pfile_info (&length, &numpatt);
pattern = (uchar *) malloc (sizeof (uchar) * (length));
if (pattern == NULL)
{
fprintf (stderr, "Error: cannot allocate\n");
exit (1);
}
fprintf(stderr, "Snippet length %lu\n", numc);
while (numpatt)
{
if (fread (pattern, sizeof (*pattern), length, stdin) != length)
{
fprintf (stderr, "Error: cannot read patterns file\n");
perror ("run_queries");
exit (1);
}
// Display
time = getTime ();
error = display (Index, pattern, length, numc, &numocc,
&snippet_text, &snippet_len);
IFERROR (error);
tot_time += (getTime () - time);
if (Verbose) {
ulong j, len = length + 2*numc;
char blank = '\0';
fwrite(&length, sizeof(length), 1, stdout);
fwrite(pattern, sizeof(*pattern), length, stdout);
fwrite(&numocc, sizeof(numocc), 1, stdout);
fwrite(&len, sizeof(len), 1, stdout);
for (i = 0; i < numocc; i++){
fwrite(snippet_text+len*i,sizeof(uchar),snippet_len[i],stdout);
for(j=snippet_len[i];j<len;j++)
fwrite(&blank,sizeof(uchar),1,stdout);
}
}
numpatt--;
for(i=0; i<numocc; i++) {
tot_numcharext += snippet_len[i];
}
if (numocc) {
free (snippet_len);
free (snippet_text);
}
}
fprintf (stderr, "#Total_num_chars_extracted = %lu\n", tot_numcharext);
fprintf (stderr, "#Display_time_in_sec = %.2f secs\n", tot_time);
fprintf (stderr, "#Time_display/Tot_num_chars = %.4f\n\n", (tot_time*1000) / tot_numcharext);
fprintf (stderr, "#(Load_time+Time_display)/Tot_num_chars = %.4f\n\n", ((Load_time+tot_time)*1000) / tot_numcharext);
free (pattern);
}
*/


/* Open patterns file and read header */
void
pfile_info(ulong* length, ulong* numpatt)
Expand Down
8 changes: 6 additions & 2 deletions benchmark/indexing_locate/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TIME_FILES = $(foreach IDX_ID,$(IDX_IDS),\
$(foreach SAMPLE_ID,$(SAMPLE_IDS),results/$(TC_ID).$(IDX_ID).$(SAMPLE_ID))))
COMP_FILES = $(addsuffix .z.info,$(TC_PATHS))

all: $(BUILD_EXECS) $(QUERY_EXECS) pattern
all: $(BUILD_EXECS) $(QUERY_EXECS) $(INFO_EXECS)

info: $(INFO_EXECS) $(INFO_FILES)

Expand Down Expand Up @@ -139,9 +139,13 @@ $(BIN_DIR)/info_%: $(SRC_DIR)/info.cpp index.config

include ../Make.download

clean-build:
@echo "Remove executables"
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS)

clean:
@echo "Remove executables"
@rm -f $(QUERY_EXECS) $(LOCATE_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
@rm -f $(QUERY_EXECS) $(BUILD_EXECS) $(INFO_EXECS) \
$(BIN_DIR)/pattern_random

cleanresults:
Expand Down
1 change: 0 additions & 1 deletion benchmark/indexing_locate/src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using namespace std;

int main(int argc, char* argv[])
{
char* filename;
if (argc < 2) {
cout << "./" << argv[0] << " index_file " << endl;
return 1;
Expand Down
Loading

0 comments on commit b19913c

Please sign in to comment.