예제 #1
0
 static OrderedStringMap getInfo() {
   OrderedStringMap map = new OrderedStringMap();
   map.put("Date", SysInfoUtils.getCurrentDateStr());
   map.put("Host", SysInfoUtils.getHostName());
   map.put("CPU speed", SysInfoUtils.getCPUSpeedStr());
   map.put("Max memory", SysInfoUtils.getMaxMemoryStr());
   map.put("Num CPUs", SysInfoUtils.getNumCPUs());
   return map;
 }
예제 #2
0
  public static void finish() {
    if (!makeThunk) {
      Record.finish();

      if (monitor) monitorThread.finish();
      setExecStatus("done", false);
      outputMap.printEasy(getFile("output.map"));
      StopWatch.getStats().printEasy(getFile("time.map"));
      if (create) stderr.println(virtualExecDir);
      if (LogInfo.getNumErrors() > 0 || LogInfo.getNumWarnings() > 0)
        stderr.printf("%d errors, %d warnings\n", LogInfo.getNumErrors(), LogInfo.getNumWarnings());
      if (startMainTrack) end_track();
    }

    System.exit(exitCode);
  }
예제 #3
0
 public static void setExecStatus(String newStatus, boolean override) {
   String oldStatus = outputMap.get("exec.status");
   if (oldStatus == null || oldStatus.equals("running")) override = true;
   if (override) putOutput("exec.status", newStatus);
 }
예제 #4
0
 public static synchronized void printOutputMap(String path) {
   if (StrUtils.isEmpty(path)) return;
   // First write to a temporary directory and then rename the file
   String tmpPath = path + ".tmp";
   if (outputMap.printEasy(tmpPath)) new File(tmpPath).renameTo(new File(path));
 }
예제 #5
0
 public static synchronized void printOutputMapToStderr() {
   outputMap.print(stderr);
 }
예제 #6
0
 public static synchronized void putOutput(String s, Object t) {
   outputMap.put(s, StrUtils.toString(t));
 }
예제 #7
0
 public static String getInput(String s) {
   return inputMap.get(s);
 }
예제 #8
0
 // Getting input and writing output
 public static boolean getBooleanInput(String s) {
   String t = inputMap.get(s, "0");
   return t.equals("true") || t.equals("1");
 }