CC = gcc
LIBRUBY = $(LIBRUBY_SO)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
-LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME) -I . ../../.libs/libsimgrid.a -I /usr/include/lua5.1/ -ldl -llua5.1
-LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
+LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME) -I . ../../../lib/libsimgrid_static.a
+LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
RUBY_EXTCONF_H =
CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags)
rate = -1
+
# Scheduling
- DAG::Task.schedule(taskA,workstation_number,workstation_list,computation_amount,communication_amount,rate)
+ DAG::Task.schedule(taskA,workstation_number,workstation_list,computation_amount,communication_amount,rate)
DAG::Task.schedule(taskB,workstation_number,workstation_list,computation_amount,communication_amount,rate)
DAG::Task.schedule(taskC,workstation_number,workstation_list,computation_amount,communication_amount,rate)
DAG::Task.schedule(taskD,workstation_number,workstation_list,computation_amount,communication_amount,rate)
-
+
+
changed_tasks = Array.new()
changed_tasks = DAG::Task.simulate(-1.0)
+
for i in 0..changed_tasks.size-1
puts "Task "+ changed_tasks[i].name + " Started at " + changed_tasks[i].startTime.to_s + " has been done at "+ changed_tasks[i].finishTime.to_s
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+//#include "ruby_simdag.h"
#include "rb_SD_task.h"
// Free Method
static VALUE rb_SD_simulate(VALUE class,VALUE how_long)
{
int i;
+ SD_task_t task ;
double hl = NUM2DBL(how_long);
- SD_task_t * tasks = SD_simulate(hl);
+ xbt_dynar_t simulated_tasks = SD_simulate(hl) ;
+
VALUE rb_tasks = rb_ary_new();
- for (i = 0; tasks[i] != NULL; i++)
- {
- VALUE tk = Qnil;
- tk = Data_Wrap_Struct(class, 0, SD_task_free, tasks[i]);
- rb_ary_push(rb_tasks,tk);
-
- }
+ xbt_dynar_foreach(simulated_tasks, i, task){
+ VALUE tk = Qnil;
+ tk = Data_Wrap_Struct(class, 0, SD_task_free, task);
+ rb_ary_push(rb_tasks,tk);
+ }
+
return rb_tasks;
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+//#include "ruby_simdag.h"
#include "rb_SD_workstation.h"
+
static void SD_workstation_free(SD_workstation_t wrk)
{
//NOTHING TO DO
*(GNU LGPL) which comes with this package.
*/
+//FIXME #include "ruby_simdag.h"
#include "rb_SD_task.c"
#include "rb_SD_workstation.c"
#include <simdag/simdag.h>