Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
22d1a432
Commit
22d1a432
authored
Aug 30, 2012
by
Pedro Gonnet
Browse files
make splitsize variable.
Former-commit-id: d1b9c1bdc5509ad7348ff490f8a5f74d73a6dffc
parent
1850e55b
Changes
4
Hide whitespace changes
Inline
Side-by-side
runner.h
View file @
22d1a432
...
...
@@ -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 )
...
...
space.c
View file @
22d1a432
...
...
@@ -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"
};
...
...
space.h
View file @
22d1a432
...
...
@@ -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
];
...
...
test.c
View file @
22d1a432
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment