Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please codacy
[simgrid.git] / examples / msg / cloud-simple / cloud-simple.c
index 7129ee5..6f9d25d 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -85,17 +84,16 @@ static int communication_rx_fun(int argc, char *argv[])
 static void launch_communication_worker(msg_host_t tx_host, msg_host_t rx_host)
 {
   char *mbox = bprintf("MBOX:%s-%s", MSG_host_get_name(tx_host), MSG_host_get_name(rx_host));
-  char **argv = NULL;
-  
   const char *pr_name_tx =  "comm_tx";
-  argv = xbt_new(char *, 3);
+
+  char** argv = xbt_new(char*, 3);
   argv[0] = xbt_strdup(pr_name_tx);
   argv[1] = xbt_strdup(mbox);
   argv[2] = NULL;
 
   MSG_process_create_with_arguments(pr_name_tx, communication_tx_fun, NULL, tx_host, 2, argv);
 
-  const char *pr_name_rx =  "comm_rx";  
+  const char *pr_name_rx =  "comm_rx";
   argv = xbt_new(char *, 3);
   argv[0] = xbt_strdup(pr_name_rx);
   argv[1] = xbt_strdup(mbox);
@@ -239,7 +237,7 @@ static int master_main(int argc, char *argv[])
   s_vm_params_t params;
   memset(&params, 0, sizeof(params));
   params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
-  MSG_host_set_params(vm0, &params);
+  MSG_vm_set_params(vm0, &params);
 
   MSG_vm_start(vm0);
   launch_communication_worker(vm0, pm2);