ibis.satin.impl
Class Satin

java.lang.Object
  extended by ibis.satin.impl.Satin
All Implemented Interfaces:
Config

public final class Satin
extends Object
implements Config


Field Summary
 Aborts aborts
           
 LoadBalancingAlgorithm algorithm
          My scheduling algorithm.
 boolean clusterCoordinator
          Am I the cluster coordinator?
 Communication comm
           
 boolean currentVictimCrashed
           
 Vector<ibis.ipl.IbisIdentifier> deadIbises
          Used for fault tolerance.
 boolean exiting
          Set to true if we need to exit for some reason.
 FaultTolerance ft
           
static boolean GLOBAL_PAUSE_RESUME
           
 ibis.ipl.IbisIdentifier ident
           
 LoadBalancing lb
           
 IRStack onStack
          The jobs that are currently being executed, they are on the Java stack.
 IRVector outstandingJobs
          This vector contains all jobs that were stolen from me.
 InvocationRecord parent
          The invocation record that is the parent of the current job.
 DoubleEndedQueue q
          The work queue.
 SharedObjects so
           
 Statistics stats
           
 Statistics totalStats
           
 VictimTable victims
          All victims, myself NOT included.
 
Fields inherited from interface ibis.satin.impl.Config
abortLogger, ASSERTS, CHECKPOINT_CLUSTER, CHECKPOINT_FILE, CHECKPOINT_FIRST, CHECKPOINT_INTERVAL, CHECKPOINT_MAXFILESIZE, CHECKPOINT_PUSH, CHECKPOINT_QUITTIME, CHECKPOINTING, CLIENT, CLOSE_CONNECTIONS, CLOSED, commLogger, CONNECT_TIMEOUT, CONNECTIONS_ON_DEMAND, connLogger, COORDINATOR_QUIT_DELAY_TIME, DELETE_CLUSTER_TIME, DELETE_TIME, DETAILED_STATS, DUMP, FT_NAIVE, ftLogger, grtLogger, HANDLE_MESSAGES_IN_LATENCY, inletLogger, KEEP_INTRA_CONNECTIONS, KILL_TIME, LABEL_ROUTING_MCAST, mainLogger, MASTER_HOST, MAX_CONNECTIONS, MAX_STEAL_THROTTLE, properties, PROPERTY_PREFIX, QUEUE_STEALS, s_alg, s_asserts, s_client, s_close_connections, s_closed, s_connections_on_demand, s_cpt, s_cpt_cluster, s_cpt_file, s_cpt_first, s_cpt_interval, s_cpt_maxFileSize, s_cpt_push, s_cpt_quit, s_delete_cluster_time, s_delete_time, s_detailed_stats, s_dump, s_ft_connectTimeout, s_ft_naive, s_in_latency, s_keep_intra_connections, s_kill_time, s_masterhost, s_max_connections, s_max_steal_throttle, s_queue_steals, s_so_delay, s_so_lrmc, s_so_size, s_so_wait_time, s_stats, s_steal_wait_timeout, s_throttle_steals, s_unreliable, SO_MAX_INVOCATION_DELAY, SO_MAX_MESSAGE_SIZE, SO_WAIT_FOR_UPDATES_TIME, soBcastLogger, soLogger, spawnLogger, STATS, STEAL_WAIT_TIMEOUT, stealLogger, SUPPLIED_ALG, sysprops, THROTTLE_STEALS, UNRELIABLE
 
Constructor Summary
Satin()
          Creates a Satin instance and also an Ibis instance to run Satin on.
 
Method Summary
 void abort(InvocationRecord outstandingSpawns, InvocationRecord exceptionThrower)
          Aborts the spawns that are the result of the specified invocation record.
static void addInterClusterStats(long cnt)
           
static void addIntraClusterStats(long cnt)
           
 void assertFailed(String reason, Throwable t)
           
static void assertFailedStatic(String reason, Throwable t)
           
static void assertLocked(Object o)
           
 void broadcastSOInvocation(SOInvocationRecord r)
           
 void client()
          Implements the main client loop: steal jobs and execute them.
static Serializable deepCopy(Serializable o)
           
 void exit()
          Called at the end of the rewritten "main", to do a synchronized exit.
 void exit(Throwable e)
          Called at the end of the rewritten main in case the original main threw an exception.
 ibis.ipl.IbisIdentifier getMasterIdent()
           
 InvocationRecord getParent()
          Returns the parent of the current job, used in generated code.
static Satin getSatin()
           
 void handleDelayedMessages()
           
 boolean isMaster()
          Returns true if this is the instance that is running main().
static boolean localJob()
          Returns whether the current method was generated by the machine it is running on.
static boolean needMoreJobs()
          Returns whether it might be useful to spawn more methods.
static void pause()
          Pause Satin operation.
static void resume()
          Resume Satin operation.
 void setMaster(ibis.ipl.IbisIdentifier newMaster)
           
 void spawn(InvocationRecord r)
          Spawns the method invocation as described by the specified invocation record.
 void sync(SpawnCounter s)
          Waits for the jobs as specified by the spawncounter given, but meanwhile execute jobs from the end of the jobqueue (or rather, the head of the job queue, where new jobs are added).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_PAUSE_RESUME

public static final boolean GLOBAL_PAUSE_RESUME
See Also:
Constant Field Values

comm

public final Communication comm

lb

public final LoadBalancing lb

ft

public final FaultTolerance ft

so

public final SharedObjects so

aborts

public final Aborts aborts

ident

public final ibis.ipl.IbisIdentifier ident

clusterCoordinator

public boolean clusterCoordinator
Am I the cluster coordinator?


algorithm

public LoadBalancingAlgorithm algorithm
My scheduling algorithm.


exiting

public volatile boolean exiting
Set to true if we need to exit for some reason.


q

public final DoubleEndedQueue q
The work queue. Contains jobs that were spawned, but not yet executed.


outstandingJobs

public final IRVector outstandingJobs
This vector contains all jobs that were stolen from me. Used to locate the invocation record corresponding to the result of a remote job.


onStack

public final IRStack onStack
The jobs that are currently being executed, they are on the Java stack.


totalStats

public Statistics totalStats

stats

public Statistics stats

parent

public InvocationRecord parent
The invocation record that is the parent of the current job.


currentVictimCrashed

public volatile boolean currentVictimCrashed

victims

public final VictimTable victims
All victims, myself NOT included. The elements are Victims.


deadIbises

public final Vector<ibis.ipl.IbisIdentifier> deadIbises
Used for fault tolerance. All ibises that once took part in the computation, but then crashed. Assumption: ibis identifiers are uniqe in time; the same ibis cannot crash and join the computation again.

Constructor Detail

Satin

public Satin()
Creates a Satin instance and also an Ibis instance to run Satin on. This constructor gets called by the rewritten main() from the application, and the argument array from main is passed to this constructor. Which ibis is chosen depends, a.o., on these arguments.

Method Detail

exit

public void exit()
Called at the end of the rewritten "main", to do a synchronized exit.


exit

public void exit(Throwable e)
Called at the end of the rewritten main in case the original main threw an exception.


spawn

public void spawn(InvocationRecord r)
Spawns the method invocation as described by the specified invocation record. The invocation record is added to the job queue maintained by this Satin.

Parameters:
r - the invocation record specifying the spawned invocation.

sync

public void sync(SpawnCounter s)
Waits for the jobs as specified by the spawncounter given, but meanwhile execute jobs from the end of the jobqueue (or rather, the head of the job queue, where new jobs are added).

Parameters:
s - the spawncounter.

client

public void client()
Implements the main client loop: steal jobs and execute them.


handleDelayedMessages

public void handleDelayedMessages()

abort

public void abort(InvocationRecord outstandingSpawns,
                  InvocationRecord exceptionThrower)
Aborts the spawns that are the result of the specified invocation record. The invocation record of the invocation actually throwing the exception is also specified, but it is valid only for clones with inlets.

Parameters:
outstandingSpawns - parent of spawns that need to be aborted.
exceptionThrower - invocation throwing the exception.

pause

public static void pause()
Pause 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()
Resume 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 methods. If there is enough work in the system to keep all processors busy, this method returns false.


localJob

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


isMaster

public boolean isMaster()
Returns true if this is the instance that is running main().

Returns:
true if this is the instance running main().

setMaster

public void setMaster(ibis.ipl.IbisIdentifier newMaster)

broadcastSOInvocation

public void broadcastSOInvocation(SOInvocationRecord r)

assertLocked

public static void assertLocked(Object o)

getMasterIdent

public ibis.ipl.IbisIdentifier getMasterIdent()

assertFailedStatic

public static void assertFailedStatic(String reason,
                                      Throwable t)

assertFailed

public void assertFailed(String reason,
                         Throwable t)

addInterClusterStats

public static void addInterClusterStats(long cnt)

addIntraClusterStats

public static void addIntraClusterStats(long cnt)

deepCopy

public static Serializable deepCopy(Serializable o)

getSatin

public static final Satin getSatin()
Returns:
Returns the current Satin instance.

getParent

public InvocationRecord getParent()
Returns the parent of the current job, used in generated code.



The Ibis project