VM
Date: 2013-11-17

org.simgrid.msg

## Class VM

- java.lang.Object
- - org.simgrid.msg.VM

-     public class VM
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VM(Host host, java.lang.String name, int coreAmount)` Create a new empty VM.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bind(Process process)` Add the given process into the VM.
    `protected void` | `destroy()` Destroy the VM
    `protected void` | `finalize()`
    `java.lang.String` | `getName()`
    `boolean` | `isRunning()` Returns whether the given VM is currently running
    `boolean` | `isSuspended()` Returns whether the given VM is currently suspended
    `void` | `migrate(Host destination)` Immediately change the host on which all processes are running No migration cost occurs.
    `static void` | `nativeInit()` Class initializer, to initialize various JNI stuff
    `void` | `reboot()` Reboot the VM, restarting all the processes in it.
    `void` | `resume()` Immediately resumes the execution of all processes within the given VM No resume cost occurs.
    `void` | `shutdown()` Immediately kills all processes within the given VM.
    `void` | `suspend()` Immediately suspend the execution of all processes within the given VM No suspension cost occurs.
    `void` | `unbind(Process process)` Removes the given process from the given VM, and kill it Will raise a ProcessNotFound exception if the process were not bound to that VM

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VM

          public VM(Host host,
            java.lang.String name,
            int coreAmount)

      Create a new empty VM. NOTE: it is expected that in the future, the coreAmount parameter will be used to add extra constraints on the execution, but the argument is ignored for now.

  - ### Method Detail

    - #### finalize

          protected void finalize()

      Overrides:
        `finalize` in class `java.lang.Object`

    - #### destroy

          protected void destroy()

      Destroy the VM

    - #### isSuspended

          public boolean isSuspended()

      Returns whether the given VM is currently suspended

    - #### isRunning

          public boolean isRunning()

      Returns whether the given VM is currently running

    - #### bind

          public void bind(Process process)

      Add the given process into the VM. Afterward, when the VM is migrated or suspended or whatever, the process will have the corresponding handling, too.

    - #### unbind

          public void unbind(Process process)

      Removes the given process from the given VM, and kill it Will raise a ProcessNotFound exception if the process were not bound to that VM

    - #### migrate

          public void migrate(Host destination)

      Immediately change the host on which all processes are running No migration cost occurs. If you want to simulate this too, you want to use a Task.send() before or after, depending on whether you want to do cold or hot migration.

    - #### suspend

          public void suspend()

      Immediately suspend the execution of all processes within the given VM No suspension cost occurs. If you want to simulate this too, you want to use a \ref File.write() before or after, depending on the exact semantic of VM suspend to you.

    - #### resume

          public void resume()

      Immediately resumes the execution of all processes within the given VM No resume cost occurs. If you want to simulate this too, you want to use a \ref File.read() before or after, depending on the exact semantic of VM resume to you.

    - #### shutdown

          public void shutdown()

      Immediately kills all processes within the given VM. Any memory that they allocated will be leaked. No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep() or something

    - #### reboot

          public void reboot()

      Reboot the VM, restarting all the processes in it.

    - #### getName

          public java.lang.String getName()

    - #### nativeInit

          public static void nativeInit()

      Class initializer, to initialize various JNI stuff