ibis.satin.impl.loadBalancing
Class ClusterAwareRandomWorkStealing

java.lang.Object
  extended by ibis.satin.impl.loadBalancing.LoadBalancingAlgorithm
      extended by ibis.satin.impl.loadBalancing.ClusterAwareRandomWorkStealing
All Implemented Interfaces:
Protocol, Config

public final class ClusterAwareRandomWorkStealing
extends LoadBalancingAlgorithm
implements Protocol, Config


Field Summary
 
Fields inherited from interface ibis.satin.impl.communication.Protocol
ABORT, ABORT_AND_STORE, ASYNC_STEAL_AND_TABLE_REQUEST, ASYNC_STEAL_REPLY_FAILED, ASYNC_STEAL_REPLY_FAILED_TABLE, ASYNC_STEAL_REPLY_SUCCESS, ASYNC_STEAL_REPLY_SUCCESS_TABLE, ASYNC_STEAL_REQUEST, BARRIER_REPLY, BARRIER_REQUEST, BLOCKING_STEAL_REQUEST, CHECKPOINT, CHECKPOINT_INFO, CHECKPOINT_REQUEST, COORDINATOR_INFO, CRASH, EXIT, EXIT_REPLY, EXIT_STAGE2, FILE_WRITE_TIME, FILE_WRITE_TIME_REQ, GRT_UPDATE, JOB_RESULT_EXCEPTION, JOB_RESULT_NORMAL, PAUSE, RESULT_PUSH, RESULT_REQUEST, RESUME, SO_DEMAND, SO_INVOCATION, SO_NACK, SO_REQUEST, SO_TRANSFER, STEAL_AND_TABLE_REQUEST, STEAL_REPLY_FAILED, STEAL_REPLY_FAILED_TABLE, STEAL_REPLY_SUCCESS, STEAL_REPLY_SUCCESS_TABLE, STEAL_REQUEST
 
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
ClusterAwareRandomWorkStealing(Satin s)
           
 
Method Summary
 InvocationRecord clientIteration()
          Called in every iteration of the client loop.
 void exit()
          This one is called in the exit procedure so the algorithm can clean up, e.g., wait for pending (async) messages Default implementation does nothing.
 void handleCrash(ibis.ipl.IbisIdentifier crashedIbis)
          Used in fault tolerance; check if the asynchronous steal victim crashed; if so, cancel the steal request; if the job already arrived, remove it (it should be aborted anyway, since it was stolen from a crashed machine) if the owner of the asynchronously stolen job crashed, abort the job.
 void stealReplyHandler(InvocationRecord ir, ibis.ipl.IbisIdentifier sender, int opcode)
          This one is called for each steal reply by the MessageHandler, so the algorithm knows about the reply (this is needed with asynchronous communication)
 
Methods inherited from class ibis.satin.impl.loadBalancing.LoadBalancingAlgorithm
jobAdded
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterAwareRandomWorkStealing

public ClusterAwareRandomWorkStealing(Satin s)
Method Detail

clientIteration

public InvocationRecord clientIteration()
Description copied from class: LoadBalancingAlgorithm
Called in every iteration of the client loop. It decides which jobs are run, and what kind(s) of steal requests are done. returns a job an success, null on failure.

Specified by:
clientIteration in class LoadBalancingAlgorithm

stealReplyHandler

public void stealReplyHandler(InvocationRecord ir,
                              ibis.ipl.IbisIdentifier sender,
                              int opcode)
Description copied from class: LoadBalancingAlgorithm
This one is called for each steal reply by the MessageHandler, so the algorithm knows about the reply (this is needed with asynchronous communication)

Overrides:
stealReplyHandler in class LoadBalancingAlgorithm

exit

public void exit()
Description copied from class: LoadBalancingAlgorithm
This one is called in the exit procedure so the algorithm can clean up, e.g., wait for pending (async) messages Default implementation does nothing.

Overrides:
exit in class LoadBalancingAlgorithm

handleCrash

public void handleCrash(ibis.ipl.IbisIdentifier crashedIbis)
Used in fault tolerance; check if the asynchronous steal victim crashed; if so, cancel the steal request; if the job already arrived, remove it (it should be aborted anyway, since it was stolen from a crashed machine) if the owner of the asynchronously stolen job crashed, abort the job.

Overrides:
handleCrash in class LoadBalancingAlgorithm


The Ibis project