From 23c076db121b7e1fd3710db48d3f1e177cbf9fd3 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 2 Mar 2010 17:09:48 +0000 Subject: [PATCH] Acknoledge the fact that JniException is a runtime exception now: kill all its occurences in the examples git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7169 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/bindings/ruby/rb_msg_task.c | 2 +- src/bindings/ruby/simgrid.rb | 9 +++------ src/bindings/ruby_bindings.h | 1 - src/msg/task.c | 2 ++ src/simix/smx_network.c | 6 ++++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bindings/ruby/rb_msg_task.c b/src/bindings/ruby/rb_msg_task.c index 361765746f..63c53ec554 100644 --- a/src/bindings/ruby/rb_msg_task.c +++ b/src/bindings/ruby/rb_msg_task.c @@ -17,7 +17,6 @@ void rb_task_free(m_task_t tk) { // New Method VALUE rb_task_new(VALUE class, VALUE name,VALUE comp_size,VALUE comm_size) { - //char * t_name = RSTRING(name)->ptr; m_task_t task = MSG_task_create(RSTRING(name)->ptr,NUM2INT(comp_size),NUM2INT(comm_size),NULL); // Wrap m_task_t to a Ruby Value return Data_Wrap_Struct(class, 0, rb_task_free, task); @@ -58,6 +57,7 @@ void rb_task_send(VALUE class,VALUE task,VALUE mailbox) { // Wrap Ruby Value to m_task_t struct m_task_t tk; Data_Get_Struct(task, s_m_task_t, tk); + INFO1("Sending task %p",tk); int res = MSG_task_send(tk,RSTRING(mailbox)->ptr); if(res != MSG_OK) rb_raise(rb_eRuntimeError,"MSG_task_send failed"); diff --git a/src/bindings/ruby/simgrid.rb b/src/bindings/ruby/simgrid.rb index b3cc65be9b..1eed8176b6 100644 --- a/src/bindings/ruby/simgrid.rb +++ b/src/bindings/ruby/simgrid.rb @@ -48,8 +48,8 @@ class MsgProcess < Thread @@nextProcessId = 0 # Attributes - attr_reader :bind, :id, :pargs # Read only - attr_accessor :name, :properties # R/W + attr_reader :bind, :id # Read only + attr_accessor :name, :properties, :pargs # R/W # Initialize : Used from ApplicationHandler to fill it in def initialize(*args) @@ -239,10 +239,7 @@ class ApplicationHandler def onEndProcess() process = rubyNewInstance(@function) - size = @args.size - for i in 0..size-1 - process.pargs.push(@args[i]) - end + process.pargs = @args process.name = @function host = Host.getByName(@hostName) processCreate(process,host) diff --git a/src/bindings/ruby_bindings.h b/src/bindings/ruby_bindings.h index 2b60085378..a1ff9257aa 100644 --- a/src/bindings/ruby_bindings.h +++ b/src/bindings/ruby_bindings.h @@ -25,7 +25,6 @@ #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/asserts.h" -//#include "rb_msg_host.h" /* Damn Ruby. They load their full config.h, which breaks since we also load ours. * So, we undef the offending defines diff --git a/src/msg/task.c b/src/msg/task.c index a54b159114..b14d7c8cab 100644 --- a/src/msg/task.c +++ b/src/msg/task.c @@ -73,6 +73,8 @@ m_task_t MSG_task_create(const char *name, double compute_duration, simdata->comp_amount = NULL; simdata->comm_amount = NULL; + CINFO2(root,"Created task %p: %s",task,name); + return task; } diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 79c604ba10..1089d17dae 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -339,8 +339,10 @@ void SIMIX_network_copy_data(smx_comm_t comm) if(buff_size == 0) return; - DEBUG4("Copying comm %p data from %s -> %s (%zu bytes)", - comm, comm->src_proc->smx_host->name, comm->dst_proc->smx_host->name, + INFO6("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", + comm, + comm->src_proc->smx_host->name, comm->src_buff, + comm->dst_proc->smx_host->name, comm->dst_buff, buff_size); memcpy(comm->dst_buff, comm->src_buff, buff_size); -- 2.20.1