/** * Constructor. * * @param threads number of threads to use. * @param pool ThreadPool to use. * @param pl pair selection strategy */ public GroebnerBaseDistributedMPI(int threads, ThreadPool pool, PairList<C> pl) throws IOException { super(new ReductionPar<C>(), pl); int size = 0; try { engine = MPIEngine.getCommunicator(); size = engine.Size(); } catch (MPIException e) { throw new IOException(e); } if (size < 2) { throw new IllegalArgumentException("Minimal 2 MPI processes required, not " + size); } if (threads != size || pool.getNumber() != size) { throw new IllegalArgumentException( "threads != size: " + threads + " != " + size + ", #pool " + pool.getNumber()); } this.threads = threads; this.pool = pool; }