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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
1c1e2d4d
Commit
1c1e2d4d
authored
Dec 10, 2015
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added the parallel sorting tasks.
parent
18988f2d
No related branches found
No related tags found
2 merge requests
!136
Master
,
!79
First version of the multiple time-stepping
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+12
-0
12 additions, 0 deletions
src/engine.c
with
12 additions
and
0 deletions
src/engine.c
+
12
−
0
View file @
1c1e2d4d
...
@@ -1063,6 +1063,11 @@ void engine_maketasks(struct engine *e) {
...
@@ -1063,6 +1063,11 @@ void engine_maketasks(struct engine *e) {
/* Re-set the scheduler. */
/* Re-set the scheduler. */
scheduler_reset
(
sched
,
s
->
tot_cells
*
engine_maxtaskspercell
);
scheduler_reset
(
sched
,
s
->
tot_cells
*
engine_maxtaskspercell
);
/* Add the space sorting tasks. */
for
(
i
=
0
;
i
<
e
->
nr_threads
;
i
++
)
scheduler_addtask
(
sched
,
task_type_psort
,
task_subtype_none
,
i
,
0
,
NULL
,
NULL
,
0
);
/* Run through the highest level of cells and add pairs. */
/* Run through the highest level of cells and add pairs. */
for
(
i
=
0
;
i
<
cdim
[
0
];
i
++
)
for
(
i
=
0
;
i
<
cdim
[
0
];
i
++
)
for
(
j
=
0
;
j
<
cdim
[
1
];
j
++
)
for
(
j
=
0
;
j
<
cdim
[
1
];
j
++
)
...
@@ -2268,6 +2273,13 @@ void engine_init(struct engine *e, struct space *s, float dt, int nr_threads,
...
@@ -2268,6 +2273,13 @@ void engine_init(struct engine *e, struct space *s, float dt, int nr_threads,
scheduler_init
(
&
e
->
sched
,
e
->
s
,
nr_queues
,
scheduler_flag_steal
,
e
->
nodeID
);
scheduler_init
(
&
e
->
sched
,
e
->
s
,
nr_queues
,
scheduler_flag_steal
,
e
->
nodeID
);
s
->
nr_queues
=
nr_queues
;
s
->
nr_queues
=
nr_queues
;
/* Create the sorting tasks. */
for
(
i
=
0
;
i
<
e
->
nr_threads
;
i
++
)
scheduler_addtask
(
&
e
->
sched
,
task_type_psort
,
task_subtype_none
,
i
,
0
,
NULL
,
NULL
,
0
);
scheduler_ranktasks
(
&
e
->
sched
);
/* Allocate and init the threads. */
/* Allocate and init the threads. */
if
((
e
->
runners
=
if
((
e
->
runners
=
(
struct
runner
*
)
malloc
(
sizeof
(
struct
runner
)
*
nr_threads
))
==
NULL
)
(
struct
runner
*
)
malloc
(
sizeof
(
struct
runner
)
*
nr_threads
))
==
NULL
)
...
...
...
...
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
sign in
to comment