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
TurTLE
TurTLE
Commits
129baa7d
Commit
129baa7d
authored
Mar 05, 2021
by
Cristian Lalescu
Browse files
replaces init method with "set_to_zero" function
parent
267ff8fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
cpp/particles/p2p/p2p_distr_mpi.hpp
View file @
129baa7d
...
...
@@ -675,9 +675,9 @@ public:
// allocate rhs buffer
descriptor
.
results
.
reset
(
new
real_number
[
NbParticlesToReceive
*
size_particle_rhs
]);
// clean up rhs buffer
s
td
::
fill_n
(
descriptor
.
results
.
get
(),
NbParticlesToReceive
*
size_particle_rhs
,
0
);
// precompute rhs buffer (?)
computer_thread
.
template
init_result_array
<
size_particle_rhs
>(
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
s
et_particle_data_to_zero
<
partsize_t
,
real_number
,
size_particle_rhs
>
(
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
// Compute
partsize_t
idxPart
=
0
;
...
...
cpp/particles/particles_distr_mpi.hpp
View file @
129baa7d
...
...
@@ -413,11 +413,19 @@ public:
const
partsize_t
NbParticlesToReceive
=
descriptor
.
nbParticlesToRecv
;
assert
(
descriptor
.
toCompute
!=
nullptr
);
// allocate buffer
descriptor
.
results
.
reset
(
new
real_number
[
NbParticlesToReceive
*
size_particle_rhs
]);
in_computer
.
template
init_result_array
<
size_particle_rhs
>(
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
// clean up buffer
set_particle_data_to_zero
<
partsize_t
,
real_number
,
size_particle_rhs
>
(
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
if
(
more_than_one_thread
==
false
){
in_computer
.
template
apply_computation
<
field_class
,
size_particle_positions
,
size_particle_rhs
>(
in_field
,
descriptor
.
toCompute
.
get
(),
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
in_computer
.
template
apply_computation
<
field_class
,
size_particle_positions
,
size_particle_rhs
>(
in_field
,
descriptor
.
toCompute
.
get
(),
descriptor
.
results
.
get
(),
NbParticlesToReceive
);
}
else
{
TIMEZONE_OMP_INIT_PRETASK
(
timeZoneTaskKey
)
...
...
cpp/particles/particles_utils.hpp
View file @
129baa7d
...
...
@@ -398,4 +398,19 @@ std::vector<real_number> BuildLimitsAllProcesses(
return
spatial_limit_per_proc
;
}
#endif
template
<
typename
partsize_t
,
typename
rnumber
,
int
size_of_particle
>
int
set_particle_data_to_zero
(
rnumber
__restrict__
*
data
,
const
partsize_t
numberParticles
)
{
// TODO: ensure simd.
// don't use openmp here, as this function may be called from within openmp parallel regions
std
::
fill_n
(
data
,
numberParticles
*
size_of_particle
,
0
);
return
EXIT_SUCCESS
;
}
#endif//PARTICLES_UTILS_HPP
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