Commit 831cc364 authored by Matthieu Schaller's avatar Matthieu Schaller

Avoid overflow problems with the number of waits/unlocks of tasks. Now that we...

Avoid overflow problems with the number of waits/unlocks of tasks. Now that we go beyong 64bits for tasks it makes no sense to worry about memory footprint for these anymore.
parent 27b251bb
......@@ -1133,11 +1133,11 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
*/
void scheduler_set_unlocks(struct scheduler *s) {
/* Store the counts for each task. */
short int *counts;
if ((counts = (short int *)swift_malloc(
"counts", sizeof(short int) * s->nr_tasks)) == NULL)
int *counts;
if ((counts = (int *)swift_malloc("counts", sizeof(int) * s->nr_tasks)) ==
NULL)
error("Failed to allocate temporary counts array.");
bzero(counts, sizeof(short int) * s->nr_tasks);
bzero(counts, sizeof(int) * s->nr_tasks);
for (int k = 0; k < s->nr_unlocks; k++) {
counts[s->unlock_ind[k]] += 1;
......@@ -1151,7 +1151,7 @@ void scheduler_set_unlocks(struct scheduler *s) {
"the difference in task depths.",
taskID_names[s->tasks[s->unlock_ind[k]].type],
subtaskID_names[s->tasks[s->unlock_ind[k]].subtype],
(1LL << (8 * sizeof(short int) - 1)) - 1);
(1LL << (8 * sizeof(int) - 1)) - 1);
}
/* Compute the offset for each unlock block. */
......
......@@ -195,10 +195,10 @@ struct task {
float weight;
/*! Number of tasks unlocked by this one */
short int nr_unlock_tasks;
int nr_unlock_tasks;
/*! Number of unsatisfied dependencies */
short int wait;
int wait;
/*! Type of the task */
enum task_types type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment