Esempio n. 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;
 }
Esempio n. 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);
  }
Esempio n. 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);
 }
Esempio n. 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));
 }
Esempio n. 5
0
 public static synchronized void printOutputMapToStderr() {
   outputMap.print(stderr);
 }
Esempio n. 6
0
 public static synchronized void putOutput(String s, Object t) {
   outputMap.put(s, StrUtils.toString(t));
 }
Esempio n. 7
0
 public static String getInput(String s) {
   return inputMap.get(s);
 }
Esempio n. 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");
 }