From e9c1d5e48d155f48f84f249b0cfd1c222cddc1f9 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 19 Nov 2018 11:22:26 +0100 Subject: [PATCH] AVLs: made maximum number of nodes per AVL 5 millions, as this combined with keeping all AVLs mapped seems the most efficient. Now 1 million sequences more or less constantly takes 1 minute. --- src/obiavl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/obiavl.h b/src/obiavl.h index e898b51..ea464e4 100755 --- a/src/obiavl.h +++ b/src/obiavl.h @@ -32,13 +32,12 @@ #define MAX_NB_OF_AVLS_IN_GROUP (1000) /**< The maximum number of AVL trees in a group. // TODO discuss */ -#define MAX_NODE_COUNT_PER_AVL (10000000) /**< The maximum number of nodes in an AVL tree. +#define MAX_NODE_COUNT_PER_AVL (5000000) /**< The maximum number of nodes in an AVL tree. * Only used to decide when to create a new AVL in a group, and to initialize the bloom filter // TODO discuss. Try 30M? */ #define MAX_DATA_SIZE_PER_AVL (1073741824) /**< The maximum size of the data referred to by an AVL tree in a group. - * Only used to decide when to create a new AVL in a group. + * Only used to decide when to create a new AVL in a group. * Should not be greater than int32_t max (2,147,483,647), as indexes will have to be stored on 32 bits. - * Here 1073741824 B = 1 GB */ #define AVL_MAX_DEPTH (1024) /**< The maximum depth of an AVL tree. Used to save paths through the tree. */ @@ -378,6 +377,7 @@ OBIDMS_avl_group_p obi_clone_avl_group(OBIDMS_avl_group_p avl_group, const char* * @brief Closes an AVL tree. * * @param avl A pointer to the AVL tree structure to close and free. + * @param writable Whether the AVL is writable or not (and therefore if the files can and should be truncated to the used size). * * @retval 0 if the operation was successfully completed. * @retval -1 if an error occurred. @@ -385,7 +385,7 @@ OBIDMS_avl_group_p obi_clone_avl_group(OBIDMS_avl_group_p avl_group, const char* * @since December 2015 * @author Celine Mercier (celine.mercier@metabarcoding.org) */ -int obi_close_avl(OBIDMS_avl_p avl); +int obi_close_avl(OBIDMS_avl_p avl, bool writable); /**