Class ParallelSolver

java.lang.Object
solvers.linearSystemSolver.Solver
solvers.linearSystemSolver.ParallelSolver
All Implemented Interfaces:
SolverInterface
Direct Known Subclasses:
ModularSolver

public class ParallelSolver extends Solver
This class extends the Solver one and adds to it all useful fields and methods a parallel solver should support, such as thread management code, shutdown routines, etc.
Author:
Michail Makaronidis, 2010
  • Field Details

    • nThreads

      protected int nThreads
      The number of threads the ParallelSolver must use.
    • pool

      protected ExecutorService pool
      The pool of worker threads where the parallel tasks are given for execution.
  • Constructor Details

    • ParallelSolver

      public ParallelSolver(int nThreads)
      Initialises the ParallelSolver object and creates the worker threads.
      Parameters:
      nThreads - The number of threads the ParallelSolver must use
  • Method Details

    • shutdown

      public void shutdown()
      Shutsdown the solver, terminating all pools of threads and child processes if any exist.
      Overrides:
      shutdown in class Solver