Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Show more breadcrumbs
multiscale
lammps
Commits
8e75616c
Commit
8e75616c
authored
8 years ago
by
Tim Mattox
Browse files
Options
Downloads
Patches
Plain Diff
In irregular.cpp use simpler and slightly faster MPI_Reduce_scatter_block()
parent
411c069b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/irregular.cpp
+2
-6
2 additions, 6 deletions
src/irregular.cpp
with
2 additions
and
6 deletions
src/irregular.cpp
+
2
−
6
View file @
8e75616c
...
...
@@ -297,11 +297,9 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
// setup for collective comm
// work1 = 1 for procs I send a message to, not including self
// work2 = 1 for all procs, used for ReduceScatter
for
(
i
=
0
;
i
<
nprocs
;
i
++
)
{
work1
[
i
]
=
0
;
work2
[
i
]
=
1
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
work1
[
proclist
[
i
]]
=
1
;
work1
[
me
]
=
0
;
...
...
@@ -318,7 +316,7 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
MPI_Allreduce
(
work1
,
work2
,
nprocs
,
MPI_INT
,
MPI_SUM
,
world
);
nrecv_proc
=
work2
[
me
];
#else
MPI_Reduce_scatter
(
work1
,
&
nrecv_proc
,
work2
,
MPI_INT
,
MPI_SUM
,
world
);
MPI_Reduce_scatter
_block
(
work1
,
&
nrecv_proc
,
1
,
MPI_INT
,
MPI_SUM
,
world
);
#endif
#endif
...
...
@@ -545,11 +543,9 @@ int Irregular::create_data(int n, int *proclist, int sortflag)
// setup for collective comm
// work1 = 1 for procs I send a message to, not including self
// work2 = 1 for all procs, used for ReduceScatter
for
(
i
=
0
;
i
<
nprocs
;
i
++
)
{
work1
[
i
]
=
0
;
work2
[
i
]
=
1
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
work1
[
proclist
[
i
]]
=
1
;
work1
[
me
]
=
0
;
...
...
@@ -566,7 +562,7 @@ int Irregular::create_data(int n, int *proclist, int sortflag)
MPI_Allreduce
(
work1
,
work2
,
nprocs
,
MPI_INT
,
MPI_SUM
,
world
);
nrecv_proc
=
work2
[
me
];
#else
MPI_Reduce_scatter
(
work1
,
&
nrecv_proc
,
work2
,
MPI_INT
,
MPI_SUM
,
world
);
MPI_Reduce_scatter
_block
(
work1
,
&
nrecv_proc
,
1
,
MPI_INT
,
MPI_SUM
,
world
);
#endif
#endif
...
...
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