Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Package Functions

simgrid::msg::Task Class Reference

Public Member Functions

 Task ()
 Task (String name, double computeDuration, double messageSize)
 Task (String name, Host[]hosts, double[]computeDurations, double[]messageSizes)
String getName ()
Host getSource ()
double getComputeDuration ()
double getRemainingDuration ()
void setPriority (double priority)
void execute () throws HostFailureException,TaskCancelledException
void cancel ()
void send (String mailbox) throws TransferFailureException, HostFailureException, TimeoutException
void send (String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException
void sendBounded (String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException

Static Public Member Functions

static Task receive (String mailbox) throws TransferFailureException, HostFailureException, TimeoutException
static Task receive (String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException
static Task receive (String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException
static Task receive (String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException
static int listenFrom (String mailbox)
static boolean listen (String mailbox)
static int listenFromHost (String alias, Host host)

Data Fields

long bind = 0

Protected Member Functions

void finalize () throws NativeException

Package Functions

Process getSender ()

Detailed Description

A task is either something to compute somewhere, or something to exchange between two hosts (or both). It is defined by a computing amount and a message size.


Constructor & Destructor Documentation

simgrid::msg::Task::Task (  )  [inline]

Default constructor (all fields to 0 or null)

simgrid::msg::Task::Task ( String  name,
double  computeDuration,
double  messageSize 
) [inline]

Construct an new task with the specified processing amount and amount of data needed.

Parameters:
name Task's name
computeDuration A value of the processing amount (in flop) needed to process the task. If 0, then it cannot be executed with the execute() method. This value has to be >= 0.
messageSize A value of amount of data (in bytes) needed to transfert this task. If 0, then it cannot be transfered with the get() and put() methods. This value has to be >= 0.
simgrid::msg::Task::Task ( String  name,
Host[]  hosts,
double[]  computeDurations,
double[]  messageSizes 
) [inline]

Construct an new parallel task with the specified processing amount and amount for each host implied.

Parameters:
name The name of the parallel task.
hosts The list of hosts implied by the parallel task.
computeDurations The amount of operations to be performed by each host of hosts.
messageSizes A matrix describing the amount of data to exchange between hosts.

Member Function Documentation

String simgrid::msg::Task::getName (  )  [inline]

Gets the name of a task

Process simgrid::msg::Task::getSender (  )  [inline, package]

Gets the sender of the task

Host simgrid::msg::Task::getSource (  )  [inline]

Gets the source of the task

double simgrid::msg::Task::getComputeDuration (  )  [inline]

Gets the computing amount of the task

double simgrid::msg::Task::getRemainingDuration (  )  [inline]

Gets the remaining computation of the task

void simgrid::msg::Task::setPriority ( double  priority  )  [inline]

This method sets the priority of the computation of the task. The priority doesn't affect the transfert rate. For example a priority of 2 will make the task receive two times more cpu than the other ones.

Parameters:
priority The new priority of the task.
void simgrid::msg::Task::execute (  )  throws HostFailureException,TaskCancelledException [inline]

Executes a task on the location on which the process is running.

Exceptions:
HostFailureException,TaskCancelledException 
void simgrid::msg::Task::cancel (  )  [inline]

Cancels a task.

Exceptions:
NativeException if the cancellation failed.
void simgrid::msg::Task::finalize (  )  throws NativeException [inline, protected]

Deletes a task.

Exceptions:
NativeException if the destruction failed.
void simgrid::msg::Task::send ( String  mailbox  )  throws TransferFailureException, HostFailureException, TimeoutException [inline]

Sends the task on the mailbox identified by the specified name

Exceptions:
TimeoutException 
HostFailureException 
TransferFailureException 
void simgrid::msg::Task::send ( String  mailbox,
double  timeout 
) throws NativeException, TransferFailureException, HostFailureException, TimeoutException [inline]

Sends the task on the mailbox identified by the specified name (wait at most timeout seconds)

Exceptions:
NativeException if the retrieval fails.
TimeoutException 
HostFailureException 
TransferFailureException 
void simgrid::msg::Task::sendBounded ( String  alias,
double  maxrate 
) throws TransferFailureException, HostFailureException, TimeoutException [inline]

Sends the task on the mailbox identified by the specified alias (capping the sending rate to maxrate)

Exceptions:
TransferFailureException,HostFailureException,TimeoutException. 
static Task simgrid::msg::Task::receive ( String  mailbox  )  throws TransferFailureException, HostFailureException, TimeoutException [inline, static]

Retrieves next task from the mailbox identified by the specified name

Exceptions:
TransferFailureException,HostFailureException,TimeoutException if the retrieval fails.
static Task simgrid::msg::Task::receive ( String  mailbox,
double  timeout 
) throws TransferFailureException, HostFailureException, TimeoutException [inline, static]

Retrieves next task on the mailbox identified by the specified name (wait at most timeout seconds)

Exceptions:
TransferFailureException,HostFailureException,TimeoutException if the retrieval fails.
static Task simgrid::msg::Task::receive ( String  mailbox,
Host  host 
) throws TransferFailureException, HostFailureException, TimeoutException [inline, static]

Retrieves next task sent by a given host on the mailbox identified by the specified alias

Exceptions:
TransferFailureException,HostFailureException,TimeoutException if the retrieval fails.
static Task simgrid::msg::Task::receive ( String  mailbox,
double  timeout,
Host  host 
) throws TransferFailureException, HostFailureException, TimeoutException [inline, static]

Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most timeout seconds)

Exceptions:
TransferFailureException,HostFailureException,TimeoutException if the retrieval fails.
static int simgrid::msg::Task::listenFrom ( String  mailbox  )  [inline, static]

Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it

static boolean simgrid::msg::Task::listen ( String  mailbox  )  [inline, static]

Listen whether there is a waiting task on the mailbox identified by the specified alias

static int simgrid::msg::Task::listenFromHost ( String  alias,
Host  host 
) [inline, static]

Counts the number of tasks waiting to be received on the mailbox identified by the specified alia and sended by the specified host.


Field Documentation

This attribute represents a bind between a java task object and a native task. Even if this attribute is public you must never access to it. It is set automatically during the build of the object.


Back to the main Simgrid Documentation page Generated for SimGridAPI by doxygen