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
fiddle with the doxygen config
[simgrid.git]
/
examples
/
simdag
/
sd_fail.c
diff --git
a/examples/simdag/sd_fail.c
b/examples/simdag/sd_fail.c
index
0c19e37
..
fc1647c
100644
(file)
--- a/
examples/simdag/sd_fail.c
+++ b/
examples/simdag/sd_fail.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2006
, 2007, 2008, 2009, 2010
. The SimGrid Team.
+/* Copyright (c) 2006
-2010, 2012-2015
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-6,7
+6,7
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include "sim
dag
/simdag.h"
+#include "sim
grid
/simdag.h"
#include "xbt/ex.h"
#include "xbt/log.h"
#include "xbt/ex.h"
#include "xbt/log.h"
@@
-18,7
+18,8
@@
int main(int argc, char **argv)
SD_task_t task;
double computation_amount[1];
double communication_amount[2] = { 0 };
SD_task_t task;
double computation_amount[1];
double communication_amount[2] = { 0 };
- SD_workstation_t workstation_list[1];
+ sg_host_t workstation_list[1];
+
/* initialization of SD */
SD_init(&argc, argv);
/* initialization of SD */
SD_init(&argc, argv);
@@
-29,11
+30,13
@@
int main(int argc, char **argv)
* will stop */
XBT_INFO("First test: COMP_SEQ task");
task = SD_task_create_comp_seq("Poor task", NULL, 2e10);
* will stop */
XBT_INFO("First test: COMP_SEQ task");
task = SD_task_create_comp_seq("Poor task", NULL, 2e10);
+ SD_task_watch(task, SD_FAILED);
+ SD_task_watch(task, SD_DONE);
XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
SD_task_get_name(task));
XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
SD_task_get_name(task));
- SD_task_schedulel(task, 1,
SD_workstation_ge
t_by_name("Faulty Host"));
+ SD_task_schedulel(task, 1,
sg_hos
t_by_name("Faulty Host"));
SD_simulate(-1.0);
SD_simulate(-1.0);
@@
-46,7
+49,7
@@
int main(int argc, char **argv)
XBT_INFO("let's unschedule task '%s' and reschedule it on the 'Safe Host'",
SD_task_get_name(task));
SD_task_unschedule(task);
XBT_INFO("let's unschedule task '%s' and reschedule it on the 'Safe Host'",
SD_task_get_name(task));
SD_task_unschedule(task);
- SD_task_schedulel(task, 1,
SD_workstation_ge
t_by_name("Safe Host"));
+ SD_task_schedulel(task, 1,
sg_hos
t_by_name("Safe Host"));
XBT_INFO("Run the simulation again");
SD_simulate(-1.0);
XBT_INFO("Run the simulation again");
SD_simulate(-1.0);
@@
-63,12
+66,15
@@
int main(int argc, char **argv)
XBT_INFO("Second test: NON TYPED task");
task = SD_task_create("Poor parallel task", NULL, 2e10);
XBT_INFO("Second test: NON TYPED task");
task = SD_task_create("Poor parallel task", NULL, 2e10);
+ SD_task_watch(task, SD_FAILED);
+ SD_task_watch(task, SD_DONE);
+
computation_amount[0] = 2e10;
XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
SD_task_get_name(task));
computation_amount[0] = 2e10;
XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
SD_task_get_name(task));
- workstation_list[0] =
SD_workstation_ge
t_by_name("Faulty Host");
+ workstation_list[0] =
sg_hos
t_by_name("Faulty Host");
SD_task_schedule(task, 1, workstation_list,
computation_amount, communication_amount,-1);
SD_task_schedule(task, 1, workstation_list,
computation_amount, communication_amount,-1);
@@
-84,7
+90,7
@@
int main(int argc, char **argv)
SD_task_get_name(task));
SD_task_unschedule(task);
SD_task_get_name(task));
SD_task_unschedule(task);
- workstation_list[0] =
SD_workstation_ge
t_by_name("Safe Host");
+ workstation_list[0] =
sg_hos
t_by_name("Safe Host");
SD_task_schedule(task, 1, workstation_list,
computation_amount, communication_amount,-1);
SD_task_schedule(task, 1, workstation_list,
computation_amount, communication_amount,-1);