Changeset 9283

Show
Ignore:
Timestamp:
04/19/12 10:01:24 (13 months ago)
Author:
elaine
Message:

Allow threshold for tree logic to be specified in the config file.

Location:
branches/stable/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/stable/src/common/misc/server-config.c

    r9277 r9283  
    126126static DOTCONF_CB(directio_ops_per_queue); 
    127127static DOTCONF_CB(directio_timeout); 
     128static DOTCONF_CB(tree_width); 
     129static DOTCONF_CB(tree_threshhold); 
    128130 
    129131static FUNC_ERRORHANDLER(errorhandler); 
     
    10191021        CTX_STORAGEHINTS, "1000"}, 
    10201022 
     1023    /* Specifies the number of partitions to use for tree communication. */ 
     1024    {"TreeWidth", ARG_INT, tree_width, NULL, 
     1025        CTX_FILESYSTEM, "2"}, 
     1026 
     1027    /* Specifies the minimum number of servers to contact before tree communication kicks in. */ 
     1028    {"TreeThreshhold", ARG_INT, tree_threshhold, NULL, 
     1029        CTX_FILESYSTEM, "2"}, 
     1030 
    10211031    LAST_OPTION 
    10221032}; 
     
    30283038} 
    30293039 
     3040DOTCONF_CB(tree_width) 
     3041{ 
     3042    struct server_configuration_s *config_s = 
     3043        (struct server_configuration_s *)cmd->context; 
     3044 
     3045    config_s->tree_width = cmd->data.value; 
     3046 
     3047    return NULL; 
     3048} 
     3049 
     3050DOTCONF_CB(tree_threshhold) 
     3051{ 
     3052    struct server_configuration_s *config_s = 
     3053        (struct server_configuration_s *)cmd->context; 
     3054 
     3055    config_s->tree_threshhold = cmd->data.value; 
     3056 
     3057    return NULL; 
     3058} 
     3059 
    30303060/* 
    30313061 * Function: PINT_config_release 
  • branches/stable/src/common/misc/server-config.h

    r9277 r9283  
    203203    int trove_method; 
    204204    void *private_data; 
     205    int32_t tree_width; 
     206    int32_t tree_threshhold; 
    205207} server_configuration_s; 
    206208 
  • branches/stable/src/server/tree-communicate.sm

    r8869 r9283  
    3333#include "extent-utils.h" 
    3434 
    35 #define MAX_PARTITIONS  2 
     35//#define       MAX_PARTITIONS  2 
    3636 
    3737enum 
     
    247247    if (s_op->u.tree_communicate.handle_array_remote_count > 0) { 
    248248 
    249       /* Decide how to divide the remote handles. If there are only a few (MAX_PARTITIONS or 
    250          fewer) then go ahead and send to each remaining server individually. */ 
    251       if (s_op->u.tree_communicate.handle_array_remote_count > MAX_PARTITIONS) 
     249      /* Decide how to divide the remote handles. If there are only a few (fewer than 
     250         tree_threshhold from the config file) then go ahead and send to each remaining server individually. */ 
     251      if (s_op->u.tree_communicate.handle_array_remote_count > server_config->tree_threshhold) 
    252252      { 
    253           num_partitions = MAX_PARTITIONS; 
     253          num_partitions = server_config->tree_width; 
    254254          num_files_per_server = s_op->u.tree_communicate.handle_array_remote_count / 
    255                    MAX_PARTITIONS; 
     255                   server_config->tree_width; 
    256256          if (num_partitions * num_files_per_server < 
    257257                   s_op->u.tree_communicate.handle_array_remote_count) {