Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc' into mc++
[simgrid.git] / examples / msg / masterslave / masterslave_arg.c
index 58c7d7b..7bf9f87 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@ int master(int argc, char *argv[])
   for (i = 1; i <= number_of_jobs; i++) {
     char mailbox[256];
     char sprintf_buffer[256];
-    m_task_t task = NULL;
+    msg_task_t task = NULL;
 
     sprintf(mailbox, "slave-%ld", i % number_of_slaves);
     sprintf(sprintf_buffer, "Task_%d", i);
@@ -55,7 +55,7 @@ int master(int argc, char *argv[])
     char mailbox[80];
 
     sprintf(mailbox, "slave-%ld", i % number_of_slaves);
-    m_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
+    msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
     MSG_task_send(finalize, mailbox);
   }
 
@@ -66,7 +66,7 @@ int master(int argc, char *argv[])
 /** Receiver function  */
 int slave(int argc, char *argv[])
 {
-  m_task_t task = NULL;
+  msg_task_t task = NULL;
   _XBT_GNUC_UNUSED int res;
 
   XBT_DEBUG("mailbox: %s",MSG_process_get_name(MSG_process_self()));
@@ -92,10 +92,10 @@ int slave(int argc, char *argv[])
 /** Main function */
 int main(int argc, char *argv[])
 {
-  MSG_error_t res = MSG_OK;
+  msg_error_t res = MSG_OK;
   long i;
 
-  MSG_global_init(&argc, argv);
+  MSG_init(&argc, argv);
   if (argc < 4) {
     printf("Usage: %s platform_file number_of_jobs number_of_slaves\n", argv[0]);
     printf("example: %s msg_platform.xml 10 5\n", argv[0]);
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
   long number_max = xbt_dynar_length(host_dynar);
   XBT_INFO("Got %ld slaves, %ld tasks to process, and %ld hosts", number_of_slaves, number_of_jobs,number_max);
 
-  m_host_t *host_table =  xbt_dynar_to_array(host_dynar);
+  msg_host_t *host_table =  xbt_dynar_to_array(host_dynar);
   //xbt_dynar_free(&host_dynar);
 
   MSG_process_create( "master",
@@ -138,8 +138,6 @@ int main(int argc, char *argv[])
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
-  MSG_clean();
-
   if (res == MSG_OK)
     return 0;
   else