/**
  * Distributed Groebner base.
  *
  * @param modv number of module variables.
  * @param F polynomial list.
  * @return GB(F) a Groebner base of F or null, if a IOException occurs or on MPI client part.
  */
 public List<GenPolynomial<C>> GB(int modv, List<GenPolynomial<C>> F) {
   try {
     if (engine.Rank() == 0) {
       return GBmaster(modv, F);
     }
   } catch (MPIException e) {
     logger.info("GBmaster: " + e);
     e.printStackTrace();
     return null;
   } catch (IOException e) {
     logger.info("GBmaster: " + e);
     e.printStackTrace();
     return null;
   }
   pool.terminate(); // not used on clients
   try {
     clientPart(0);
   } catch (IOException e) {
     logger.info("clientPart: " + e);
     e.printStackTrace();
   } catch (MPIException e) {
     logger.info("clientPart: " + e);
     e.printStackTrace();
   }
   return null;
 }