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
Sten Delos
Gadget4
Commits
2d2fcea8
Commit
2d2fcea8
authored
Oct 08, 2020
by
Oliver Zier
Browse files
Fix init_entropy by adding synchronization
parent
16e5bffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pm/pm_periodic.cc
View file @
2d2fcea8
...
...
@@ -253,7 +253,6 @@ void pm_periodic::pmforce_zoom_optimized_prepare_density(int mode, int *typelist
large_numpart_type
num_on_grid
=
((
large_numpart_type
)
NSource
)
<<
3
;
/* bring the part-field into the order of the accessed cells. This allows the removal of duplicates */
// mycxxsort(part_sortindex, part_sortindex + num_on_grid, pm_periodic_compare_sortindex, part);
mycxxsort
(
part_sortindex
,
part_sortindex
+
num_on_grid
,
pm_periodic_sortindex_comparator
(
part
));
...
...
src/sph/init_entropy.cc
View file @
2d2fcea8
...
...
@@ -78,21 +78,41 @@ void sph::init_entropy(void)
Foreign_Points
=
(
foreign_sphpoint_data
*
)
Mem
.
mymalloc_movable
(
&
Foreign_Points
,
"Foreign_Points"
,
MaxForeignPoints
*
sizeof
(
foreign_sphpoint_data
));
tree_initialize_leaf_node_access_info
();
max_ncycles
=
0
;
prepare_shared_memory_access
();
double
tstart
=
Logs
.
second
();
int
global_left_particles
=
0
;
MPI_Allreduce
(
&
ndensities
,
&
global_left_particles
,
1
,
MPI_INT
,
MPI_SUM
,
D
->
Communicator
);
do
{
double
t0
=
Logs
.
second
();
/* Since EntropyToInvGammaPred of remote particles can change, we have to import the particles in every iteration */
MaxForeignNodes
=
nspace
;
MaxForeignPoints
=
8
*
nspace
;
NumForeignNodes
=
0
;
NumForeignPoints
=
0
;
sum_NumForeignNodes
=
0
;
sum_NumForeignPoints
=
0
;
tree_initialize_leaf_node_access_info
();
max_ncycles
=
0
;
prepare_shared_memory_access
();
/* now do the primary work with this call */
densities_determine
(
ndensities
,
targetList
);
MPI_Allreduce
(
MPI_IN_PLACE
,
&
max_ncycles
,
1
,
MPI_INT
,
MPI_MAX
,
D
->
Communicator
);
cleanup_shared_memory_access
();
/* do final operations on results */
double
entropy_old
;
...
...
@@ -132,6 +152,8 @@ void sph::init_entropy(void)
ndensities
=
npleft
;
MPI_Allreduce
(
&
ndensities
,
&
global_left_particles
,
1
,
MPI_INT
,
MPI_SUM
,
D
->
Communicator
);
double
t1
=
Logs
.
second
();
if
(
npleft
>
0
)
...
...
@@ -147,13 +169,11 @@ void sph::init_entropy(void)
else
D
->
mpi_printf
(
"SPH-INIT-ENTROPY: ngb iteration %4d: took %8.3f
\n
"
,
++
iter
,
Logs
.
timediff
(
t0
,
t1
));
}
while
(
ndensiti
es
>
0
);
while
(
global_left_particl
es
>
0
);
MPI_Allreduce
(
MPI_IN_PLACE
,
&
max_ncycles
,
1
,
MPI_INT
,
MPI_MAX
,
D
->
Communicator
);
TIMER_STOP
(
CPU_DENSITY
);
cleanup_shared_memory_access
();
/* free temporary buffers */
...
...
Write
Preview
Markdown
is supported
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