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
fb4df86d
Unverified
Commit
fb4df86d
authored
6 years ago
by
Axel Kohlmeyer
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1170 from akohlmey/fix-merge-sort
Bug fix for merge sort by Jeffrey Frey
parents
21661f84
da38ae03
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lmptype.h
+0
-7
0 additions, 7 deletions
src/lmptype.h
src/mergesort.h
+5
-1
5 additions, 1 deletion
src/mergesort.h
with
5 additions
and
8 deletions
src/lmptype.h
+
0
−
7
View file @
fb4df86d
...
...
@@ -46,13 +46,6 @@
#define PRId64 "ld"
#endif
// favor qsort over mergesort for stable release
// TODO: to be removed after stable release
#ifndef LMP_QSORT
#define LMP_QSORT
#endif
namespace
LAMMPS_NS
{
// enum used for KOKKOS host/device flags
...
...
This diff is collapsed.
Click to expand it.
src/mergesort.h
+
5
−
1
View file @
fb4df86d
...
...
@@ -98,7 +98,7 @@ static void merge_sort(int *index, int num, void *ptr,
int
*
tmp
=
dest
;
dest
=
hold
;
hold
=
tmp
;
// merge from hold array to destiation array
// merge from hold array to desti
n
ation array
for
(
i
=
0
;
i
<
num
-
1
;
i
+=
2
*
chunk
)
{
j
=
i
+
2
*
chunk
;
...
...
@@ -107,6 +107,10 @@ static void merge_sort(int *index, int num, void *ptr,
if
(
m
>
num
)
m
=
num
;
do_merge
(
dest
,
hold
,
i
,
m
,
m
,
j
,
ptr
,
comp
);
}
// copy all indices not handled by the chunked merge sort loop
for
(
;
i
<
num
;
i
++
)
dest
[
i
]
=
hold
[
i
];
chunk
*=
2
;
}
...
...
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