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
9b8de3ba
Commit
9b8de3ba
authored
7 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
remove ifdefs for selecting between plain and hybrid merge sort. use hybrid only.
parent
c1b0b1b3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mergesort.h
+0
-14
0 additions, 14 deletions
src/mergesort.h
with
0 additions
and
14 deletions
src/mergesort.h
+
0
−
14
View file @
9b8de3ba
...
@@ -22,13 +22,6 @@
...
@@ -22,13 +22,6 @@
// for improved performance, we employ an in-place insertion sort on
// for improved performance, we employ an in-place insertion sort on
// chunks of up to 64 elements and switch to merge sort from then on.
// chunks of up to 64 elements and switch to merge sort from then on.
// compile with -DLMP_USE_MERGE_SORT to switch to a plain merge sort
#if !defined(LMP_USE_MERGE_SORT) && !defined(LMP_USE_HYBRID_SORT)
#define LMP_USE_HYBRID_SORT
#endif
#if defined(LMP_USE_HYBRID_SORT)
// part 1. insertion sort for pre-sorting of small chunks
// part 1. insertion sort for pre-sorting of small chunks
static
void
insertion_sort
(
int
*
index
,
int
num
,
void
*
ptr
,
static
void
insertion_sort
(
int
*
index
,
int
num
,
void
*
ptr
,
...
@@ -48,7 +41,6 @@ static void insertion_sort(int *index, int num, void *ptr,
...
@@ -48,7 +41,6 @@ static void insertion_sort(int *index, int num, void *ptr,
}
}
}
}
}
}
#endif
// part 2. merge two sublists
// part 2. merge two sublists
...
@@ -78,8 +70,6 @@ static void merge_sort(int *index, int num, void *ptr,
...
@@ -78,8 +70,6 @@ static void merge_sort(int *index, int num, void *ptr,
int
chunk
,
i
,
j
;
int
chunk
,
i
,
j
;
#if defined(LMP_USE_HYBRID_SORT)
// do insertion sort on chunks of up to 64 elements
// do insertion sort on chunks of up to 64 elements
chunk
=
64
;
chunk
=
64
;
...
@@ -92,10 +82,6 @@ static void merge_sort(int *index, int num, void *ptr,
...
@@ -92,10 +82,6 @@ static void merge_sort(int *index, int num, void *ptr,
if
(
chunk
>=
num
)
return
;
if
(
chunk
>=
num
)
return
;
#else
chunk
=
1
;
#endif
// continue with merge sort on the pre-sorted chunks.
// continue with merge sort on the pre-sorted chunks.
// we need an extra buffer for temporary storage and two
// we need an extra buffer for temporary storage and two
// pointers to operate on, so we can swap the pointers
// pointers to operate on, so we can swap the pointers
...
...
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