- const int workstation_number = 2;
- /* const SD_workstation_t *workstation_list = SD_workstation_get_list();*/
- const SD_workstation_t workstation_list[] = {w1, w2};
- double computation_amount[] = {computation_amount1, computation_amount2};
- double communication_amount[] =
- {
- 0, communication_amount12,
- communication_amount21, 0
- };
- double rate = -1.0;
+ TRY {
+ SD_task_dependency_add(NULL, NULL, taskA, taskA); /* shouldn't work and must raise an exception */
+ xbt_die("Hey, I can add a dependency between Task A and Task A!");
+ }
+ CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW; /* this is a serious error */
+ xbt_ex_free(ex);
+ }
+
+ TRY {
+ SD_task_dependency_add(NULL, NULL, taskB, taskA); /* shouldn't work and must raise an exception */
+ xbt_die("Oh oh, I can add an already existing dependency!");
+ }
+ CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
+ }
+
+ TRY {
+ SD_task_dependency_remove(taskA, taskC); /* shouldn't work and must raise an exception */
+ xbt_die("Dude, I can remove an unknown dependency!");
+ }
+ CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
+ }
+
+ TRY {
+ SD_task_dependency_remove(taskC, taskC); /* shouldn't work and must raise an exception */
+ xbt_die("Wow, I can remove a dependency between Task C and itself!");
+ }
+ CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
+ }
+
+
+ /* if everything is ok, no exception is forwarded or rethrown by main() */
+
+ /* watch points */
+ SD_task_watch(taskD, SD_DONE);
+ SD_task_watch(taskB, SD_DONE);
+ SD_task_unwatch(taskD, SD_DONE);
+
+
+ /* scheduling parameters */
+ workstation_list[0] = w1;
+ workstation_list[1] = w2;
+ computation_amount[0] = computation_amount1;
+ computation_amount[1] = computation_amount2;
+
+ communication_amount[1] = communication_amount12;
+ communication_amount[2] = communication_amount21;