# HG changeset patch # User mas01mc # Date 1218294256 0 # Node ID cac5b3465318696625cfd3d2c3144b93a4a090fd # Parent 435ffdaecae9828d5eb43692a4d3b67ae5a71033 Added sequencehop on Indexing to optionally reduce size of large indexes. Added cleanup() call on WS query exit to fix MMAP memory leak diff -r 435ffdaecae9 -r cac5b3465318 audioDB.cpp --- a/audioDB.cpp Fri Aug 08 14:01:33 2008 +0000 +++ b/audioDB.cpp Sat Aug 09 15:04:16 2008 +0000 @@ -88,6 +88,7 @@ processArgs(argc, argv); assert(O2_ACTION(COM_QUERY)); query(dbName, inFile, adbQueryResponse); + cleanup(); } catch(char *err) { cleanup(); throw(err); @@ -101,6 +102,7 @@ processArgs(argc, argv); assert(O2_ACTION(COM_STATUS)); status(dbName, adbStatusResponse); + cleanup(); } catch(char *err) { cleanup(); throw(err); diff -r 435ffdaecae9 -r cac5b3465318 gengetopt.in --- a/gengetopt.in Fri Aug 08 14:01:33 2008 +0000 +++ b/gengetopt.in Sat Aug 09 15:04:16 2008 +0000 @@ -56,7 +56,7 @@ option "rotate" o "rotate query vectors for rotationally invariant search." flag off optional hidden option "resultlength" r "maximum length of the result list." int typestr="length" default="10" optional option "sequencelength" l "length of sequences for sequence search." int typestr="length" default="16" optional -option "sequencehop" h "hop size of sequence window for sequence search." int typestr="hop" default="1" dependon="QUERY" optional +option "sequencehop" h "hop size of sequence window for sequence search." int typestr="hop" default="1" optional option "absolute-threshold" - "absolute power threshold for consideration of query or target sequence (in Bels)" double optional option "relative-threshold" - "relative power threshold between query and target sequence (in Bels)" double dependon="QUERY" optional diff -r 435ffdaecae9 -r cac5b3465318 index.cpp --- a/index.cpp Fri Aug 08 14:01:33 2008 +0000 +++ b/index.cpp Sat Aug 09 15:04:16 2008 +0000 @@ -285,9 +285,11 @@ Uns32T audioDB::index_insert_shingles(vector >* vv, Uns32T trackID, double* spp){ Uns32T collisionCount = 0; cout << "[" << trackID << "]" << fileTable+trackID*O2_FILETABLE_ENTRY_SIZE; - for( Uns32T pointID=0 ; pointID < (*vv).size(); pointID++) - if(!use_absolute_threshold || (use_absolute_threshold && (*spp++ >= absolute_threshold))) + for( Uns32T pointID=0 ; pointID < (*vv).size(); pointID+=sequenceHop) + if(!use_absolute_threshold || (use_absolute_threshold && (*spp >= absolute_threshold))){ collisionCount += lsh->insert_point((*vv)[pointID], index_from_trackInfo(trackID, pointID)); + spp+=sequenceHop; + } return collisionCount; } @@ -381,7 +383,7 @@ lsh = index_allocate(indexName, false); // Get the header only here sequenceLength = lsh->get_lshHeader()->dataDim / dbH->dim; // shingleDim / vectorDim - if(!SERVER_LSH_INDEX_SINGLETON){ + if(lsh!=SERVER_LSH_INDEX_SINGLETON){ if( fabs(radius - lsh->get_radius())>fabs(O2_DISTANCE_TOLERANCE)) printf("*** Warning: adb_radius (%f) != lsh_radius (%f) ***\n", radius, lsh->get_radius()); printf("INDEX: dim %d\n", dbH->dim);