diff --git a/src/qsched.c b/src/qsched.c index dbf7b2c6888d2dd03233ba5687f84c477ea40857..ce297716a4dd51f20a04f4d096596f28762cc320 100644 --- a/src/qsched.c +++ b/src/qsched.c @@ -2267,13 +2267,13 @@ tsched_init(&ts, s); /*Storage required for the parent calculations */ #define MAX_PARENT_GUESS 64 -int *parents = (int*)malloc(sizeof(int) * MAX_PARENT_GUESS); -if(parents == NULL) - error("Failed to allocate parents array."); +//int *parents = (int*)malloc(sizeof(int) * MAX_PARENT_GUESS); +//if(parents == NULL) +// error("Failed to allocate parents array."); int *current_parents = (int*) malloc(sizeof(int) * MAX_PARENT_GUESS); if(current_parents == NULL) error("Failed to allocate current_parents array."); -int size_parents = MAX_PARENT_GUESS; +//int size_parents = MAX_PARENT_GUESS; int num_parents = 0; int num_current = 0; @@ -2426,7 +2426,7 @@ for(i = 0; i < count; i++) /* If the task has dependencies*/ /*Find the parents. */ num_parents = 0; - int max = wait_init[gettaskindex(t->id, s)]; +// int max = wait_init[gettaskindex(t->id, s)]; /* for(j = i-1; j >= 0 && num_parents < max; j--) { const struct task *t2 = &s->tasks[gettaskindex(tid[j], s)]; @@ -2459,6 +2459,7 @@ for(i = 0; i < count; i++) /* We have all the parents now. */ int *parents = &all_parents[offsets[gettaskindex(ttid,s)]]; + num_parents = offsets[gettaskindex(ttid,s)+1]-offsets[gettaskindex(ttid,s)]; /* Loop over the locked resources */ for(j = 0; j < t->nr_locks; j++) { @@ -2902,7 +2903,6 @@ for(i = 0; i < count; i++) -free(parents); free(current_parents); toc = getticks();