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
e00fb2f4
Commit
e00fb2f4
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
made engine_count_and_link_tasks parallel with the threadpool, required some minor fixes.
parent
a84a7a88
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!176
Tasks cleanup
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/engine.c
+0
-1
0 additions, 1 deletion
src/engine.c
src/scheduler.c
+0
-3
0 additions, 3 deletions
src/scheduler.c
src/task.c
+1
-1
1 addition, 1 deletion
src/task.c
src/threadpool.c
+1
-3
1 addition, 3 deletions
src/threadpool.c
with
2 additions
and
8 deletions
src/engine.c
+
0
−
1
View file @
e00fb2f4
...
...
@@ -1456,7 +1456,6 @@ void engine_maketasks(struct engine *e) {
of its super-cell. */
threadpool_map
(
&
e
->
threadpool
,
engine_make_extra_hydroloop_tasks_mapper
,
sched
->
tasks
,
sched
->
nr_tasks
,
sizeof
(
struct
task
),
e
);
// engine_make_extra_hydroloop_tasks(e);
/* Add the communication tasks if MPI is being used. */
if
(
e
->
policy
&
engine_policy_mpi
)
{
...
...
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
0
−
3
View file @
e00fb2f4
...
...
@@ -729,15 +729,12 @@ void scheduler_set_unlocks(struct scheduler *s) {
offsets
[
0
]
=
0
;
for
(
int
k
=
1
;
k
<
s
->
nr_tasks
;
k
++
)
offsets
[
k
]
=
offsets
[
k
-
1
]
+
counts
[
k
-
1
];
for
(
int
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
for
(
int
j
=
offsets
[
k
];
j
<
offsets
[
k
+
1
];
j
++
)
s
->
unlock_ind
[
j
]
=
k
;
/* Set the unlocks in the tasks. */
for
(
int
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
{
struct
task
*
t
=
&
s
->
tasks
[
k
];
t
->
nr_unlock_tasks
=
counts
[
k
];
t
->
unlock_tasks
=
&
s
->
unlocks
[
offsets
[
k
]];
for
(
int
j
=
offsets
[
k
];
j
<
offsets
[
k
+
1
];
j
++
)
s
->
unlock_ind
[
j
]
=
k
;
}
/* Verify that there are no duplicate unlocks. */
...
...
This diff is collapsed.
Click to expand it.
src/task.c
+
1
−
1
View file @
e00fb2f4
...
...
@@ -49,7 +49,7 @@
const
char
*
taskID_names
[
task_type_count
]
=
{
"none"
,
"sort"
,
"self"
,
"pair"
,
"sub"
,
"init"
,
"ghost"
,
"drift"
,
"kick"
,
"send"
,
"recv"
,
"grav_pp"
,
"grav_mm"
,
"grav_up"
,
"grav_down"
,
"grav_external"
,
"comm_root
"
};
"grav_mm"
,
"grav_up"
,
"grav_down"
,
"grav_external"
,
"comm_root"
};
const
char
*
subtaskID_names
[
task_type_count
]
=
{
"none"
,
"density"
,
"force"
,
"grav"
};
...
...
This diff is collapsed.
Click to expand it.
src/threadpool.c
+
1
−
3
View file @
e00fb2f4
...
...
@@ -50,9 +50,7 @@ void *threadpool_runner(void *data) {
/* Wait for a signal. */
pthread_mutex_lock
(
&
tp
->
thread_mutex
);
do
{
pthread_cond_wait
(
&
tp
->
thread_cond
,
&
tp
->
thread_mutex
);
}
while
(
tp
->
map_function
==
NULL
);
pthread_cond_wait
(
&
tp
->
thread_cond
,
&
tp
->
thread_mutex
);
pthread_mutex_unlock
(
&
tp
->
thread_mutex
);
/* The index of the mapping task we will work on next. */
...
...
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