* access to it. It is set automatically during the build of the object.
*/
public long bind = 0;
-
+ /**
+ * Task name
+ */
+ protected String name;
/** Default constructor (all fields to 0 or null) */
public Task() {
/* * * *
* * Getters / Setters * *
* * * */
- /** Gets the name of a task
- * FIXME: Cache it.
- * @return
+ /**
+ * Gets the name of a task
*/
- public native String getName();
- /** Gets the sender of the task */
- //FIXME: Don't crash when the task has just been created.
+ public String getName() {
+ return name;
+ }
+ /**
+ * Gets the sender of the task
+ * Returns null if the task hasn't been sent yet
+ */
public native Process getSender();
- /** Gets the source of the task
- * FIXME: Not defensive enough, can crash.
+ /** Gets the source of the task.
+ * Returns null if the task hasn't been sent yet.
*/
public native Host getSource();
/** Gets the computing amount of the task
/** Gets the remaining computation of the task
*/
public native double getRemainingDuration();
+ /**
+ * Sets the name of the task
+ * @param name the new task name.c
+ */
+ public native void setName(String name);
/**
* This method sets the priority of the computation of the task.
* The priority doesn't affect the transfer rate. For example a
* @param priority The new priority of the task.
*/
public native void setPriority(double priority);
- /* * * *
- * * Communication-related * *
- * * * */
-
-
+ /**
+ * Set the computation amount needed to process the task
+ * @param computationAmount the amount of computation needed to process the task
+ */
+ public native void setComputeDuration(double computationAmount);
/* * * *
* * Computation-related * *
* * * */
* The natively implemented method to destroy a MSG task.
*/
protected native void destroy();
+ /* * * *
+ * * Communication-related * *
+ * * * */
/** Send the task asynchronously on the mailbox identified by the specified name,
* with no way to retrieve whether the communication succeeded or not
* @throws HostFailureException
* @throws TransferFailureException
*/
- public void send(String mailbox) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
+ public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
send(mailbox, -1);
}
* @throws HostFailureException
* @throws TransferFailureException
*/
- public native void send(String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException;
+ public native void send(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
/**
* Sends the task on the mailbox identified by the specified alias (capping the sending rate to \a maxrate)
*