Interface DistributedTask<I extends Serializable, O extends Serializable>

Type Parameters:
I - Input type (must be Serializable for network transfer)
O - Output type (must be Serializable for network transfer)
All Superinterfaces:
Serializable
All Known Implementing Classes:
CrisprTask, DistributedEconomyTask, DnaFoldingTask, FluidSimTask, GeneralCirculationModelTask, GeopoliticalEngineTask, MandelbrotTask, MolecularDynamicsTask, MonteCarloPiTask, NBodyTask, ProteinFoldingTask, WaveSimTask

public interface DistributedTask<I extends Serializable, O extends Serializable> extends Serializable
Core interface for distributed scientific computation tasks.

Tasks implementing this interface can be dynamically dispatched by the Episteme distributed computing infrastructure. The server can send task implementations to workers on-demand, eliminating the need for hardcoded task handlers.

Example usage:

public class MandelbrotTask implements DistributedTask<MandelbrotInput, double[]> {
    @Override
    public String getTaskType() {
        return "MANDELBROT";
    }

    @Override
    public double[] execute(MandelbrotInput input) {
        // Compute Mandelbrot slice
        return result;
    }
}

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(I input)
    Executes the computation for the given input chunk.
    default int
    Returns the estimated computational complexity.
    default String
    Returns a human-readable description of this task.
    Returns the expected input type class.
    Returns the expected output type class.
    Returns the unique task type identifier.
    default boolean
    Indicates whether this task can utilize GPU acceleration.
  • Method Details

    • getTaskType

      String getTaskType()
      Returns the unique task type identifier.

      This identifier is used by the task registry to locate and instantiate the appropriate task implementation. Examples: "MANDELBROT", "PROTEIN_FOLDING", "N_BODY", "CLIMATE_MODEL".

      Returns:
      the task type identifier (non-null, uppercase with underscores)
    • execute

      O execute(I input) throws ComputationException
      Executes the computation for the given input chunk.

      This method contains the core scientific algorithm. It receives a chunk of input data and returns the computed result. The infrastructure handles serialization, network transfer, and result aggregation.

      Parameters:
      input - the input data for this computation chunk
      Returns:
      the computed result
      Throws:
      ComputationException - if the computation fails
    • getInputType

      Class<I> getInputType()
      Returns the expected input type class.

      Used for deserialization and type checking during task dispatch.

      Returns:
      the Class object representing the input type
    • getOutputType

      Class<O> getOutputType()
      Returns the expected output type class.

      Used for serialization and type checking during result collection.

      Returns:
      the Class object representing the output type
    • getDescription

      default String getDescription()
      Returns a human-readable description of this task.

      Displayed in monitoring UIs (GridMonitor, DataLake browser).

      Returns:
      a brief description of what this task computes
    • getComplexity

      default int getComplexity()
      Returns the estimated computational complexity.

      Used by the scheduler to balance load across workers. Higher values indicate more intensive computation.

      Returns:
      complexity score (1-100, default 50)
    • supportsGPU

      default boolean supportsGPU()
      Indicates whether this task can utilize GPU acceleration.

      If true, the worker may route this task to a GPU-enabled backend if available.

      Returns:
      true if GPU execution is supported