Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
n-body_methods
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
CodeVault
hpc-kernels
n-body_methods
Commits
e5589800
Commit
e5589800
authored
8 years ago
by
Thomas Steinreiter
Browse files
Options
Downloads
Patches
Plain Diff
simplified SendStore
parent
9273bae1
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bhtree_mpi/src/simulation/MpiSimulation.cpp
+3
-6
3 additions, 6 deletions
bhtree_mpi/src/simulation/MpiSimulation.cpp
bhtree_mpi/src/simulation/MpiSimulation.hpp
+1
-1
1 addition, 1 deletion
bhtree_mpi/src/simulation/MpiSimulation.hpp
with
4 additions
and
7 deletions
bhtree_mpi/src/simulation/MpiSimulation.cpp
+
3
−
6
View file @
e5589800
...
...
@@ -86,11 +86,8 @@ namespace nbody {
//mpi send wrapper
void
MpiSimulation
::
send
(
std
::
vector
<
Body
>&&
bodies
,
int
target
)
{
const
auto
bodySize
=
bodies
.
size
();
//do unblocking send
auto
store
=
std
::
make_unique
<
SendStore
>
(
std
::
move
(
bodies
));
//TODO(steinret): ask ponweist if this could be done w/o unique_ptr
MPI_Isend
(
store
->
bodies
.
data
(),
bodySize
,
bodyType
,
target
,
0
,
MPI_COMM_WORLD
,
&
store
->
request
);
SendStore
store
{
std
::
move
(
bodies
)
};
MPI_Isend
(
store
.
bodies
.
data
(),
bodySize
,
bodyType
,
target
,
0
,
MPI_COMM_WORLD
,
&
store
.
request
);
sendStores
.
push_back
(
std
::
move
(
store
));
}
...
...
@@ -179,7 +176,7 @@ namespace nbody {
void
MpiSimulation
::
flushSendStore
()
{
std
::
vector
<
MPI_Request
>
requests
;
std
::
transform
(
std
::
begin
(
sendStores
),
std
::
end
(
sendStores
),
std
::
back_inserter
(
requests
),
[](
const
std
::
unique_ptr
<
SendStore
>
&
ss
)
{
return
ss
->
request
;
});
std
::
transform
(
std
::
begin
(
sendStores
),
std
::
end
(
sendStores
),
std
::
back_inserter
(
requests
),
[](
const
SendStore
&
ss
)
{
return
ss
.
request
;
});
MPI_Waitall
(
requests
.
size
(),
requests
.
data
(),
MPI_STATUSES_IGNORE
);
sendStores
.
clear
();
}
...
...
This diff is collapsed.
Click to expand it.
bhtree_mpi/src/simulation/MpiSimulation.hpp
+
1
−
1
View file @
e5589800
...
...
@@ -23,7 +23,7 @@ namespace nbody {
MPI_Datatype
boxType
{
MPI_DATATYPE_NULL
};
std
::
vector
<
Box
>
domains
;
Box
overallDomain
;
std
::
vector
<
std
::
unique_ptr
<
SendStore
>
>
sendStores
;
std
::
vector
<
SendStore
>
sendStores
;
void
flushSendStore
();
virtual
void
send
(
std
::
vector
<
Body
>&&
bodies
,
int
target
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
register
or
sign in
to comment