Example #1
0
  private void processExamples(String group, List<Example> examples) {
    Evaluation evaluation = new Evaluation();
    if (examples.isEmpty()) return;

    final String prefix = "iter=0." + group;
    Execution.putOutput("group", group);
    LogInfo.begin_track_printAll("Processing %s: %s examples", prefix, examples.size());
    LogInfo.begin_track("Dumping metadata");
    dumpMetadata(group, examples);
    LogInfo.end_track();
    LogInfo.begin_track("Examples");

    for (int e = 0; e < examples.size(); e++) {
      Example ex = examples.get(e);
      LogInfo.begin_track_printAll("%s: example %s/%s: %s", prefix, e, examples.size(), ex.id);
      ex.log();
      Execution.putOutput("example", e);
      StopWatchSet.begin("Parser.parse");
      ParserState state = builder.parser.parse(params, ex, false);
      StopWatchSet.end();
      out.printf("########## Example %s ##########\n", ex.id);
      dumpExample(exampleToLispTree(state));
      LogInfo.logs("Current: %s", ex.evaluation.summary());
      evaluation.add(ex.evaluation);
      LogInfo.logs("Cumulative(%s): %s", prefix, evaluation.summary());
      LogInfo.end_track();
      ex.predDerivations.clear(); // To save memory
    }

    LogInfo.end_track();
    LogInfo.logs("Stats for %s: %s", prefix, evaluation.summary());
    evaluation.logStats(prefix);
    evaluation.putOutput(prefix);
    LogInfo.end_track();
  }
Example #2
0
 @Override
 public void run() {
   builder = new Builder();
   builder.build();
   dataset = new Dataset();
   dataset.read();
   params = new Params();
   for (String group : dataset.groups()) {
     String filename = Execution.getFile("dumped-" + group + ".gz");
     out = IOUtils.openOutHard(filename);
     processExamples(group, dataset.examples(group));
     out.close();
     LogInfo.logs("Finished dumping to %s", filename);
     StopWatchSet.logStats();
   }
 }
Example #3
0
 void processCommand(String cmd) {
   cmd = cmd.trim();
   if (cmd.equals("")) {
     // Print status
     Execution.getInfo().print(stderr);
     Execution.printOutputMapToStderr();
     StopWatchSet.getStats().print(stderr);
     stderr.println(Execution.getVirtualExecDir());
   } else if (cmd.equals("kill")) {
     stderr.println("MonitorThread: KILLING");
     Execution.setExecStatus("killed", true);
     Execution.printOutputMap(Execution.getFile("output.map"));
     throw new RuntimeException("Killed by input command");
   } else if (cmd.equals("bail")) {
     // Up to program to look at this flag and actually gracefully stop
     stderr.println("MonitorThread: BAILING OUT");
     Execution.shouldBail = true;
   } else stderr.println("Invalid command: '" + cmd + "'");
 }