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
3d63d354
Commit
3d63d354
authored
Oct 01, 2018
by
Loic Hausammann
Browse files
Update cell.h with required modifications
parent
9470da94
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
3d63d354
...
@@ -1096,10 +1096,10 @@ int main(int argc, char *argv[]) {
...
@@ -1096,10 +1096,10 @@ int main(int argc, char *argv[]) {
?
e
.
sched
.
tasks
[
l
].
cj
->
hydro
.
count
?
e
.
sched
.
tasks
[
l
].
cj
->
hydro
.
count
:
0
,
:
0
,
(
e
.
sched
.
tasks
[
l
].
ci
!=
NULL
)
(
e
.
sched
.
tasks
[
l
].
ci
!=
NULL
)
?
e
.
sched
.
tasks
[
l
].
ci
->
grav
.
g
count
?
e
.
sched
.
tasks
[
l
].
ci
->
grav
.
count
:
0
,
:
0
,
(
e
.
sched
.
tasks
[
l
].
cj
!=
NULL
)
(
e
.
sched
.
tasks
[
l
].
cj
!=
NULL
)
?
e
.
sched
.
tasks
[
l
].
cj
->
grav
.
g
count
?
e
.
sched
.
tasks
[
l
].
cj
->
grav
.
count
:
0
,
:
0
,
e
.
sched
.
tasks
[
l
].
flags
,
e
.
sched
.
tasks
[
l
].
sid
);
e
.
sched
.
tasks
[
l
].
flags
,
e
.
sched
.
tasks
[
l
].
sid
);
}
}
...
@@ -1134,9 +1134,9 @@ int main(int argc, char *argv[]) {
...
@@ -1134,9 +1134,9 @@ int main(int argc, char *argv[]) {
(
e
.
sched
.
tasks
[
l
].
cj
==
NULL
)
?
0
(
e
.
sched
.
tasks
[
l
].
cj
==
NULL
)
?
0
:
e
.
sched
.
tasks
[
l
].
cj
->
hydro
.
count
,
:
e
.
sched
.
tasks
[
l
].
cj
->
hydro
.
count
,
(
e
.
sched
.
tasks
[
l
].
ci
==
NULL
)
?
0
(
e
.
sched
.
tasks
[
l
].
ci
==
NULL
)
?
0
:
e
.
sched
.
tasks
[
l
].
ci
->
grav
.
g
count
,
:
e
.
sched
.
tasks
[
l
].
ci
->
grav
.
count
,
(
e
.
sched
.
tasks
[
l
].
cj
==
NULL
)
?
0
(
e
.
sched
.
tasks
[
l
].
cj
==
NULL
)
?
0
:
e
.
sched
.
tasks
[
l
].
cj
->
grav
.
g
count
,
:
e
.
sched
.
tasks
[
l
].
cj
->
grav
.
count
,
e
.
sched
.
tasks
[
l
].
sid
);
e
.
sched
.
tasks
[
l
].
sid
);
}
}
}
}
...
...
src/active.h
View file @
3d63d354
...
@@ -39,15 +39,16 @@ __attribute__((always_inline)) INLINE static int cell_are_part_drifted(
...
@@ -39,15 +39,16 @@ __attribute__((always_inline)) INLINE static int cell_are_part_drifted(
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
c
->
hydro
.
ti_old
>
e
->
ti_current
)
if
(
c
->
hydro
.
ti_old
_part
>
e
->
ti_current
)
error
(
error
(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"Cell has been drifted too far forward in time! c->ti_old_part=%lld "
"(t=%e) "
"and e->ti_current=%lld (t=%e, a=%e)"
,
"and e->ti_current=%lld (t=%e, a=%e)"
,
c
->
hydro
.
ti_old
,
c
->
hydro
.
ti_old
*
e
->
time_base
,
e
->
ti_current
,
c
->
hydro
.
ti_old
_part
,
c
->
hydro
.
ti_old
_part
*
e
->
time_base
,
e
->
ti_current
*
e
->
time_base
,
e
->
cosmology
->
a
);
e
->
ti_current
,
e
->
ti_current
*
e
->
time_base
,
e
->
cosmology
->
a
);
#endif
#endif
return
(
c
->
hydro
.
ti_old
==
e
->
ti_current
);
return
(
c
->
hydro
.
ti_old
_part
==
e
->
ti_current
);
}
}
/**
/**
...
@@ -62,15 +63,15 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
...
@@ -62,15 +63,15 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
struct
cell
*
c
,
const
struct
engine
*
e
)
{
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
c
->
grav
.
ti_old_
g
part
>
e
->
ti_current
)
if
(
c
->
grav
.
ti_old_part
>
e
->
ti_current
)
error
(
error
(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e)"
,
"and e->ti_current=%lld (t=%e)"
,
c
->
grav
.
ti_old_
g
part
,
c
->
grav
.
ti_old_
g
part
*
e
->
time_base
,
c
->
grav
.
ti_old_part
,
c
->
grav
.
ti_old_part
*
e
->
time_base
,
e
->
ti_current
,
e
->
ti_current
,
e
->
ti_current
*
e
->
time_base
);
e
->
ti_current
*
e
->
time_base
);
#endif
#endif
return
(
c
->
grav
.
ti_old_
g
part
==
e
->
ti_current
);
return
(
c
->
grav
.
ti_old_part
==
e
->
ti_current
);
}
}
/* Are cells / particles active for regular tasks ? */
/* Are cells / particles active for regular tasks ? */
...
...
src/cache.h
View file @
3d63d354
...
@@ -278,7 +278,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
...
@@ -278,7 +278,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* Pad cache with fake particles that exist outside the cell so will not
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
* particles to avoid overflow problems. */
const
double
max_dx
=
ci
->
hydro
.
dx_max
;
const
double
max_dx
=
ci
->
hydro
.
dx_max
_part
;
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
...
@@ -326,7 +326,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
...
@@ -326,7 +326,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* Pad cache with fake particles that exist outside the cell so will not
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
* particles to avoid overflow problems. */
const
double
max_dx
=
ci
->
hydro
.
dx_max
;
const
double
max_dx
=
ci
->
hydro
.
dx_max
_part
;
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
...
@@ -491,11 +491,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
...
@@ -491,11 +491,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
const
float
shift_threshold_x
=
const
float
shift_threshold_x
=
2
.
*
ci
->
width
[
0
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max
,
cj
->
hydro
.
dx_max
);
2
.
*
ci
->
width
[
0
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max_part
,
cj
->
hydro
.
dx_max_part
);
const
float
shift_threshold_y
=
const
float
shift_threshold_y
=
2
.
*
ci
->
width
[
1
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max
,
cj
->
hydro
.
dx_max
);
2
.
*
ci
->
width
[
1
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max_part
,
cj
->
hydro
.
dx_max_part
);
const
float
shift_threshold_z
=
const
float
shift_threshold_z
=
2
.
*
ci
->
width
[
2
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max
,
cj
->
hydro
.
dx_max
);
2
.
*
ci
->
width
[
2
]
+
2
.
*
max
(
ci
->
hydro
.
dx_max_part
,
cj
->
hydro
.
dx_max_part
);
/* Make sure that particle positions have been shifted correctly. */
/* Make sure that particle positions have been shifted correctly. */
for
(
int
i
=
0
;
i
<
ci_cache_count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
ci_cache_count
;
i
++
)
{
...
@@ -529,7 +532,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
...
@@ -529,7 +532,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
/* Pad cache with fake particles that exist outside the cell so will not
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
* particles to avoid overflow problems. */
const
double
max_dx
=
max
(
ci
->
hydro
.
dx_max
,
cj
->
hydro
.
dx_max
);
const
double
max_dx
=
max
(
ci
->
hydro
.
dx_max
_part
,
cj
->
hydro
.
dx_max
_part
);
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
...
@@ -723,7 +726,7 @@ cache_read_two_partial_cells_sorted_force(
...
@@ -723,7 +726,7 @@ cache_read_two_partial_cells_sorted_force(
/* Pad cache with fake particles that exist outside the cell so will not
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
* particles to avoid overflow problems. */
const
double
max_dx
=
max
(
ci
->
hydro
.
dx_max
,
cj
->
hydro
.
dx_max
);
const
double
max_dx
=
max
(
ci
->
hydro
.
dx_max
_part
,
cj
->
hydro
.
dx_max
_part
);
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
...
...
src/cell.c
View file @
3d63d354
This diff is collapsed.
Click to expand it.
src/cell.h
View file @
3d63d354
...
@@ -93,7 +93,7 @@ struct pcell {
...
@@ -93,7 +93,7 @@ struct pcell {
integertime_t
ti_beg_max
;
integertime_t
ti_beg_max
;
/*! Integer time of the last drift of the #part in this cell */
/*! Integer time of the last drift of the #part in this cell */
integertime_t
ti_old
;
integertime_t
ti_old
_part
;
/*! Number of #part in this cell. */
/*! Number of #part in this cell. */
int
count
;
int
count
;
...
@@ -128,22 +128,27 @@ struct pcell {
...
@@ -128,22 +128,27 @@ struct pcell {
integertime_t
ti_beg_max
;
integertime_t
ti_beg_max
;
/*! Integer time of the last drift of the #gpart in this cell */
/*! Integer time of the last drift of the #gpart in this cell */
integertime_t
ti_old_
g
part
;
integertime_t
ti_old_part
;
/*! Integer time of the last drift of the #multipole in this cell */
/*! Integer time of the last drift of the #multipole in this cell */
integertime_t
ti_old_multipole
;
integertime_t
ti_old_multipole
;
/*! Number of #gpart in this cell. */
/*! Number of #gpart in this cell. */
int
g
count
;
int
count
;
}
grav
;
}
grav
;
/*! Stars variables */
struct
{
/*! Number of #spart in this cell. */
int
count
;
}
stars
;
/*! Relative indices of the cell's progeny. */
/*! Relative indices of the cell's progeny. */
int
progeny
[
8
];
int
progeny
[
8
];
/*! Number of #spart in this cell. */
int
scount
;
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
/* Cell ID (for debugging) */
int
cellID
;
int
cellID
;
...
@@ -166,7 +171,7 @@ struct pcell_step {
...
@@ -166,7 +171,7 @@ struct pcell_step {
integertime_t
ti_end_max
;
integertime_t
ti_end_max
;
/*! Maximal distance any #part has travelled since last rebuild */
/*! Maximal distance any #part has travelled since last rebuild */
float
dx_max
;
float
dx_max
_part
;
}
hydro
;
}
hydro
;
...
@@ -178,7 +183,12 @@ struct pcell_step {
...
@@ -178,7 +183,12 @@ struct pcell_step {
/*! Minimal integer end-of-timestep in this cell (gravity) */
/*! Minimal integer end-of-timestep in this cell (gravity) */
integertime_t
ti_end_max
;
integertime_t
ti_end_max
;
}
grav
;
}
grav
;
/*! Stars variables */
struct
{
}
stars
;
};
};
/**
/**
...
@@ -197,9 +207,6 @@ struct cell {
...
@@ -197,9 +207,6 @@ struct cell {
/*! Linking pointer for "memory management". */
/*! Linking pointer for "memory management". */
struct
cell
*
next
;
struct
cell
*
next
;
/*! Pointer to the #spart data. */
struct
spart
*
sparts
;
/*! Pointers to the next level of cells. */
/*! Pointers to the next level of cells. */
struct
cell
*
progeny
[
8
];
struct
cell
*
progeny
[
8
];
...
@@ -226,10 +233,10 @@ struct cell {
...
@@ -226,10 +233,10 @@ struct cell {
struct
cell
*
super
;
struct
cell
*
super
;
/*! Last (integer) time the cell's part were drifted forward in time. */
/*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t
ti_old
;
integertime_t
ti_old
_part
;
/*! Maximum part movement in this cell since last construction. */
/*! Maximum part movement in this cell since last construction. */
float
dx_max
;
float
dx_max
_part
;
/*! Maximum particle movement in this cell since the last sort. */
/*! Maximum particle movement in this cell since the last sort. */
float
dx_max_sort
;
float
dx_max_sort
;
...
@@ -259,12 +266,12 @@ struct cell {
...
@@ -259,12 +266,12 @@ struct cell {
/*! Is the #part data of this cell being used in a sub-cell? */
/*! Is the #part data of this cell being used in a sub-cell? */
int
hold
;
int
hold
;
/*! Values of dx_max before the drifts, used for sub-cell tasks. */
float
dx_max_old
;
/*! Values of h_max before the drifts, used for sub-cell tasks. */
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float
h_max_old
;
float
h_max_old
;
/*! Values of dx_max before the drifts, used for sub-cell tasks. */
float
dx_max_part_old
;
/*! Values of dx_max_sort before the drifts, used for sub-cell tasks. */
/*! Values of dx_max_sort before the drifts, used for sub-cell tasks. */
float
dx_max_sort_old
;
float
dx_max_sort_old
;
...
@@ -319,27 +326,6 @@ struct cell {
...
@@ -319,27 +326,6 @@ struct cell {
/*! Task for cooling */
/*! Task for cooling */
struct
task
*
cooling
;
struct
task
*
cooling
;
#ifdef WITH_MPI
/* Task receiving hydro data (positions). */
struct
task
*
recv_xv
;
/* Task receiving hydro data (density). */
struct
task
*
recv_rho
;
/* Task receiving hydro data (gradient). */
struct
task
*
recv_gradient
;
/* Linked list for sending hydro data (positions). */
struct
link
*
send_xv
;
/* Linked list for sending hydro data (density). */
struct
link
*
send_rho
;
/* Linked list for sending hydro data (gradient). */
struct
link
*
send_gradient
;
#endif
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
/*! Last (integer) time the cell's sort arrays were updated. */
/*! Last (integer) time the cell's sort arrays were updated. */
...
@@ -353,7 +339,7 @@ struct cell {
...
@@ -353,7 +339,7 @@ struct cell {
struct
{
struct
{
/*! Pointer to the #gpart data. */
/*! Pointer to the #gpart data. */
struct
gpart
*
g
parts
;
struct
gpart
*
parts
;
/*! This cell's multipole. */
/*! This cell's multipole. */
struct
gravity_tensors
*
multipole
;
struct
gravity_tensors
*
multipole
;
...
@@ -373,25 +359,25 @@ struct cell {
...
@@ -373,25 +359,25 @@ struct cell {
integertime_t
ti_beg_max
;
integertime_t
ti_beg_max
;
/*! Last (integer) time the cell's gpart were drifted forward in time. */
/*! Last (integer) time the cell's gpart were drifted forward in time. */
integertime_t
ti_old_
g
part
;
integertime_t
ti_old_part
;
/*! Last (integer) time the cell's multipole was drifted forward in time. */
/*! Last (integer) time the cell's multipole was drifted forward in time. */
integertime_t
ti_old_multipole
;
integertime_t
ti_old_multipole
;
/*! Nr of #gpart in this cell. */
/*! Nr of #gpart in this cell. */
int
g
count
;
int
count
;
/*! Spin lock for various uses (#gpart case). */
/*! Spin lock for various uses (#gpart case). */
swift_lock_type
g
lock
;
swift_lock_type
p
lock
;
/*! Spin lock for various uses (#multipole case). */
/*! Spin lock for various uses (#multipole case). */
swift_lock_type
mlock
;
swift_lock_type
mlock
;
/*! Number of #gpart updated in this cell. */
/*! Number of #gpart updated in this cell. */
int
g_
updated
;
int
updated
;
/*! Is the #gpart data of this cell being used in a sub-cell? */
/*! Is the #gpart data of this cell being used in a sub-cell? */
int
g
hold
;
int
p
hold
;
/*! Is the #multipole data of this cell being used in a sub-cell? */
/*! Is the #multipole data of this cell being used in a sub-cell? */
int
mhold
;
int
mhold
;
...
@@ -403,7 +389,7 @@ struct cell {
...
@@ -403,7 +389,7 @@ struct cell {
char
do_sub_drift
;
char
do_sub_drift
;
/*! The drift task for gparts */
/*! The drift task for gparts */
struct
task
*
drift
_gpart
;
struct
task
*
drift
;
/*! Linked list of the tasks computing this cell's gravity forces. */
/*! Linked list of the tasks computing this cell's gravity forces. */
struct
link
*
grav
;
struct
link
*
grav
;
...
@@ -432,45 +418,74 @@ struct cell {
...
@@ -432,45 +418,74 @@ struct cell {
/*! Number of M-M tasks that are associated with this cell. */
/*! Number of M-M tasks that are associated with this cell. */
short
int
nr_mm_tasks
;
short
int
nr_mm_tasks
;
#ifdef WITH_MPI
}
grav
;
/* Task receiving gpart data. */
struct
task
*
recv
;
/*
Linked list for sending gpart data.
*/
/*
! Stars variables
*/
struct
link
*
send
;
struct
{
#endif
/*! Pointer to the #spart data. */
struct
spart
*
parts
;
}
grav
;
/*! Nr of #spart in this cell. */
int
count
;
/*!
The first kick task
*/
/*!
Dependency implicit task for the star ghost (in->ghost->out)
*/
struct
task
*
kick1
;
struct
task
*
ghost_in
;
/*!
The second kick task
*/
/*!
Dependency implicit task for the star ghost (in->ghost->out)
*/
struct
task
*
kick2
;
struct
task
*
ghost_out
;
/*! The ta
sk to compute time-steps
*/
/*! The
s
ta
r ghost task itself
*/
struct
task
*
timestep
;
struct
task
*
ghost
;
/*!
Dependency implicit task for the star ghost (in->ghost->out)
*/
/*!
Linked list of the tasks computing this cell's star density.
*/
struct
task
*
stars_ghost_in
;
struct
link
*
density
;
/*!
Dependency implicit task for the star ghost (in->ghost->out)
*/
/*!
Number of #spart updated in this cell.
*/
struct
task
*
stars_ghost_out
;
int
updated
;
/*!
The star ghost task itself
*/
/*!
Is the #spart data of this cell being used in a sub-cell?
*/
struct
task
*
stars_ghost
;
int
hold
;
/*!
Linked list of the tasks computing this cell's star density
. */
/*!
Spin lock for various uses (#spart case)
. */
struct
link
*
stars_density
;
swift_lock_type
lock
;
/*! Task for source terms */
}
stars
;
struct
task
*
sourceterms
;
#ifdef WITH_MPI
#ifdef WITH_MPI
/*! MPI variables */
/*! MPI variables */
struct
{
struct
{
struct
{
/* Task receiving hydro data (positions). */
struct
task
*
recv_xv
;
/* Task receiving hydro data (density). */
struct
task
*
recv_rho
;
/* Task receiving hydro data (gradient). */
struct
task
*
recv_gradient
;
/* Linked list for sending hydro data (positions). */
struct
link
*
send_xv
;
/* Linked list for sending hydro data (density). */
struct
link
*
send_rho
;
/* Linked list for sending hydro data (gradient). */
struct
link
*
send_gradient
;
}
hydro
;
struct
{
/* Task receiving gpart data. */
struct
task
*
recv
;
/* Linked list for sending gpart data. */
struct
link
*
send
;
}
grav
;
/* Task receiving data (time-step). */
/* Task receiving data (time-step). */
struct
task
*
recv_ti
;
struct
task
*
recv_ti
;
...
@@ -492,27 +507,27 @@ struct cell {
...
@@ -492,27 +507,27 @@ struct cell {
}
mpi
;
}
mpi
;
#endif
#endif
/*!
Minimum dimension, i.e. smallest edge of this cell (min(width)).
*/
/*!
The first kick task
*/
float
dmin
;
struct
task
*
kick1
;
/*!
Nr of #spart in this cell.
*/
/*!
The second kick task
*/
int
scount
;
struct
task
*
kick2
;
/*! Spin lock for various uses (#spart case). */
/*! The task to compute time-steps */
swift_lock_type
slock
;
struct
task
*
timestep
;
/*! Task for source terms */
struct
task
*
sourceterms
;
/*! Minimum dimension, i.e. smallest edge of this cell (min(width)). */
float
dmin
;
/*! ID of the previous owner, e.g. runner. */
/*! ID of the previous owner, e.g. runner. */
int
owner
;
int
owner
;
/*! Number of #spart updated in this cell. */
int
s_updated
;
/*! ID of the node this cell lives on. */
/*! ID of the node this cell lives on. */
int
nodeID
;
int
nodeID
;
/*! Is the #spart data of this cell being used in a sub-cell? */
int
shold
;
/*! Number of tasks that are associated with this cell. */
/*! Number of tasks that are associated with this cell. */
short
int
nr_tasks
;
short
int
nr_tasks
;
...
@@ -622,7 +637,7 @@ cell_can_recurse_in_pair_hydro_task(const struct cell *c) {
...
@@ -622,7 +637,7 @@ cell_can_recurse_in_pair_hydro_task(const struct cell *c) {
/* smaller than the sub-cell sizes ? */
/* smaller than the sub-cell sizes ? */
/* Note: We use the _old values as these might have been updated by a drift */
/* Note: We use the _old values as these might have been updated by a drift */
return
c
->
split
&&
((
kernel_gamma
*
c
->
hydro
.
h_max_old
+
return
c
->
split
&&
((
kernel_gamma
*
c
->
hydro
.
h_max_old
+
c
->
hydro
.
dx_max_old
)
<
0
.
5
f
*
c
->
dmin
);
c
->
hydro
.
dx_max_
part_
old
)
<
0
.
5
f
*
c
->
dmin
);
}
}
/**
/**
...
@@ -766,7 +781,7 @@ __attribute__((always_inline)) INLINE static int cell_need_rebuild_for_pair(
...
@@ -766,7 +781,7 @@ __attribute__((always_inline)) INLINE static int cell_need_rebuild_for_pair(
/* moved larger than the cell size ? */
/* moved larger than the cell size ? */
/* Note ci->dmin == cj->dmin */
/* Note ci->dmin == cj->dmin */
return
(
kernel_gamma
*
max
(
ci
->
hydro
.
h_max
,
cj
->
hydro
.
h_max
)
+
return
(
kernel_gamma
*
max
(
ci
->
hydro
.
h_max
,
cj
->
hydro
.
h_max
)
+
ci
->
hydro
.
dx_max
+
cj
->
hydro
.
dx_max
>
ci
->
hydro
.
dx_max
_part
+
cj
->
hydro
.
dx_max
_part
>
cj
->
dmin
);
cj
->
dmin
);
}
}
...
...
src/debug.c
View file @
3d63d354
...
@@ -274,8 +274,8 @@ int checkCellhdxmax(const struct cell *c, int *depth) {
...
@@ -274,8 +274,8 @@ int checkCellhdxmax(const struct cell *c, int *depth) {
message
(
"location: %f %f %f"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
]);
message
(
"location: %f %f %f"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
]);
result
=
0
;
result
=
0
;
}
}
if
(
c
->
hydro
.
dx_max
!=
dx_max
)
{
if
(
c
->
hydro
.
dx_max
_part
!=
dx_max
)
{
message
(
"%d Inconsistent dx_max: %f != %f"
,
*
depth
,
c
->
hydro
.
dx_max
,
message
(
"%d Inconsistent dx_max: %f != %f"
,
*
depth
,
c
->
hydro
.
dx_max
_part
,
dx_max
);
dx_max
);
message
(
"location: %f %f %f"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
]);
message
(
"location: %f %f %f"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
]);
result
=
0
;
result
=
0
;
...
@@ -317,13 +317,13 @@ static void dumpCells_map(struct cell *c, void *data) {
...
@@ -317,13 +317,13 @@ static void dumpCells_map(struct cell *c, void *data) {
#endif
#endif