* between processes.
*/
public class Comm {
- /**
- * Indicates if the communication is a receiving communication
- */
+ /** Indicates if the communication is a receiving communication */
protected boolean receiving;
- /**
- * Indicates if the communication is finished
- */
+ /** Indicates if the communication is finished */
protected boolean finished = false;
/**
* Represents the bind between the java comm and the
* automatically set.
*/
private long bind = 0;
- /**
- * Represents the bind for the task object pointer. Don't touch it.
- */
+ /** Represents the bind for the task object pointer. Don't touch it. */
private long taskBind = 0;
- /**
- * Task associated with the comm. Beware, it can be null
- */
+ /** Task associated with the comm. Beware, it can be null */
protected Task task = null;
/**
* Protected constructor, used by Comm factories
return task;
}
- /**
- * Class initializer, to initialize various JNI stuff
- */
+ /** Class initializer, to initialize various JNI stuff */
public static native void nativeInit();
static {
org.simgrid.NativeLib.nativeInit();
* @param nMemb is the number of elements of data to write
*/
public native long write(long size, long nMemb);
- /**
- * Close the file.
- */
+ /** Close the file. */
public native void close();
/** Class initializer, to initialize various JNI stuff */
* @see Host.getByName().
*/
private long bind;
- /**
- * Host name
- */
protected String name;
- /**
- * User data.
- */
+ /** User data. */
private Object data;
- /**
- *
- */
protected Host() {
this.bind = 0;
this.data = null;
*/
public native static Host getByName(String name)
throws HostNotFoundException, NullPointerException;
- /**
- * This static method returns the count of the installed hosts.
- *
- * @return The count of the installed hosts.
- */
+ /** Counts the installed hosts. */
public native static int getCount();
- /**
- * This static method return an instance to the host of the current process.
- *
- * @return The host on which the current process is executed.
- */
+ /** Returns the host of the current process. */
public native static Host currentHost();
- /**
- * This static method returns all of the hosts of the installed platform.
- *
- * @return An array containing all the hosts installed.
- *
- */
+ /** Returns all hosts of the installed platform. */
public native static Host[] all();
/**
public static native void setAsyncMailbox(String mailboxName);
- /**
- * This method returns the name of a host.
- * @return The name of the host.
- *
- */
+ /** Returns the name of an host. */
public String getName() {
return name;
}
- /**
- * Sets the data of the host.
- * @param data
- */
+ /** Sets the user data of the host. */
public void setData(Object data) {
this.data = data;
}
- /**
- * Gets the data of the host.
- *
- * @return The data object associated with the host.
- */
+ /** Gets the user data of the host. */
public Object getData() {
return this.data;
}
-
- /**
- * Checks whether a host has data.
- *
- * @return True if the host has an associated data object.
- */
+ /** Returns true if the host has an associated data object. */
public boolean hasData() {
return null != this.data;
}
- /**
- * This method start the host if it is off
- */
+ /** Starts the host if it is off */
public native void on();
-
- /**
- * This method stop the host if it is on
- */
+ /** Stops the host if it is on */
public native void off();
/**
- * This method returns the speed of the processor of a host,
+ * This method returns the speed of the processor of a host (in flops),
* regardless of the current load of the machine.
- *
- * @return The speed of the processor of the host in flops.
- *
*/
public native double getSpeed();
-
- /**
- * This method returns the number of core of a host.
- *
- * @return The speed of the processor of the host in flops.
- *
- */
+ /** Returns the number of core of a host. */
public native double getCoreNumber();
- /**
- * Returns the value of a given host property.
- */
+ /** Returns the value of a given host property. */
public native String getProperty(String name);
-
- /**
- * Change the value of a given host property.
- */
+ /** Changes the value of a given host property. */
public native void setProperty(String name, String value);
-
- /** This method tests if a host is up and running.
- * @return True if the host is available.
- */
+ /** Tests if an host is up and running. */
public native boolean isOn();
- /** This methods returns the list of mount point names on an host
- * @return An array containing all mounted storages on the host
- */
+ /** Returns the list of mount point names on an host */
public native Storage[] getMountedStorage();
-
- /** This methods returns the list of storages attached to an host
- * @return An array containing all storages (name) attached to the host
- */
+ /** This methods returns the list of storages (names) attached to an host */
public native String[] getAttachedStorage();
/** Returns the amount of Joules consumed by that host so far */
public native double getConsumedEnergy();
- /**
- * Class initializer, to initialize various JNI stuff
- */
+ /** Class initializer, to initialize various JNI stuff */
public static native void nativeInit();
static {
nativeInit();
-/* This exception is raised when looking for a non-existing host. */
-
/* Copyright (c) 2006-2014. The SimGrid Team.
* All rights reserved. */
package org.simgrid.msg;
-/**
- * This exception is raised when the host on which you are running has just been rebooted.
- */
+/** This exception is raised when the host on which you are running has just been rebooted. */
public class HostFailureException extends MsgException {
private static final long serialVersionUID = 1L;
public HostFailureException() {
super();
}
- /**
- * Constructs an <code>HostFailureException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>HostFailureException</code> with a detail message. */
public HostFailureException(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. */
package org.simgrid.msg;
-/**
- * This exception is raised when looking for a non-existing host.
- */
+/** This exception is raised when looking for a non-existing host. */
public class HostNotFoundException extends MsgException {
private static final long serialVersionUID = 1L;
public HostNotFoundException() {
super();
}
- /**
- * Constructs an <code>HostNotFoundException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>HostNotFoundException</code> with a detail message. */
public HostNotFoundException(String s) {
super(s);
}
private static final long serialVersionUID = 1L;
- /**
- * Constructs an <code>JniException</code> without a
- * detail message.
- */
+ /** Constructs an <code>JniException</code> without a detail message. */
public JniException() {
super();
}
- /**
- * Constructs an <code>JniException</code> with a detail message.
- *
- * @param s the detail message.
- */ public JniException(String s) {
+ /** Constructs an <code>JniException</code> with a detail message. */
+ public JniException(String s) {
super(s);
- }
+ }
public JniException(String string, Exception e) {
super(string,e);
}
public final class Msg {
- /** Retrieve the simulation time
- * @return The simulation time.
- */
+ /** Retrieves the simulation time */
public final static native double getClock();
- /**
- * Issue a debug logging message.
- * @param s message to log.
- */
- public final static native void debug(String s);
- /**
- * Issue an verbose logging message.
- * @param s message to log.
- */
- public final static native void verb(String s);
-
- /** Issue an information logging message
- * @param s
- */
- public final static native void info(String s);
- /**
- * Issue an warning logging message.
- * @param s message to log.
- */
- public final static native void warn(String s);
- /**
- * Issue an error logging message.
- * @param s message to log.
- */
- public final static native void error(String s);
- /**
- * Issue an critical logging message.
- * @param s message to log.
- */
+ /** Issue a debug logging message. */
+ public final static native void debug(String msg);
+ /** Issue a verbose logging message. */
+ public final static native void verb(String msg);
+ /** Issue an information logging message */
+ public final static native void info(String msg);
+ /** Issue a warning logging message. */
+ public final static native void warn(String msg);
+ /** Issue an error logging message. */
+ public final static native void error(String msg);
+ /** Issue a critical logging message. */
public final static native void critical(String s);
/*********************************************************************************
* Deployment and initialization related functions *
*********************************************************************************/
- /**
- * The natively implemented method to initialize a MSG simulation.
+ /** Initialize a MSG simulation.
*
* @param args The arguments of the command line of the simulation.
*/
/** Tell the kernel that you want to use the energy plugin */
public final static native void energyInit();
- /**
- * Run the MSG simulation.
+ /** Run the MSG simulation.
*
* The simulation is not cleaned afterward (see
* {@link #clean()} if you really insist on cleaning the C side), so you can freely
@Deprecated
public final static void clean(){}
- /**
- * The native implemented method to create the environment of the simulation.
- *
- * @param platformFile The XML file which contains the description of the environment of the simulation
- *
- */
+ /** Create the simulation environment by parsing a platform file. */
public final static native void createEnvironment(String platformFile);
public final static native As environmentGetRoutingRoot();
- /**
- * The method to deploy the simulation.
- *
- *
- * @param deploymentFile
- */
+ /** Starts your processes by parsing a deployment file. */
public final static native void deployApplication(String deploymentFile);
/** Example launcher. You can use it or provide your own launcher, as you wish
package org.simgrid.msg;
-/**
- * This exception is an abstract class grouping all MSG-related exceptions
- *
- * <!--
- * DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
- * DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
- * DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
- * DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
- * -->
- */
+/** This exception is an abstract class grouping all MSG-related exceptions */
public abstract class MsgException extends Exception {
private static final long serialVersionUID = 1L;
- /**
- * Constructs an <code>MsgException</code> without a
- * detail message.
- */
+ /** Constructs an <code>MsgException</code> without a detail message. */
public MsgException() {
super();
}
- /**
- * Constructs an <code>MsgException</code> with a detail message.
- *
- * @param s the detail message.
- */
- public MsgException(String s) {
- super(s);
+ /** Constructs an <code>MsgException</code> with a detail message. */
+ public MsgException(String msg) {
+ super(msg);
}
}
/** A mutex implemented on top of SimGrid synchronization mechanisms.
* You can use it exactly the same way that you use the mutexes,
* but to handle the interactions between the processes within the simulation.
- *
+ *
+ * Don't mix simgrid synchronization with Java native one, or it will deadlock!
*/
public class Mutex {
private long bind; // The C object -- don't touch it
public native void acquire();
public native void release();
- /**
- * Class initializer, to initialize various JNI stuff
- */
+ /** Class initializer, to initialize various JNI stuff */
public static native void nativeInit();
static {
org.simgrid.NativeLib.nativeInit();
package org.simgrid.msg;
-/**
- * This exception is raised when there is an error within the C world of SimGrid.
- * Refer to the string message for more info on what went wrong.
- */
+/** This exception is raised when there is an error within the C world of SimGrid. */
public class NativeException extends MsgException {
private static final long serialVersionUID = 1L;
- /**
- * Constructs an <code>NativeException</code> with a detail message.
- *
- * @param s the detail message.
- */
+ /** Constructs an <code>NativeException</code> with a detail message. */
public NativeException(String s) {
super(s);
}
* access to it. It is set automatically during the build of the object.
*/
private long bind;
- /**
- * Indicates if the process is started
- */
+ /** Indicates if the process is started */
boolean started;
/**
* Even if this attribute is public you must never access to it.
/** Time at which the process should be created */
protected double startTime = 0;
- /** Time at which th
- * Kill time of the process
+ /** Time at which the process should be killed.
*
* Set at creation, and used internally by SimGrid
*/
public Vector<String> args;
- /**
- * Default constructor
- */
+ /** Default constructor */
protected Process() {
this.id = nextProcessId++;
this.name = null;