Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a simple test program for SimDag.
[simgrid.git] / testsuite / simdag / sd_test.c
diff --git a/testsuite/simdag/sd_test.c b/testsuite/simdag/sd_test.c
new file mode 100644 (file)
index 0000000..cf0b64a
--- /dev/null
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "simdag/simdag.h"
+
+int main(int argc, char **argv) {
+  
+  /* No deployment file
+  if (argc < 3) {
+     printf ("Usage: %s platform_file deployment_file\n", argv[0]);
+     printf ("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
+     exit(1);
+  }
+  */
+
+  if (argc < 2) {
+     printf ("Usage: %s platform_file\n", argv[0]);
+     printf ("example: %s msg_platform.xml\n", argv[0]);
+     exit(1);
+  }
+
+  /* initialisation of SD */
+  SD_init(&argc, argv);
+
+  /* creation of the environment */
+  char * platform_file = argv[1];
+  SD_create_environment(platform_file);
+
+  /* creation of the tasks and their dependencies */
+  
+
+  /* let's launch the simulation! */
+  SD_simulate(100);
+
+  SD_clean();
+  return 0;
+}