Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
76f78333
Commit
76f78333
authored
7 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into restart-structs
parents
c0776a82
137ab111
No related branches found
No related tags found
1 merge request
!491
Add restart facility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/main.c
+16
-14
16 additions, 14 deletions
examples/main.c
with
16 additions
and
14 deletions
examples/main.c
+
16
−
14
View file @
76f78333
...
...
@@ -654,10 +654,11 @@ int main(int argc, char *argv[]) {
N_total
[
1
]
=
Ngpart
;
N_total
[
2
]
=
Nspart
;
#endif
if
(
myrank
==
0
)
message
(
"Read %lld gas particles, %lld star particles and "
"
%lld gparts from the
ICs."
,
"Read %lld gas particles, %lld star particles and
%lld gparts from the
"
"ICs."
,
N_total
[
0
],
N_total
[
2
],
N_total
[
1
]);
/* Initialize the space with these data. */
...
...
@@ -673,6 +674,19 @@ int main(int argc, char *argv[]) {
fflush
(
stdout
);
}
/* Also update the total counts (in case of changes due to replication) */
#if defined(WITH_MPI)
N_long
[
0
]
=
s
.
nr_parts
;
N_long
[
1
]
=
s
.
nr_gparts
;
N_long
[
2
]
=
s
.
nr_sparts
;
MPI_Allreduce
(
&
N_long
,
&
N_total
,
3
,
MPI_LONG_LONG_INT
,
MPI_SUM
,
MPI_COMM_WORLD
);
#else
N_total
[
0
]
=
s
.
nr_parts
;
N_total
[
1
]
=
s
.
nr_gparts
;
N_total
[
2
]
=
s
.
nr_sparts
;
#endif
/* Say a few nice things about the space we just created. */
if
(
myrank
==
0
)
{
message
(
"space dimensions are [ %.3f %.3f %.3f ]."
,
s
.
dim
[
0
],
s
.
dim
[
1
],
...
...
@@ -751,18 +765,6 @@ int main(int argc, char *argv[]) {
fflush
(
stdout
);
}
#if defined(WITH_MPI)
N_long
[
0
]
=
s
.
nr_parts
;
N_long
[
1
]
=
s
.
nr_gparts
;
N_long
[
2
]
=
s
.
nr_sparts
;
MPI_Reduce
(
&
N_long
,
&
N_total
,
3
,
MPI_LONG_LONG_INT
,
MPI_SUM
,
0
,
MPI_COMM_WORLD
);
#else
N_total
[
0
]
=
s
.
nr_parts
;
N_total
[
1
]
=
s
.
nr_gparts
;
N_total
[
2
]
=
s
.
nr_sparts
;
#endif
/* Get some info to the user. */
if
(
myrank
==
0
)
{
long
long
N_DM
=
N_total
[
1
]
-
N_total
[
2
]
-
N_total
[
0
];
...
...
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
register
or
sign in
to comment