*/
public static Host getByName(String name)
throws HostNotFoundException {
- Process.ifInterruptedStop();
if (name==null)
throw new NullPointerException("No host can have a null name");
return MsgNative.hostGetByName(name);
*
*/
public static int getCount() {
- Process.ifInterruptedStop();
return MsgNative.hostGetCount();
}
* @return The host on which the current process is executed.
*/
public static Host currentHost() {
- Process.ifInterruptedStop();
return MsgNative.hostSelf();
}
*
*/
public static Host[] all() {
- Process.ifInterruptedStop();
return MsgNative.allHosts();
}
*
*/
public String getName() {
- Process.ifInterruptedStop();
return MsgNative.hostGetName(this);
}
* @param data
*/
public void setData(Object data) {
- Process.ifInterruptedStop();
this.data = data;
}
/**
* @return
*/
public Object getData() {
- Process.ifInterruptedStop();
return this.data;
}
* @return
*/
public boolean hasData() {
- Process.ifInterruptedStop();
return null != this.data;
}
* @return The number of tasks currently running on a host.
*/
public int getLoad() {
- Process.ifInterruptedStop();
return MsgNative.hostGetLoad(this);
}
*
*/
public double getSpeed() {
- Process.ifInterruptedStop();
return MsgNative.hostGetSpeed(this);
}
* @return
*/
public boolean isAvail() {
- Process.ifInterruptedStop();
return MsgNative.hostIsAvail(this);
}
}
{
return nativeStop;
}
- /**
- * checks if the flag that indicates that this thread must be killed is set to true; if true, starts to kill it. End users should not have to deal with it
- * If you develop a new MSG native call, please include a call to interruptedStop() at the beginning of your method code, so as the process can be killed if he call
- * your method.
- *
- * @return
- *
- */
- @Deprecated
- public static void ifInterruptedStop() {
- /* This function does nothing anymore and will get removed very soon */
- }
-
/**
* This method kill a process.
*
*/
public void pause() {
- Process.ifInterruptedStop();
MsgNative.processSuspend(this);
}
/**
*
*/
public void restart() {
- Process.ifInterruptedStop();
MsgNative.processResume(this);
}
/**
* Otherwise the method returns false.
*/
public boolean isSuspended() {
- Process.ifInterruptedStop();
return MsgNative.processIsSuspended(this);
}
/**
*
*/
public Host getHost() {
- Process.ifInterruptedStop();
if (this.host == null) {
this.host = MsgNative.processGetHost(this);
}
* @exception NativeException on error in the native SimGrid code
*/
public static Process fromPID(int PID) throws NativeException {
- Process.ifInterruptedStop();
return MsgNative.processFromPID(PID);
}
/**
*
*/
public int getPID() {
- Process.ifInterruptedStop();
if (pid == -1) {
pid = MsgNative.processGetPID(this);
}
*
*/
public int getPPID() {
- Process.ifInterruptedStop();
if (ppid == -1) {
ppid = MsgNative.processGetPPID(this);
}
*
*/
public static Process currentProcess() {
- Process.ifInterruptedStop();
return MsgNative.processSelf();
}
/**
*
*/
public static void migrate(Process process, Host host) {
- Process.ifInterruptedStop();
MsgNative.processMigrate(process, host);
process.host = null;
}
* @exception HostFailureException on error in the native SimGrid code
*/
public static void waitFor(double seconds) throws HostFailureException {
- Process.ifInterruptedStop();
MsgNative.processWaitFor(seconds);
}
/**
*
*/
public void showArgs() {
- Process.ifInterruptedStop();
Msg.info("[" + this.name + "/" + this.getHost().getName() + "] argc=" +
this.args.size());
for (int i = 0; i < this.args.size(); i++)
* @throws HostFailureException
* @throws TransferFailureException */
public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, task, timeout);
}
* @throws HostFailureException
* @throws TransferFailureException */
public void taskSend(String mailbox, Task task) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, task, -1);
}
* @throws TimeoutException
*/
public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, null);
}
* @throws TimeoutException
*/
public Task taskReceive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, null);
}
* @throws TimeoutException
*/
public Task taskReceive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, host);
}
* @throws TimeoutException
*/
public Task taskReceive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, host);
}
}
* @return
*/
public String getName() {
- Process.ifInterruptedStop();
return MsgNative.taskGetName(this);
}
/** Gets the sender of the task */
Process getSender() {
- Process.ifInterruptedStop();
return MsgNative.taskGetSender(this);
}
/** Gets the source of the task
* @return
*/
public Host getSource() {
- Process.ifInterruptedStop();
return MsgNative.taskGetSource(this);
}
/** Gets the computing amount of the task
* @return
*/
public double getComputeDuration() {
- Process.ifInterruptedStop();
return MsgNative.taskGetComputeDuration(this);
}
/** Gets the remaining computation of the task
* @return
*/
public double getRemainingDuration() {
- Process.ifInterruptedStop();
return MsgNative.taskGetRemainingDuration(this);
}
/**
* This method sets the priority of the computation of the task.
- * The priority doesn't affect the transfert rate. For example a
+ * The priority doesn't affect the transfer rate. For example a
* priority of 2 will make the task receive two times more cpu than
* the other ones.
*
* @param priority The new priority of the task.
*/
public void setPriority(double priority) {
- Process.ifInterruptedStop();
MsgNative.taskSetPriority(this, priority);
}
/* * * *
* @throws TaskCancelledException
*/
public void execute() throws HostFailureException,TaskCancelledException {
- Process.ifInterruptedStop();
MsgNative.taskExecute(this);
}
/**
*
*/
public void cancel() {
- Process.ifInterruptedStop();
MsgNative.taskCancel(this);
}
/** Deletes a task.
* @exception NativeException if the destruction failed.
*/
protected void finalize() throws NativeException {
- Process.ifInterruptedStop();
if (this.bind != 0)
MsgNative.taskDestroy(this);
}
* @throws TransferFailureException
*/
public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, this, -1);
}
* @throws TransferFailureException
*/
public void send(String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, this, timeout);
}
* @throws TimeoutException
*/
public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSendBounded(alias, this, maxrate);
}
*/
public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, null);
}
* @throws TimeoutException
*/
public static Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, null);
}
*/
public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, host);
}
* @throws TimeoutException
*/
public static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, host);
}
* @return
*/
public static int listenFrom(String mailbox) {
- Process.ifInterruptedStop();
return MsgNative.taskListenFrom(mailbox);
}
/**
* @return
*/
public static boolean listen(String mailbox) {
- Process.ifInterruptedStop();
return MsgNative.taskListen(mailbox);
}
* @return
*/
public static int listenFromHost(String alias, Host host) {
- Process.ifInterruptedStop();
return MsgNative.taskListenFromHost(alias, host);
}
}