diff --git a/runner.h b/runner.h index 6bb7cbe768e0998e36a97be2741b177dc239a207..5ab9feba8f82b6ff41ed778edea27f223a7f20d3 100644 --- a/runner.h +++ b/runner.h @@ -96,7 +96,7 @@ extern int runner_counter[ runner_counter_count ]; /* Histogram functions. */ #define runner_hist_a 1.0 -#define runner_hist_b 6.0 +#define runner_hist_b 10.0 #define runner_hist_N 99 long long int runner_hist_bins[ runner_hist_N ]; #define runner_hist_hit( x ) __sync_add_and_fetch( &runner_hist_bins[ (int)fmax( 0.0 , fmin( runner_hist_N-1 , ((x) - runner_hist_a) / (runner_hist_b - runner_hist_a) * runner_hist_N ) ) ] , 1 ) diff --git a/space.c b/space.c index fe226689e0c323aeabef1e83c4bdf451317f6be3..4ae7898fa4c9996113320a478ebbda7f6e9ff047 100644 --- a/space.c +++ b/space.c @@ -39,6 +39,9 @@ /* Convert cell location to ID. */ #define cell_getid( cdim , i , j , k ) ( (int)(k) + (cdim)[2]*( (int)(j) + (cdim)[1]*(int)(i) ) ) +/* Split size. */ +int space_splitsize = space_splitsize_default; + /* Task type names. */ const char *taskID_names[tid_count] = { "none" , "sort" , "self" , "pair" , "sub" }; diff --git a/space.h b/space.h index e7d8d12472b7041b38220c7910329001c203d517..0368cf937bb286ec8097cbd5132f842b33bbc1be 100644 --- a/space.h +++ b/space.h @@ -24,11 +24,14 @@ #define space_maxdepth 10 #define space_cellallocchunk 1000 #define space_splitratio 0.875 -#define space_splitsize 800 +#define space_splitsize_default 800 #define task_maxwait 3 #define task_maxunlock 39 +/* Split size. */ +extern int space_splitsize; + /* Map shift vector to sortlist. */ extern const int sortlistID[27]; diff --git a/test.c b/test.c index 165c74dbfcc69da5e055157c45aec5ae9bb3687f..a02ccd9b639679e5a29282fa145f1fb7f2ceb69b 100644 --- a/test.c +++ b/test.c @@ -491,7 +491,7 @@ int main ( int argc , char *argv[] ) { bzero( &s , sizeof(struct space) ); /* Parse the options. */ - while ( ( c = getopt( argc , argv , "a:b:p:d:N:c:h:v:m:s:t:q:r:i:m:" ) ) != -1 ) + while ( ( c = getopt( argc , argv , "a:b:p:d:N:c:h:v:m:s:t:q:r:i:m:z:" ) ) != -1 ) switch ( c ) { case 'N': if ( sscanf( optarg , "%d" , &N ) != 1 ) @@ -568,6 +568,11 @@ int main ( int argc , char *argv[] ) { error( "Error parsing number of threads." ); omp_set_num_threads( nr_threads ); break; + case 'z': + if ( sscanf( optarg , "%d" , &space_splitsize ) != 1 ) + error( "Error parsing split size." ); + printf( "main: split size set to %i.\n" , space_splitsize ); + break; case '?': error( "Unknown option." ); break;