|
@@ -0,0 +1,37 @@
|
|
|
+
|
|
|
+ * experimentQueueMain.cpp
|
|
|
+ * - compiles to bin/queue
|
|
|
+ * - runs through a set of controls to run the orchestrator with multiple settings over time
|
|
|
+ *
|
|
|
+ * Stan Gurtler
|
|
|
+ */
|
|
|
+
|
|
|
+#include <iostream>
|
|
|
+#include <fstream>
|
|
|
+#include <cstring>
|
|
|
+#include <cstdlib>
|
|
|
+
|
|
|
+int main(int argc, char* argv[])
|
|
|
+{
|
|
|
+ const char *ORCHESTRATOR = "bin/orchestrator ";
|
|
|
+ const int ORCHESTRATOR_LEN = strlen(ORCHESTRATOR);
|
|
|
+ const int INPUT_BUFFER_LEN = 133;
|
|
|
+ const int OUTPUT_BUFFER_LEN = ORCHESTRATOR_LEN + INPUT_BUFFER_LEN;
|
|
|
+
|
|
|
+ char inputBuffer[INPUT_BUFFER_LEN], outputBuffer[OUTPUT_BUFFER_LEN];
|
|
|
+ std::ifstream configFile("cfg/queue.cfg");
|
|
|
+ while (!configFile.eof())
|
|
|
+ {
|
|
|
+ configFile.getline(inputBuffer, INPUT_BUFFER_LEN);
|
|
|
+ if (strlen(inputBuffer) > 0)
|
|
|
+ {
|
|
|
+ strncpy(outputBuffer, ORCHESTRATOR, ORCHESTRATOR_LEN);
|
|
|
+ strncpy(outputBuffer + ORCHESTRATOR_LEN, inputBuffer, INPUT_BUFFER_LEN);
|
|
|
+ outputBuffer[OUTPUT_BUFFER_LEN] = 0;
|
|
|
+
|
|
|
+ int sysOut = system(outputBuffer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|