Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a few more machines
[simgrid.git] / examples / msg / actions / actions.c
index 7a00e85..4f63ad1 100644 (file)
@@ -11,6 +11,8 @@
 #include "xbt.h"                /* calloc, printf */
 #include "simgrid_config.h"     /* getline */
 #include "instr/instr_private.h"
+void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory);
+
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(actions,
                              "Messages specific for this msg example");
@@ -129,8 +131,7 @@ static void action_recv(xbt_dynar_t action)
   char mailbox_name[250];
   m_task_t task = NULL;
   double clock = MSG_get_clock();
-  //FIXME: argument of action ignored so far; semantic not clear
-  //char *from=xbt_dynar_get_as(action,2,char*);
+
   sprintf(mailbox_name, "%s_%s", xbt_dynar_get_as(action, 2, char *),
           MSG_process_get_name(MSG_process_self()));
 
@@ -519,6 +520,8 @@ static void action_finalize(xbt_dynar_t action)
   process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
   if (globals){
     xbt_dynar_free_container(&(globals->isends));
+    xbt_dynar_free_container(&(globals->irecvs));
+    xbt_dynar_free_container(&(globals->tasks));
     free(globals);
   }
 }
@@ -528,6 +531,7 @@ int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 
+  factory_initializer_to_use = SIMIX_ctx_raw_factory_init;
   /* Check the given arguments */
   MSG_global_init(&argc, argv);
   if (argc < 3) {