コード例 #1
0
ファイル: PilotSet.java プロジェクト: vdhelm/amuse
  // check if all pilots are running. will throw an error if any pilots are done/failed
  private boolean allPilotsRunning() throws DistributedAmuseException {
    PilotManager[] pilots = getPilots();
    int running = 0;

    boolean result = true;

    for (PilotManager pilot : pilots) {
      if (pilot.hasException()) {
        throw new DistributedAmuseException(
            "Pilot " + pilot + " failed while waiting for it to start", pilot.getException());
      }
      if (pilot.isDone()) {
        throw new DistributedAmuseException(
            "Pilot " + pilot + " done while waiting for it to start");
      }
      if (pilot.isRunning()) {
        running++;
      } else {
        result = false;
      }
    }
    logger.debug("Now {} out of {} pilots running.", running, pilots.length);
    return result;
  }