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
f0dd1ffb
Commit
f0dd1ffb
authored
Feb 15, 2017
by
Matthieu Schaller
Browse files
Post-merge fixes
parent
5b8599d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/active.h
View file @
f0dd1ffb
...
...
@@ -144,7 +144,7 @@ __attribute__((always_inline)) INLINE static int gpart_is_active(
}
/**
* @brief Is this s-particle
active
?
* @brief Is this s-particle
finishing its time-step now
?
*
* @param sp The #spart.
* @param e The #engine containing information about the current time.
...
...
@@ -159,7 +159,7 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
#ifdef SWIFT_DEBUG_CHECKS
if
(
ti_end
<
ti_current
)
error
(
"s-particle in an impossible time-zone!
g
p->ti_end=%lld "
"s-particle in an impossible time-zone!
s
p->ti_end=%lld "
"e->ti_current=%lld"
,
ti_end
,
ti_current
);
#endif
...
...
@@ -167,8 +167,6 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
return
(
ti_end
==
ti_current
);
}
/* Are cells / particles active for kick1 tasks ? */
/**
...
...
@@ -242,4 +240,29 @@ __attribute__((always_inline)) INLINE static int gpart_is_starting(
return
(
ti_beg
==
ti_current
);
}
/**
* @brief Is this s-particle starting its time-step now ?
*
* @param sp The #spart.
* @param e The #engine containing information about the current time.
* @return 1 if the #spart is active, 0 otherwise.
*/
__attribute__
((
always_inline
))
INLINE
static
int
spart_is_starting
(
const
struct
spart
*
sp
,
const
struct
engine
*
e
)
{
const
integertime_t
ti_current
=
e
->
ti_current
;
const
integertime_t
ti_beg
=
get_integer_time_begin
(
ti_current
+
1
,
sp
->
time_bin
);
#ifdef SWIFT_DEBUG_CHECKS
if
(
ti_beg
>
ti_current
)
error
(
"s-particle in an impossible time-zone! sp->ti_beg=%lld "
"e->ti_current=%lld"
,
ti_beg
,
ti_current
);
#endif
return
(
ti_beg
==
ti_current
);
}
#endif
/* SWIFT_ACTIVE_H */
src/engine.c
View file @
f0dd1ffb
...
...
@@ -3077,7 +3077,6 @@ void engine_step(struct engine *e) {
if
(
e
->
ti_end_min
>=
e
->
ti_nextSnapshot
&&
e
->
ti_nextSnapshot
>
0
)
e
->
dump_snapshot
=
1
;
/* Drift everybody (i.e. what has not yet been drifted) */
/* to the current time */
if
(
e
->
dump_snapshot
||
e
->
forcerebuild
||
e
->
forcerepart
!=
REPART_NONE
)
...
...
src/parallel_io.c
View file @
f0dd1ffb
...
...
@@ -431,11 +431,12 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
*
flag_entropy
=
flag_entropy_temp
[
0
];
readAttribute
(
h_grp
,
"BoxSize"
,
DOUBLE
,
boxSize
);
readAttribute
(
h_grp
,
"NumPart_Total"
,
LONGLONG
,
numParticles
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
LONGLONG
,
numParticles_highWord
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
LONGLONG
,
numParticles_highWord
);
for
(
int
ptype
=
0
;
ptype
<
NUM_PARTICLE_TYPES
;
++
ptype
)
N_total
[
ptype
]
=
(
numParticles
[
ptype
])
+
(
numParticles_highWord
[
ptype
]
<<
32
);
N_total
[
ptype
]
=
(
numParticles
[
ptype
])
+
(
numParticles_highWord
[
ptype
]
<<
32
);
dim
[
0
]
=
boxSize
[
0
];
dim
[
1
]
=
(
boxSize
[
1
]
<
0
)
?
boxSize
[
0
]
:
boxSize
[
1
];
...
...
src/runner.c
View file @
f0dd1ffb
...
...
@@ -968,8 +968,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
/* do the kick */
kick_spart
(
sp
,
ti_begin
,
ti_begin
+
ti_step
/
2
,
timeBase
);
}
}
}
}
if
(
timer
)
TIMER_TOC
(
timer_kick1
);
}
...
...
@@ -1119,7 +1118,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
TIMER_TIC
;
int
updated
=
0
,
g_updated
=
0
,
s_updated
=
0
;
integertime_t
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
,
ti_end_max
=
0
,
ti_beg_max
=
0
;
integertime_t
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
,
ti_beg_max
=
0
;
/* No children? */
if
(
!
c
->
split
)
{
...
...
src/serial_io.c
View file @
f0dd1ffb
...
...
@@ -483,11 +483,12 @@ void read_ic_serial(char* fileName, const struct UnitSystem* internal_units,
*
flag_entropy
=
flag_entropy_temp
[
0
];
readAttribute
(
h_grp
,
"BoxSize"
,
DOUBLE
,
boxSize
);
readAttribute
(
h_grp
,
"NumPart_Total"
,
LONGLONG
,
numParticles
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
LONGLONG
,
numParticles_highWord
);
readAttribute
(
h_grp
,
"NumPart_Total_HighWord"
,
LONGLONG
,
numParticles_highWord
);
for
(
int
ptype
=
0
;
ptype
<
NUM_PARTICLE_TYPES
;
++
ptype
)
N_total
[
ptype
]
=
(
numParticles
[
ptype
])
+
(
numParticles_highWord
[
ptype
]
<<
32
);
N_total
[
ptype
]
=
(
numParticles
[
ptype
])
+
(
numParticles_highWord
[
ptype
]
<<
32
);
dim
[
0
]
=
boxSize
[
0
];
dim
[
1
]
=
(
boxSize
[
1
]
<
0
)
?
boxSize
[
0
]
:
boxSize
[
1
];
...
...
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