ibis.satin
Class SatinObject

java.lang.Object
  extended by ibis.satin.SatinObject
All Implemented Interfaces:
Serializable

public class SatinObject
extends Object
implements Serializable

This is the magic class that should be extended by objects that implement spawnable methods. When the program is not rewritten by the Satin frontend, the methods described here are basically no-ops, and the program will run sequentially. When the program is rewritten by the Satin frontend, calls to spawnable methods, and calls to sync()and abort()will be rewritten.

See Also:
Serialized Form

Method Summary
 void abort()
          Recursively aborts all methods that were spawned by the current method and all methods spawned by the aborted methods.
static Serializable deepCopy(Serializable o)
          Creates and returns a deep copy of the specified object.
static boolean localJob()
          Returns whether the current Satin job was generated by the machine it is running on.
static boolean needMoreJobs()
          Returns whether it might be useful to spawn more Satin jobs.
static void pause()
          Pauses Satin operation.
static void resume()
          Resumes Satin operation.
 void sync()
          Waits until all spawned methods in the current method are finished.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sync

public void sync()
Waits until all spawned methods in the current method are finished.


abort

public void abort()
Recursively aborts all methods that were spawned by the current method and all methods spawned by the aborted methods.


pause

public static void pause()
Pauses Satin operation. This method can optionally be called before a large sequential part in a program. This will temporarily pause Satin's internal load distribution strategies to avoid communication overhead during sequential code.


resume

public static void resume()
Resumes Satin operation. This method can optionally be called after a large sequential part in a program.


needMoreJobs

public static boolean needMoreJobs()
Returns whether it might be useful to spawn more Satin jobs. If there is enough work in the system to keep all processors busy, this method returns false.

Returns:
true if it might be useful to spawn more invocations, false if there is enough work in the system.

localJob

public static boolean localJob()
Returns whether the current Satin job was generated by the machine it is running on. Satin jobs can be distributed to remote machines by the Satin runtime system, in which case this method returns false.

Returns:
true if the current invocation is not stolen from another processor.

deepCopy

public static Serializable deepCopy(Serializable o)
Creates and returns a deep copy of the specified object.

Parameters:
o - the object to be copied
Returns:
the copy.


The Ibis project