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
ec967016
Commit
ec967016
authored
8 years ago
by
Paul Heinzlreiter
Browse files
Options
Downloads
Patches
Plain Diff
* working communication
parent
e344bc7c
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bh_tree_mpi/parallelization/MpiBodyComm.cpp
+15
-5
15 additions, 5 deletions
bh_tree_mpi/parallelization/MpiBodyComm.cpp
with
15 additions
and
5 deletions
bh_tree_mpi/parallelization/MpiBodyComm.cpp
+
15
−
5
View file @
ec967016
...
...
@@ -27,6 +27,7 @@ namespace nbody {
int
currentSize
;
bodies
.
clear
();
//TODO: change to .Probe
while
(
!
MPI
::
COMM_WORLD
.
Iprobe
(
source
,
0
,
status
));
currentSource
=
status
.
Get_source
();
currentSize
=
status
.
Get_count
(
*
(
this
->
datatype
));
...
...
@@ -227,20 +228,29 @@ namespace nbody {
*/
void
MpiBodyComm
::
testing
(
vector
<
Body
>&
data
,
int
myRank
)
{
Body
b
[
4
];
vector
<
Body
>
vb
;
//
Body b[4];
//
vector<Body> vb;
/*
for (int i = 0; i < 4; i++) {
vb.push_back(b[i]);
}
*/
if
(
myRank
==
0
)
{
//MPI::COMM_WORLD.Send(b, 4, *this->datatype, 1, 0);
MPI
::
COMM_WORLD
.
Send
(
&
vb
[
0
],
4
,
*
this
->
datatype
,
1
,
0
);
MPI
::
COMM_WORLD
.
Send
(
&
data
[
0
],
data
.
size
()
,
*
this
->
datatype
,
1
,
0
);
}
else
if
(
myRank
==
1
)
{
//MPI::COMM_WORLD.Recv(b, 4, *this->datatype, 0, 0);
vb
.
resize
(
4
);
MPI
::
COMM_WORLD
.
Recv
(
&
vb
[
0
],
4
,
*
this
->
datatype
,
0
,
0
);
MPI
::
Status
status
;
vector
<
Body
>
vb
;
MPI
::
COMM_WORLD
.
Probe
(
0
,
0
,
status
);
vb
.
resize
(
status
.
Get_count
(
*
this
->
datatype
));
MPI
::
COMM_WORLD
.
Recv
(
&
vb
[
0
],
status
.
Get_count
(
*
this
->
datatype
),
*
this
->
datatype
,
0
,
0
);
cout
<<
"SIZE: "
<<
vb
.
size
()
<<
endl
;
for
(
int
i
=
0
;
i
<
vb
.
size
();
i
++
)
{
vb
[
i
].
print
();
}
}
//MPI::Datatype btype = MPI::DATATYPE_NULL;
//int bodySize = data.size();
...
...
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