Skip to content
GitLab
Menu
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
6b436a97
Commit
6b436a97
authored
Apr 14, 2013
by
Pedro Gonnet
Browse files
clean-up.
Former-commit-id: bc2e9235d506185d24f5fedb393ad2f394d8ab57
parent
d5ca6e0a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cell.h
View file @
6b436a97
...
...
@@ -109,7 +109,7 @@ struct cell {
float
mom
[
3
],
ang
[
3
];
/* Potential and kinetic energy of particles in this cell. */
float
epot
,
ekin
;
double
epot
,
ekin
;
/* Number of particles updated in this cell. */
int
updated
;
...
...
src/engine.c
View file @
6b436a97
...
...
@@ -319,7 +319,8 @@ void engine_map_kick_first ( struct cell *c , void *data ) {
void
engine_collect_kick2
(
struct
cell
*
c
)
{
int
k
,
updated
=
0
;
float
dt_min
=
FLT_MAX
,
dt_max
=
0
.
0
f
,
ekin
=
0
.
0
f
,
epot
=
0
.
0
f
;
float
dt_min
=
FLT_MAX
,
dt_max
=
0
.
0
f
;
double
ekin
=
0
.
0
,
epot
=
0
.
0
;
float
mom
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
ang
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
struct
cell
*
cp
;
...
...
@@ -425,7 +426,8 @@ void engine_step ( struct engine *e , int sort_queues ) {
int
k
;
float
dt
=
e
->
dt
,
dt_step
,
dt_max
=
0
.
0
f
,
dt_min
=
FLT_MAX
;
float
epot
=
0
.
0
,
ekin
=
0
.
0
,
mom
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
double
epot
=
0
.
0
,
ekin
=
0
.
0
;
float
mom
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
float
ang
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
int
count
=
0
;
struct
cell
*
c
;
...
...
src/runner.c
View file @
6b436a97
...
...
@@ -430,8 +430,8 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
/* Compute the P/Omega/rho2. */
p
->
force
.
POrho2
=
u
*
(
const_gamma
-
1
.
0
f
)
/
(
rho
+
hg
*
rho_dh
/
3
.
0
f
);
/* Balsara switch */
p
->
force
.
balsara
=
normDiv_v
/
(
normDiv_v
+
normCurl_v
+
0
.
0001
f
*
fc
*
ihg
);
/* Balsara switch */
p
->
force
.
balsara
=
normDiv_v
/
(
normDiv_v
+
normCurl_v
+
0
.
0001
f
*
fc
*
ihg
);
/* Reset the acceleration. */
for
(
k
=
0
;
k
<
3
;
k
++
)
...
...
@@ -513,7 +513,8 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
void
runner_dokick2
(
struct
runner
*
r
,
struct
cell
*
c
)
{
int
k
,
count
=
0
,
nr_parts
=
c
->
count
;
float
dt_min
=
FLT_MAX
,
dt_max
=
0
.
0
f
,
ekin
=
0
.
0
f
,
epot
=
0
.
0
f
;
float
dt_min
=
FLT_MAX
,
dt_max
=
0
.
0
f
;
double
ekin
=
0
.
0
,
epot
=
0
.
0
;
float
mom
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
ang
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
float
x
[
3
],
v
[
3
],
u
,
h
,
pdt
,
m
;
float
dt_step
=
r
->
e
->
dt_step
,
dt
=
r
->
e
->
dt
,
hdt
=
0
.
5
f
*
dt
;
...
...
src/runner_doiact.h
View file @
6b436a97
...
...
@@ -1888,7 +1888,7 @@ void DOSUB2 ( struct runner *r , struct cell *ci , struct cell *cj , int sid ) {
h
=
fmin
(
ci
->
h
[
0
]
,
fmin
(
ci
->
h
[
1
]
,
ci
->
h
[
2
]
)
);
/* Get the type of pair if not specified explicitly. */
if
(
sid
<
0
)
//
if ( sid < 0 )
sid
=
space_getsid
(
s
,
&
ci
,
&
cj
,
shift
);
/* Recurse? */
...
...
src/space.c
View file @
6b436a97
...
...
@@ -112,10 +112,6 @@ int space_marktasks ( struct space *s ) {
/* Set this task's skip. */
t
->
skip
=
(
t
->
ci
->
dt_min
>
dt_step
);
/* Set the sort flags. */
// if ( !t->skip && t->type == task_type_sub )
// space_addsorts( s , t , t->ci , t->cj , t->flags );
}
/* Pair? */
...
...
@@ -196,25 +192,6 @@ int space_prepare ( struct space *s ) {
}
/* Now that we have the cell structre, re-build the tasks. */
// tic = getticks();
// space_maketasks( s , 1 );
// printf( "space_prepare: maketasks took %.3f ms.\n" , (double)(getticks() - tic) / CPU_TPS * 1000 );
/* Count the number of each task type. */
/* tic = getticks();
for ( k = 0 ; k <= task_type_count ; k++ )
counts[k] = 0;
for ( k = 0 ; k < s->nr_tasks ; k++ )
if ( !s->tasks[k].skip )
counts[ (int)s->tasks[k].type ] += 1;
else
counts[ task_type_count ] += 1;
printf( "space_prepare: task counts are [ %s=%i" , taskID_names[0] , counts[0] );
for ( k = 1 ; k < task_type_count ; k++ )
printf( " %s=%i" , taskID_names[k] , counts[k] );
printf( " skipped=%i ]\n" , counts[ task_type_count ] ); fflush(stdout);
printf( "space_prepare: task counting took %.3f ms.\n" , (double)(getticks() - tic) / CPU_TPS * 1000 ); */
/* Let whoever cares know if we rebuilt. */
return
rebuild
;
...
...
@@ -981,8 +958,7 @@ void space_splittasks ( struct space *s ) {
} */
/* Is this cell even split? */
if
(
!
ci
->
split
)
continue
;
if
(
ci
->
split
)
{
/* Make a sub? */
if
(
space_dosub
&&
ci
->
count
<
space_subsize
)
{
...
...
@@ -990,10 +966,6 @@ void space_splittasks ( struct space *s ) {
/* convert to a self-subtask. */
t
->
type
=
task_type_sub
;
/* Wait for this tasks sorts, as we will now have pairwise
components in this sub. */
// space_addsorts( s , t , ci , NULL , -1 );
}
/* Otherwise, make tasks explicitly. */
...
...
@@ -1016,6 +988,8 @@ void space_splittasks ( struct space *s ) {
if
(
ci
->
progeny
[
k
]
!=
NULL
)
space_addtask
(
s
,
task_type_pair
,
task_subtype_density
,
pts
[
j
][
k
]
,
0
,
ci
->
progeny
[
j
]
,
ci
->
progeny
[
k
]
,
0
);
}
}
}
...
...
@@ -1049,12 +1023,7 @@ void space_splittasks ( struct space *s ) {
/* Make this task a sub task. */
t
->
type
=
task_type_sub
;
t
->
flags
=
sid
;
t
->
ci
=
ci
;
t
->
cj
=
cj
;
/* Create the sorts recursively. */
// space_addsorts( s , t , ci , cj , sid );
}
/* Otherwise, split it. */
...
...
@@ -1387,7 +1356,7 @@ void space_maketasks ( struct space *s , int do_sort ) {
space_ranktasks
(
s
);
/* Count the number of each task type. */
/*
int counts[ task_type_count+1 ];
int
counts
[
task_type_count
+
1
];
for
(
k
=
0
;
k
<=
task_type_count
;
k
++
)
counts
[
k
]
=
0
;
for
(
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
...
...
@@ -1398,7 +1367,7 @@ void space_maketasks ( struct space *s , int do_sort ) {
printf
(
"space_maketasks: task counts are [ %s=%i"
,
taskID_names
[
0
]
,
counts
[
0
]
);
for
(
k
=
1
;
k
<
task_type_count
;
k
++
)
printf
(
" %s=%i"
,
taskID_names
[
k
]
,
counts
[
k
]
);
printf( " skipped=%i ]\n" , counts[ task_type_count ] ); fflush(stdout);
*/
printf
(
" skipped=%i ]
\n
"
,
counts
[
task_type_count
]
);
fflush
(
stdout
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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