Hamoun gh | 1 Dec 03:06
Picon

simulating virtual machine manager (hypervisor)

I am trying to simulate a hypervisor with its guest OSs as customers
waiting for cpu (each OS has a cpu access pattern-no IO here). Unlike
when processes share cpu, here each cpu share of OS is defined earlier
and the scheduling should guarantee that. Another important thing is
that even though the OS might have the cpu, it might not use it.
I am wondering if there exists a clean way to do this using existing
constructs or is it better to extend Resource class for this task.
Also I am wondering if there is any attribute in Resource that I can
use to derive utilization.

Thank you,
Hamoun Ghanbari

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
Stefan Scherfke | 1 Dec 07:53
Picon

Re: class can have more than one PEM?

Nope, doesn’t seem so:

# encoding: utf-8

from SimPy.Simulation import Process, Simulation, hold

class MyProc(Process):
    def __init__(self, sim):
        super(MyProc, self).__init__(sim=sim)

    def run1(self):
        while True:
            print 'PEM 1'
            yield hold, self, 1

    def run2(self):
        while True:
            print 'PEM 2'
            yield hold, self, 1

            
sim = Simulation()
proc = MyProc(sim)
sim.activate(proc, proc.run1())
sim.activate(proc, proc.run2())
sim.simulate(until=10)

Output:
PEM 2
PEM 2
(Continue reading)

Hamoun gh | 1 Dec 09:25
Picon

Re: simulating virtual machine manager (hypervisor)

I think that I should implement each Virtual Machine as a separate
Source (like the ones in bank example) and have them produce bursts on
virtual cpus. Finally I need a fare sharing scheduler to simulate
actual cpu. Maybe I can use the priority queue mechanism already
implemented or extend the simulator Resource with that kind of
scheduling? Any ideas?

On Mon, Nov 30, 2009 at 9:06 PM, Hamoun gh <hamoun.gh <at> gmail.com> wrote:
> I am trying to simulate a hypervisor with its guest OSs as customers
> waiting for cpu (each OS has a cpu access pattern-no IO here). Unlike
> when processes share cpu, here each cpu share of OS is defined earlier
> and the scheduling should guarantee that. Another important thing is
> that even though the OS might have the cpu, it might not use it.
> I am wondering if there exists a clean way to do this using existing
> constructs or is it better to extend Resource class for this task.
> Also I am wondering if there is any attribute in Resource that I can
> use to derive utilization.
>
> Thank you,
> Hamoun Ghanbari
>

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
Hamoun gh | 2 Dec 00:20
Picon

supporting other queuing disciplines

I am wondering if there has been any effort in simpy towards
implementing other queuing disciplines than FIFO, essentially shortest
job first, waited fair queuing or quantum based roundrobin.

If not, does anyone has an idea how to do them using current
constructs (e.g. synchronization/scheduling commands) or should it be
done from scrach?

Thank you,
Hamoun Ghanbari

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
Alan Marchiori | 7 Dec 19:50

queueing activations?

Hi,

I'm just getting started with SimPy and maybe am a bit confused about
how to queue events... I made this simple example:

<code>
from SimPy.Simulation import *

class AProcess(Process):
    def __init__(self):
        Process.__init__(self)
    def callback(self):
        while True:
            print "awake at", now()
            yield passivate, self

def main():
    initialize() # required

    a = AProcess()

    activate(a, a.callback(), at=10.0)
    reactivate(a, at=11)
    reactivate(a, at=12)

    simulate(until=100)

if __name__ == '__main__': main()
</code>

(Continue reading)

Alan Marchiori | 8 Dec 00:11

Re: queueing activations?

Yes, the program you have would produce the output I wanted...

But, the example I gave was just for illustration.  In my real
application I have many asynchronous processes that may or may not
(re)activate other processes (depending on input data).  But if a
process is reactivated more than once only the _last_ one is
scheduled.  The problem with what you wrote is the Process that gets
activated doesn't know the next time it will be activated (because
this information comes from another process) so it cannot do a yield
hold.

I must be misusing SimPy in this case.  I am looking into using a
Resource object to queue the activations, but I'm not entirely sure
that's what I want.

And callback is from being a C programmer for many years, since the
PEM is a callback function pointer (if I understand this correctly),
but PEM is what I mean.

Thanks,

On Mon, Dec 7, 2009 at 3:24 PM, Tony Vignaux <vignaux <at> gmail.com> wrote:
> Alan,
>
> I am not quite sure what you are trying to do and, in particular, the use of
> the name callback for the PEM confuses me.
> I THINK that the following program is what you are after. I have changed the
> identifier of the PEM to pem.
>
> from SimPy.Simulation import *
(Continue reading)

Klaus G. Muller | 25 Dec 14:00
Picon
Picon
Favicon

Merry Christmas!

All,
I have been on a cruise for 24 days. Connectivity on the ship was poor 
and expensive (61 US cents per minute), so I could not participate in 
the SimPy users list discussions for a while. Now I am back and raring 
to go!

Merry Christmas to all of you!

Klaus Müller

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Steven H. Rogers | 25 Dec 14:46
Favicon

Re: Merry Christmas!

Welcome back Klaus, and a Merry Christmas to you!  Hope your cruise was 
restorative.

# Steve

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Klaus G. Muller | 30 Dec 12:58
Picon
Picon
Favicon

Re: class can have more than one PEM?

All,
sorry for the delayed response, but I have been travelling.

Here is my answer:

1) A Process subclass can have any number of PEMs, but not more than one 
can be active at the same time.

2) One can have a class instance with any number of active Process 
instances, though. Example:

from SimPy.Simulation import *
class Man:
    def __init__(self,name):
        self.name = name
        self.sound = Man.Sound(who=self)
        activate(self.sound,self.sound.talk())
        self.movement = Man.Move(who=self)
        activate(self.movement,self.movement.walk())

    class Sound(Process):
        def __init__(self,who):
            Process.__init__(self)
            self.owner = who
        def talk(self):
            while True:
                yield hold,self,10
                print "%s %s says: %s"%(now(),self.owner.name,"bla bla")

    class Move(Process):
(Continue reading)


Gmane