A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
when scheduling the same application more than once, better to free
[simgrid.git]
/
src
/
simdag
/
sd_task.c
diff --git
a/src/simdag/sd_task.c
b/src/simdag/sd_task.c
index
2957509
..
058e3bf
100644
(file)
--- a/
src/simdag/sd_task.c
+++ b/
src/simdag/sd_task.c
@@
-1386,9
+1386,10
@@
void SD_task_distribute_comp_amdhal(SD_task_t task, int ws_count)
"Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task."
"Cannot use this function.",
SD_task_get_name(task));
"Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task."
"Cannot use this function.",
SD_task_get_name(task));
-
task->computation_amount = xbt_new0(double, ws_count);
task->communication_amount = xbt_new0(double, ws_count * ws_count);
task->computation_amount = xbt_new0(double, ws_count);
task->communication_amount = xbt_new0(double, ws_count * ws_count);
+ if (task->workstation_list)
+ xbt_free(task->workstation_list);
task->workstation_nb = ws_count;
task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
task->workstation_nb = ws_count;
task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
@@
-1538,6
+1539,10
@@
void SD_task_schedulev(SD_task_t task, int count,
task->workstation_list[i];
before->workstation_nb += count;
task->workstation_list[i];
before->workstation_nb += count;
+ if (before->computation_amount)
+ xbt_free(before->computation_amount);
+ if (before->communication_amount)
+ xbt_free(before->communication_amount);
before->computation_amount = xbt_new0(double,
before->workstation_nb);
before->computation_amount = xbt_new0(double,
before->workstation_nb);
@@
-1603,6
+1608,11
@@
void SD_task_schedulev(SD_task_t task, int count,
after->workstation_nb += count;
after->workstation_nb += count;
+ if (after->computation_amount)
+ xbt_free(after->computation_amount);
+ if (after->communication_amount)
+ xbt_free(after->communication_amount);
+
after->computation_amount = xbt_new0(double, after->workstation_nb);
after->communication_amount = xbt_new0(double,
after->workstation_nb*
after->computation_amount = xbt_new0(double, after->workstation_nb);
after->communication_amount = xbt_new0(double,
after->workstation_nb*