dol: initial dol commit
[jump.git] / dol / src / dol / visitor / yapi / lib / main.cpp
diff --git a/dol/src/dol/visitor/yapi/lib/main.cpp b/dol/src/dol/visitor/yapi/lib/main.cpp
new file mode 100644 (file)
index 0000000..2879eb3
--- /dev/null
@@ -0,0 +1,41 @@
+#include "yapi.h"
+#include "application.h"
+#include <fstream>
+
+using namespace std;
+
+int main()
+{
+  // create yapi run-time environment
+  RTE rte;
+
+  // redirect standard output
+  ofstream f("./app.out");
+  rte.setOutStream(f);
+
+  // redirect standard error
+  ofstream g("./app.err");
+  rte.setErrorStream(g);
+
+  // create toplevel process network
+  Application app(id("app"));
+
+  // start the process network and
+  // wait for processes to finish
+  rte.start(app);
+
+  // print workload
+  ofstream h("./appworkload.txt");
+  printWorkload(app, h);
+
+  // generate dotty file
+  ofstream i("./app.dot");
+  printDotty(app, i);
+
+  f.close();
+  g.close();
+  h.close();
+  i.close();
+
+  return 0;
+}