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
962dc908
Commit
962dc908
authored
8 years ago
by
Paul Heinzlreiter
Browse files
Options
Downloads
Patches
Plain Diff
* added descriptive output of current program phases being executed
parent
85c7de09
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/mpimain.cpp
+10
-0
10 additions, 0 deletions
bhtree_mpi/src/mpimain.cpp
bhtree_mpi/src/simulation/MpiSimulation.cpp
+11
-5
11 additions, 5 deletions
bhtree_mpi/src/simulation/MpiSimulation.cpp
with
21 additions
and
5 deletions
bhtree_mpi/src/mpimain.cpp
+
10
−
0
View file @
962dc908
...
...
@@ -20,13 +20,23 @@ int main(int argc, char* argv[]) {
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
//initialize and load particles
cout
<<
" "
<<
"rank "
<<
rank
<<
": initialize..."
<<
endl
;
if
(
rank
==
0
)
{
cout
<<
" "
<<
"rank 0: load particles ..."
<<
endl
;
}
simulation
.
initialize
(
string
(
argv
[
1
]));
//initial particle and domain distribution
if
(
rank
==
0
)
{
cout
<<
" "
<<
"rank 0: distribute particles to other processes ..."
<<
endl
;
}
simulation
.
distributeBodies
();
cout
<<
" "
<<
"rank "
<<
rank
<<
": distributing initial domains to other processes ..."
<<
endl
;
simulation
.
distributeDomains
();
cout
<<
" "
<<
"rank "
<<
rank
<<
": building initial trees ..."
<<
endl
;
simulation
.
buildTree
();
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
//local tree is built and correct domains are distributed
cout
<<
"running simulation step "
<<
i
<<
" ..."
<<
endl
;
simulation
.
runStep
();
}
simulation
.
cleanup
();
...
...
This diff is collapsed.
Click to expand it.
bhtree_mpi/src/simulation/MpiSimulation.cpp
+
11
−
5
View file @
962dc908
...
...
@@ -61,11 +61,13 @@ namespace nbody {
this
->
correctState
=
true
;
this
->
tree
=
new
BarnesHutTree
(
this
->
parallelRank
);
//parse input data
if
(
!
inputFile
.
empty
())
{
this
->
correctState
=
this
->
readInputData
(
inputFile
);
}
else
{
this
->
correctState
=
false
;
if
(
this
->
parallelRank
==
0
)
{
//parse input data
if
(
!
inputFile
.
empty
())
{
this
->
correctState
=
this
->
readInputData
(
inputFile
);
}
else
{
this
->
correctState
=
false
;
}
}
//broadcast current state and terminate if input file cannot be read
MPI_Bcast
(
&
this
->
correctState
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
...
...
@@ -260,12 +262,16 @@ namespace nbody {
//tree is already built here
//distribute local bodies needed by remote processes
cout
<<
" "
<<
"rank "
<<
this
->
parallelRank
<<
": distribute local particles required for remote simulation ..."
<<
endl
;
this
->
distributeLETs
();
//force computation
cout
<<
" "
<<
"rank "
<<
this
->
parallelRank
<<
": compute forces ..."
<<
endl
;
this
->
tree
->
computeForces
();
//advance/move particles and distribute updated domain to other processes
cout
<<
" "
<<
"rank "
<<
this
->
parallelRank
<<
": move particles and redistribute simulation domains ..."
<<
endl
;
this
->
distributeDomains
(
this
->
tree
->
advance
());
//rebuild tree with new particle positions
cout
<<
" "
<<
"rank "
<<
this
->
parallelRank
<<
": rebuild tree with new particle positions ..."
<<
endl
;
this
->
rebuildTree
();
if
(
!
this
->
tree
->
isCorrect
())
{
cerr
<<
"wrong tree"
<<
endl
;
...
...
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