Skip to content
Snippets Groups Projects
Commit 298cc01b authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

use larger chunks for scheduler_splittasks, and don't init scheduler_ranktasks in parallel.

parent d3624d5d
No related branches found
No related tags found
1 merge request!176Tasks cleanup
...@@ -634,7 +634,7 @@ void scheduler_splittasks(struct scheduler *s) { ...@@ -634,7 +634,7 @@ void scheduler_splittasks(struct scheduler *s) {
/* Call the mapper on each current task. */ /* Call the mapper on each current task. */
threadpool_map(s->threadpool, scheduler_splittasks_mapper, s->tasks, threadpool_map(s->threadpool, scheduler_splittasks_mapper, s->tasks,
s->nr_tasks, sizeof(struct task), 1, s); s->nr_tasks, sizeof(struct task), 1000, s);
} }
/** /**
...@@ -791,8 +791,16 @@ void scheduler_ranktasks(struct scheduler *s) { ...@@ -791,8 +791,16 @@ void scheduler_ranktasks(struct scheduler *s) {
const int nr_tasks = s->nr_tasks; const int nr_tasks = s->nr_tasks;
/* Run through the tasks and get all the waits right. */ /* Run through the tasks and get all the waits right. */
threadpool_map(s->threadpool, scheduler_simple_rewait_mapper, tasks, nr_tasks, /* threadpool_map(s->threadpool, scheduler_simple_rewait_mapper, tasks, nr_tasks,
sizeof(struct task), 1000, NULL); sizeof(struct task), 1000, NULL); */
for (int i = 0; i < nr_tasks; i++) {
struct task *t = &tasks[i];
// Increment the waits of the dependances
for (int k = 0; k < t->nr_unlock_tasks; k++) {
t->unlock_tasks[k]->wait++;
}
}
/* Load the tids of tasks with no waits. */ /* Load the tids of tasks with no waits. */
int left = 0; int left = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment