[Simgrid-user] Get Host State

Pablo Yabo pablo.yabo at gmail.com
Wed Sep 12 23:09:50 CEST 2007


Ok, I moved my question to devel list:

I´m using MSG and I need to know the state of each host, I mean if the host
is busy or is completely free of tasks.

Is there any way to do it using MSG?
I saw some SD functions but nothing in MSG about this.

You´ve answered to dig here:

Assuming host is a msg_host, you could do something like
>
>    (host->simdata->s_host->simdata->host)
>
> It will give you access to the corresponding surf object and from
> that, diving in the maxmin system, you could get the exact number of
> active actions. It would however be tricky because the type of this
> surf object may depend on how you initialized surf. There is
> definitely a nice and "clean" way to do it like that but it may be a
> little complex for a first shot. :) And the simpleer your hack, the
> longer it is likely to last...
>
> So maybe you can just go through the msg_global->process_list and
> simply count the process whose process->simdata->m_host is the one you
> want... To know whether a process is computing or not, you can check
> its simdata->waiting_task->simdata->compute. It may seem confusing at
> first but I'm sure reading the code will enlighten you.



A question about the response:
Is it safe to dig data without taking any lock?

Another question (you may be tired of my questions :( ):
I´m trying to add a cancel button to the simulation. I tried with
MSG_killall but if I call it then MSG_clean hangs in surf_exit. Any ideas?


Thanks,
Pablo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.inria.fr/pipermail/simgrid-user/attachments/20070912/7e87fcec/attachment.htm 


More information about the Simgrid-user mailing list