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
10381c2c
Commit
10381c2c
authored
Apr 08, 2013
by
Pedro Gonnet
Browse files
fix step/dt adjustment.
Former-commit-id: bf2363673cc5f457afd78548a13d9d3d6496eb27
parent
acdf00b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Makefile.am
View file @
10381c2c
...
...
@@ -22,7 +22,7 @@ AUTOMAKE_OPTIONS=gnu
# Add the debug flag to the whole thing
AM_CFLAGS
=
-g
-O3
-Wall
-Werror
-ffast-math
-fstrict-aliasing
-ftree-vectorize
\
-funroll-loops
$(SIMD_FLAGS)
$(OPENMP_CFLAGS)
\
-DTIMER
-DCOUNTER
-DCPU_TPS
=
2.
67
e9
-DTIMER
-DCOUNTER
-DCPU_TPS
=
2.
40
e9
# AM_CFLAGS = -Wall -Werror $(OPENMP_CFLAGS) \
# -DTIMER -DCOUNTER -DCPU_TPS=2.67e9
...
...
src/engine.c
View file @
10381c2c
...
...
@@ -235,7 +235,11 @@ void engine_map_kick_first ( struct cell *c , void *data ) {
p
->
v
[
1
]
=
v
[
1
]
+=
dt
*
a
[
1
];
p
->
v
[
2
]
=
v
[
2
]
+=
dt
*
a
[
2
];
p
->
u
=
u
+=
u_dt
*
dt
;
p
->
h
=
h
+=
h_dt
*
dt
;
// p->h = h += h_dt * dt;
{
float
w
=
h_dt
/
h
*
dt
;
p
->
h
=
h
*=
1
.
0
f
+
w
*
(
-
1
.
0
f
+
w
*
(
0
.
5
f
+
w
*
(
-
1
.
0
f
/
6
.
0
f
+
1
.
0
f
/
24
.
0
*
w
)
)
);
}
h_max
=
fmaxf
(
h_max
,
h
);
...
...
@@ -504,10 +508,12 @@ void engine_step ( struct engine *e , int sort_queues ) {
// printf( "engine_step: total entropic function is %e .\n", ent ); fflush(stdout);
printf
(
"engine_step: updated %i parts (dt_step=%.3e).
\n
"
,
count
,
dt_step
);
fflush
(
stdout
);
/* Increase the step. */
e
->
step
+=
1
;
/* Does the time step need adjusting? */
if
(
e
->
policy
&
engine_policy_fixdt
)
{
e
->
dt
=
e
->
dt_orig
;
e
->
step
+=
1
;
}
else
{
if
(
e
->
dt
==
0
)
{
...
...
@@ -529,7 +535,6 @@ void engine_step ( struct engine *e , int sort_queues ) {
e
->
step
/=
2
;
printf
(
"engine_step: dt_min is larger than twice the time step, adjusting to dt=%e.
\n
"
,
e
->
dt
);
}
e
->
step
+=
1
;
}
}
...
...
src/space.c
View file @
10381c2c
...
...
@@ -944,7 +944,7 @@ void space_splittasks ( struct space *s ) {
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
12
}
};
/* Loop through the tasks... */
#pragma omp parallel default(none) shared(s,tid,pts,space_subsize) private(ind,j,k,t,t_old,redo,ci,cj,hi,hj,sid,shift)
//
#pragma omp parallel default(none) shared(s,tid,pts,space_subsize) private(ind,j,k,t,t_old,redo,ci,cj,hi,hj,sid,shift)
{
redo
=
0
;
t_old
=
t
=
NULL
;
while
(
1
)
{
...
...
@@ -1334,7 +1334,7 @@ void space_maketasks ( struct space *s , int do_sort ) {
Each force task depends on the cell ghosts and unlocks the kick2 task
of its super-cell. */
kk
=
s
->
nr_tasks
;
#pragma omp parallel for private(t,t2)
//
#pragma omp parallel for private(t,t2)
for
(
k
=
0
;
k
<
kk
;
k
++
)
{
/* Get a pointer to the task. */
...
...
src/vector.h
View file @
10381c2c
...
...
@@ -27,7 +27,7 @@
#define VEC_MACRO(elcount, type) __attribute__((vector_size((elcount)*sizeof(type)))) type
/* So what will the vector size be? */
#ifdef __AVX__
#ifdef
NO
__AVX__
#define VECTORIZE
#define VEC_SIZE 8
#define VEC_FLOAT __m256
...
...
@@ -54,7 +54,7 @@
#define vec_dbl_ftoi(a) _mm256_cvttpd_epi32(a)
#define vec_dbl_fmin(a,b) _mm256_min_pd(a,b)
#define vec_dbl_fmax(a,b) _mm256_max_pd(a,b)
#elif defined( __SSE2__ )
#elif defined(
NO
__SSE2__ )
#define VECTORIZE
#define VEC_SIZE 4
#define VEC_FLOAT __m128
...
...
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