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; }
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); }
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); }
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)); }
public static synchronized void printOutputMapToStderr() { outputMap.print(stderr); }
public static synchronized void putOutput(String s, Object t) { outputMap.put(s, StrUtils.toString(t)); }
public static String getInput(String s) { return inputMap.get(s); }
// Getting input and writing output public static boolean getBooleanInput(String s) { String t = inputMap.get(s, "0"); return t.equals("true") || t.equals("1"); }