package org.simgrid.msg;
-/**
- * Communication action, representing an ongoing communication
- * between processes.
- */
+/** Communication action, representing an ongoing communication between processes. */
public class Comm {
/** Indicates if the communication is a receiving communication */
protected boolean receiving;
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */
/* 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. */
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
/* This exception is raised when there is a problem within the bindings (in JNI). */
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
/**
- * This exception is raised when there is a problem within the bindings (in JNI).
+ * Exception raised when there is a problem within the bindings (in JNI).
+ *
* That's a RuntimeException: I guess nobody wants to survive a JNI error in SimGrid
*/
public class JniException extends RuntimeException {
/* This exception is an abstract class grouping all MSG-related exceptions */
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/** This exception is raised when there is an error within the C world of SimGrid. */
+/** Exception raised when there is an error within the C world of SimGrid. */
public class NativeException extends MsgException {
private static final long serialVersionUID = 1L;
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/** This error class is only used to interrupt the java user code
- * when the process gets killed by an external event.
+/** Used internally to interrupt the user code when the process gets killed.
* Don't catch it.
*/
-/* This exception is raised when looking for a non-existing process. */
-
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/**
- * This exception is raised when looking for a non-existing process.
- */
+/** Exception raised when looking for a non-existing process. */
public class ProcessNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
- /**
- * Constructs an <code>ProcessNotFoundException</code> without a
- * detail message.
- */
+ /** Constructs an <code>ProcessNotFoundException</code> without a detail message. */
public ProcessNotFoundException() {
super();
}
- /**
- * Constructs an <code>ProcessNotFoundException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>ProcessNotFoundException</code> with a detail message. */
public ProcessNotFoundException(String s) {
super(s);
}
-/* This exception is raised when looking for a non-existing storage. */
-
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/**
- * This exception is raised when looking for a non-existing storage.
- */
+/** Exception raised when looking for a non-existing storage. */
public class StorageNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
public StorageNotFoundException() {
super();
}
- /**
- * Constructs an <code>StorageNotFoundException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>StorageNotFoundException</code> with a detail message. */
public StorageNotFoundException(String s) {
super(s);
}
-/* Copyright (c) 2006-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
-/* This exception is raised when looking for a non-existing host. */
-
-/* Copyright (c) 2006-2007, 2010, 2013-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/**
- * This exception is raised when task is cancelled.
- */
+/** Exception raised when a task is cancelled. */
public class TaskCancelledException extends MsgException {
private static final long serialVersionUID = 1L;
public TaskCancelledException() {
super();
}
- /**
- * Constructs an <code>TaskCancelledException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>TaskCancelledException</code> with a detail message. */
public TaskCancelledException(String s) {
super(s);
}
-/* This exception is raised when looking for a non-existing host. */
-
-/* Copyright (c) 2006-2007, 2010, 2013-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/**
- * This exception is raised when time's out while sending tasks.
- */
+/** Exception raised when sending a task timeouts */
public class TimeoutException extends MsgException {
private static final long serialVersionUID = 1L;
public TimeoutException() {
super();
}
- /**
- * Constructs an <code>TransferFailureException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>TransferFailureException</code> with a detail message. */
public TimeoutException(String s) {
super(s);
}
-/* This exception is raised when looking for a non-existing host. */
-
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
-/**
- * This exception is raised if transfer failed while sending tasks.
- */
+/** Exception raised if sending a task fails */
public class TransferFailureException extends MsgException {
private static final long serialVersionUID = 1L;
/* JNI interface to virtual machine in Simgrid */
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2014. The SimGrid Team. All rights reserved. */
/* 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. */
package org.simgrid.msg;
import java.util.ArrayList;
-public class VM extends Host{
- // Please note that we are not declaring a new bind variable
- //(the bind variable has been inherited from the super class Host)
+public class VM extends Host {
+ // No need to declare a new bind variable: we use the one inherited from the super class Host
/* Static functions */
- // GetByName is inherited from the super class Host
-
private static ArrayList<VM> vms= new ArrayList<>();
private Host currentHost;
- /* Constructors / destructors */
- /**
- * Create a `basic' VM (i.e. 1GB of RAM, other values are not taken into account).
- */
+ /** Create a `basic' VM (i.e. 1GB of RAM, other values are not taken into account). */
public VM(Host host, String name) {
this(host,name,1024, 0, 0);
}
/**
- * Create a VM
- * @param host Host node
+ * Create a VM
+ * @param host Host node
* @param name name of the machine
* @param ramSize size of the RAM that should be allocated (in MBytes)
* @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
*/
public VM(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity){
super();
- super.name = name;
+ super.name = name;
this.currentHost = host;
create(host, name, ramSize, migNetSpeed, dpIntensity);
vms.add(this);
/* JNI / Native code */
- /* get/set property methods are inherited from the Host class. */
-
- /** Returns whether the given VM is currently suspended
- */
+ /** Returns whether the given VM is currently suspended */
public native int isCreated();
- /** Returns whether the given VM is currently running
- */
+ /** Returns whether the given VM is currently running */
public native int isRunning();
- /** Returns whether the given VM is currently running
- */
+ /** Returns whether the given VM is currently running */
public native int isMigrating();
- /** Returns whether the given VM is currently suspended
- */
+ /** Returns whether the given VM is currently suspended */
public native int isSuspended();
- /** Returns whether the given VM is currently saving
- */
+ /** Returns whether the given VM is currently saving */
public native int isSaving();
- /** Returns whether the given VM is currently saved
- */
+ /** Returns whether the given VM is currently saved */
public native int isSaved();
- /** Returns whether the given VM is currently restoring its state
- */
+ /** Returns whether the given VM is currently restoring its state */
public native boolean isRestoring();
/**
*/
public native void setBound(double bound);
- /**
- * start the VM
- */
+ /** start the VM */
public native void start();
/**
- * 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
+ * Immediately kills all processes within the given VM.
+ *
+ * No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep()
*/
public native void shutdown();
- /**
- * Invoke native migration routine
- */
+ /** Invoke native migration routine */
public native void internalmig(Host destination) throws Exception; // TODO add throws DoubleMigrationException (i.e. when you call migrate on a VM that is already migrating);
*/
public native void restore();
-
- /**
- * Class initializer, to initialize various JNI stuff
- */
+ /** Class initializer (for JNI), don't do it yourself */
public static native void nativeInit();
static {
nativeInit();