Commit 22d1a432 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

make splitsize variable.


Former-commit-id: d1b9c1bdc5509ad7348ff490f8a5f74d73a6dffc
parent 1850e55b
......@@ -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 )
......
......@@ -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" };
......
......@@ -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];
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment