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
Do connect all log channel manually to parent using XBT_LOG_CONNECT() too, so that...
[simgrid.git]
/
src
/
simdag
/
sd_global.c
diff --git
a/src/simdag/sd_global.c
b/src/simdag/sd_global.c
index
a080aa7
..
27e445f
100644
(file)
--- a/
src/simdag/sd_global.c
+++ b/
src/simdag/sd_global.c
@@
-4,6
+4,7
@@
#include "surf/surf.h"
#include "xbt/ex.h"
#include "xbt/log.h"
#include "surf/surf.h"
#include "xbt/ex.h"
#include "xbt/log.h"
+#include "xbt/str.h"
#include "xbt/config.h"
XBT_LOG_NEW_CATEGORY(sd,"Logging specific to SimDag");
#include "xbt/config.h"
XBT_LOG_NEW_CATEGORY(sd,"Logging specific to SimDag");
@@
-72,6
+73,11
@@
static void sd_config_init(void)
if (_sd_init_status)
return; /* Already inited, nothing to do */
if (_sd_init_status)
return; /* Already inited, nothing to do */
+ /* Connect our log channels: that must be done manually under windows */
+ XBT_LOG_CONNECT(sd_kernel, sd);
+ XBT_LOG_CONNECT(sd_task, sd);
+ XBT_LOG_CONNECT(sd_workstation, sd);
+
_sd_init_status = 1;
_sd_cfg_set = xbt_cfg_new();
_sd_init_status = 1;
_sd_cfg_set = xbt_cfg_new();
@@
-123,7
+129,7
@@
static void sd_cfg_control_set(const char *control_string)
/* To split the string in commands, and the cursors */
xbt_dynar_t set_strings;
char *str;
/* To split the string in commands, and the cursors */
xbt_dynar_t set_strings;
char *str;
- int cpt;
+
unsigned
int cpt;
if (!control_string)
return;
if (!control_string)
return;
@@
-359,6
+365,8
@@
void SD_create_environment(const char *platform_file) {
surf_workstation_model_description[workstation_id].
model_init(platform_file);
surf_workstation_model_description[workstation_id].
model_init(platform_file);
+ parse_platform_file(platform_file);
+
_sd_init_status = 2;
/* now let's create the SD wrappers for workstations and links */
_sd_init_status = 2;
/* now let's create the SD wrappers for workstations and links */
@@
-389,13
+397,13
@@
SD_task_t* SD_simulate(double how_long)
{
double total_time = 0.0; /* we stop the simulation when total_time >= how_long */
double elapsed_time = 0.0;
{
double total_time = 0.0; /* we stop the simulation when total_time >= how_long */
double elapsed_time = 0.0;
- SD_task_t task, dst;
+ SD_task_t task,
task_safe,
dst;
SD_dependency_t dependency;
surf_action_t action;
SD_task_t *changed_tasks = NULL;
int changed_task_number = 0;
int changed_task_capacity = sd_global->task_number + 1;
SD_dependency_t dependency;
surf_action_t action;
SD_task_t *changed_tasks = NULL;
int changed_task_number = 0;
int changed_task_capacity = sd_global->task_number + 1;
-
int i
;
+
unsigned int iter
;
static int first_time = 1;
SD_CHECK_INIT_DONE();
static int first_time = 1;
SD_CHECK_INIT_DONE();
@@
-418,7
+426,7
@@
SD_task_t* SD_simulate(double how_long)
sd_global->watch_point_reached = 0;
/* explore the ready tasks */
sd_global->watch_point_reached = 0;
/* explore the ready tasks */
- xbt_swag_foreach
(task
, sd_global->ready_task_set) {
+ xbt_swag_foreach
_safe(task, task_safe
, sd_global->ready_task_set) {
INFO1("Executing task '%s'", SD_task_get_name(task));
if ((task->state_changed = __SD_task_try_to_run(task))) {
changed_tasks[changed_task_number++] = task; /* replace NULL by the task */
INFO1("Executing task '%s'", SD_task_get_name(task));
if ((task->state_changed = __SD_task_try_to_run(task))) {
changed_tasks[changed_task_number++] = task; /* replace NULL by the task */
@@
-451,7
+459,7
@@
SD_task_t* SD_simulate(double how_long)
total_time += elapsed_time;
/* let's see which tasks are done */
total_time += elapsed_time;
/* let's see which tasks are done */
- xbt_dynar_foreach(model_list, i, model) {
+ xbt_dynar_foreach(model_list, i
ter
, model) {
while ((action = xbt_swag_extract(model->common_public->
states.done_action_set))) {
task = action->data;
while ((action = xbt_swag_extract(model->common_public->
states.done_action_set))) {
task = action->data;
@@
-523,10
+531,10
@@
SD_task_t* SD_simulate(double how_long)
}
/* we must reset every task->state_changed */
}
/* we must reset every task->state_changed */
- i = 0;
- while (changed_tasks[i] != NULL) {
- changed_tasks[i]->state_changed = 0;
- i++;
+ i
ter
= 0;
+ while (changed_tasks[i
ter
] != NULL) {
+ changed_tasks[i
ter
]->state_changed = 0;
+ i
ter
++;
}
INFO0("Simulation finished");
}
INFO0("Simulation finished");