Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
354bf527
Commit
354bf527
authored
Mar 28, 2021
by
Cristian Lalescu
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugfix/issue38' into bugfix/particle_subsample
parents
46cf3221
27aaae5d
No related branches found
No related tags found
1 merge request
!31
particle_subsample
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpp/particles/p2p/p2p_distr_mpi.hpp
+38
-12
38 additions, 12 deletions
cpp/particles/p2p/p2p_distr_mpi.hpp
cpp/particles/particles_utils.hpp
+2
-2
2 additions, 2 deletions
cpp/particles/particles_utils.hpp
with
40 additions
and
14 deletions
cpp/particles/p2p/p2p_distr_mpi.hpp
+
38
−
12
View file @
354bf527
...
@@ -96,9 +96,9 @@ protected:
...
@@ -96,9 +96,9 @@ protected:
std
::
array
<
real_number
,
3
>
spatial_box_width
;
std
::
array
<
real_number
,
3
>
spatial_box_width
;
std
::
array
<
real_number
,
3
>
spatial_box_offset
;
std
::
array
<
real_number
,
3
>
spatial_box_offset
;
const
real_number
cutoff_radius_compute
;
const
long
double
cutoff_radius_compute
;
const
int
nb_cells_factor
;
const
int
nb_cells_factor
;
const
real_number
cutoff_radius
;
const
long
double
cutoff_radius
;
std
::
array
<
long
int
,
3
>
nb_cell_levels
;
std
::
array
<
long
int
,
3
>
nb_cell_levels
;
template
<
class
DataType
,
int
sizeElement
>
template
<
class
DataType
,
int
sizeElement
>
...
@@ -291,6 +291,7 @@ public:
...
@@ -291,6 +291,7 @@ public:
// Some processes might not be involved
// Some processes might not be involved
if
(
nb_processes_involved
<=
my_rank
){
if
(
nb_processes_involved
<=
my_rank
){
DEBUG_MSG
(
"warning: nb_processes_involved <= my_rank, and this process is exiting p2p_distr_mpi::compute_distr now.
\n
However, there is a check below which calls an MPI_Gather over MPI_COMM_WORLD.
\n
"
);
return
;
return
;
}
}
...
@@ -492,10 +493,14 @@ public:
...
@@ -492,10 +493,14 @@ public:
if
(
descriptor
.
isRecv
==
false
){
if
(
descriptor
.
isRecv
==
false
){
whatNext
.
emplace_back
(
std
::
pair
<
Action
,
int
>
{
NOTHING_TODO
,
-
1
});
whatNext
.
emplace_back
(
std
::
pair
<
Action
,
int
>
{
NOTHING_TODO
,
-
1
});
mpiRequests
.
emplace_back
();
mpiRequests
.
emplace_back
();
AssertMpi
(
MPI_Isend
(
const_cast
<
partsize_t
*>
(
&
descriptor
.
nbParticlesToExchange
),
AssertMpi
(
MPI_Isend
(
1
,
particles_utils
::
GetMpiType
(
partsize_t
()),
const_cast
<
partsize_t
*>
(
&
descriptor
.
nbParticlesToExchange
),
descriptor
.
destProc
,
TAG_NB_PARTICLES
,
1
,
current_com
,
&
mpiRequests
.
back
()));
particles_utils
::
GetMpiType
(
partsize_t
()),
descriptor
.
destProc
,
TAG_NB_PARTICLES
,
current_com
,
&
mpiRequests
.
back
()));
#ifndef NDEBUG // Just for assertion
#ifndef NDEBUG // Just for assertion
willsend
[
descriptor
.
destProc
]
+=
1
;
willsend
[
descriptor
.
destProc
]
+=
1
;
#endif
#endif
...
@@ -570,21 +575,42 @@ public:
...
@@ -570,21 +575,42 @@ public:
MPI_INT
,
MPI_INT
,
0
,
0
,
MPI_COMM_WORLD
);
MPI_COMM_WORLD
);
MPI_Gather
(
willsend
.
data
(),
nb_processes_involved
,
MPI_INT
,
willsendall
.
data
(),
MPI_Gather
(
willsend
.
data
(),
nb_processes_involved
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
nb_processes_involved
,
MPI_INT
,
willsendall
.
data
(),
nb_processes_involved
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
for
(
int
idxproc
=
0
;
idxproc
<
nb_processes_involved
;
++
idxproc
){
for
(
int
idxproc
=
0
;
idxproc
<
nb_processes_involved
;
++
idxproc
){
for
(
int
idxtest
=
0
;
idxtest
<
nb_processes_involved
;
++
idxtest
){
for
(
int
idxtest
=
0
;
idxtest
<
nb_processes_involved
;
++
idxtest
){
DEBUG_MSG
(
"p2p_distr_mpi::compute_distribution, comparing willsendall(%d, %d)=%d with willrecvall(%d, %d) = %d
\n
"
,
idxproc
,
idxtest
,
willsendall
[
idxproc
*
nb_processes_involved
+
idxtest
],
idxtest
,
idxproc
,
willrecvall
[
idxtest
*
nb_processes_involved
+
idxproc
]);
assert
(
willsendall
[
idxproc
*
nb_processes_involved
+
idxtest
]
assert
(
willsendall
[
idxproc
*
nb_processes_involved
+
idxtest
]
==
willrecvall
[
idxtest
*
nb_processes_involved
+
idxproc
]);
==
willrecvall
[
idxtest
*
nb_processes_involved
+
idxproc
]);
}
}
}
}
}
}
else
{
else
{
MPI_Gather
(
willrecv
.
data
(),
nb_processes_involved
,
MPI_INT
,
nullptr
,
MPI_Gather
(
willrecv
.
data
(),
0
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
nb_processes_involved
,
MPI_Gather
(
willsend
.
data
(),
nb_processes_involved
,
MPI_INT
,
nullptr
,
MPI_INT
,
0
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
nullptr
,
0
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Gather
(
willsend
.
data
(),
nb_processes_involved
,
MPI_INT
,
nullptr
,
0
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
}
}
}
}
#endif
#endif
...
...
...
...
This diff is collapsed.
Click to expand it.
cpp/particles/particles_utils.hpp
+
2
−
2
View file @
354bf527
...
@@ -400,11 +400,11 @@ std::vector<real_number> BuildLimitsAllProcesses(
...
@@ -400,11 +400,11 @@ std::vector<real_number> BuildLimitsAllProcesses(
template
<
typename
partsize_t
,
typename
rnumber
,
int
size_of_particle
>
template
<
typename
partsize_t
,
typename
rnumber
,
int
size_of_particle
>
int
set_particle_data_to_zero
(
int
set_particle_data_to_zero
(
rnumber
__restrict__
*
data
,
rnumber
*
data
,
// TODO: this should be "restrict", but intel can't handle it.
const
partsize_t
numberParticles
)
const
partsize_t
numberParticles
)
{
{
// TODO: ensure simd.
// TODO: ensure simd.
// don't use openmp here, as this function
may
be called from within openmp parallel regions
// don't use openmp here, as this function
WILL
be called from within openmp parallel regions
std
::
fill_n
(
std
::
fill_n
(
data
,
data
,
numberParticles
*
size_of_particle
,
numberParticles
*
size_of_particle
,
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment