Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use msg_task_t instead of m_task_t
[simgrid.git] / examples / msg / tracing / user_variables.c
index e249ef3..1a4e607 100644 (file)
@@ -27,7 +27,7 @@ int master(int argc, char *argv[]);
 
 int master(int argc, char *argv[])
 {
-  char *hostname = MSG_host_self()->name;
+  const char *hostname = MSG_host_get_name(MSG_host_self());
   int i;
 
   //the hostname has an empty HDD with a capacity of 100000 (bytes)
@@ -36,7 +36,7 @@ int master(int argc, char *argv[])
 
   for (i = 0; i < 10; i++) {
     //create and execute a task just to make the simulated time advance
-    m_task_t task = MSG_task_create("task", 10000, 0, NULL);
+    msg_task_t task = MSG_task_create("task", 10000, 0, NULL);
     MSG_task_execute (task);
     MSG_task_destroy (task);
 
@@ -46,7 +46,7 @@ int master(int argc, char *argv[])
 
   for (i = 0; i < 10; i++) {
     //create and execute a task just to make the simulated time advance
-    m_task_t task = MSG_task_create("task", 10000, 0, NULL);
+    msg_task_t task = MSG_task_create("task", 10000, 0, NULL);
     MSG_task_execute (task);
     MSG_task_destroy (task);
 
@@ -59,7 +59,7 @@ int master(int argc, char *argv[])
 /** Main function */
 int main(int argc, char *argv[])
 {
-  MSG_global_init(&argc, argv);
+  MSG_init(&argc, argv);
   if (argc < 3) {
     printf("Usage: %s platform_file deployment_file\n", argv[0]);
     exit(1);
@@ -133,6 +133,7 @@ int main(int argc, char *argv[])
   fprintf (fp, " host = {\n  type = square;\n  size = HDD_capacity; \n  values = (HDD_utilization);\n };\n");
   fprintf (fp, " link = {\n  type = rhombus;\n  size = bandwidth;\n };\n");
   fprintf (fp, "}\n");
+  fclose (fp);
 
   MSG_clean();
   return 0;