Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some build adjustments mandatory for the relocation of xbt_contexts [Cristian]
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 18:03:35 +0000 (18:03 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 18:03:35 +0000 (18:03 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6491 48e7efb5-ca39-0410-a469-dd3cf9ba447f

19 files changed:
src/Makefile.am
src/gras/Virtu/sg_dns.c
src/gras/Virtu/sg_process.c
src/include/simix/context.h
src/include/simix/datatypes.h
src/include/simix/simix.h
src/msg/environment.c
src/msg/private.h
src/simix/private.h
src/simix/smx_action.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_process.c
src/simix/smx_synchro.c
src/simix/xbt_context.c
src/simix/xbt_context_private.h
src/simix/xbt_context_sysv.c
src/xbt/xbt_sg_stubs.c
teshsuite/Makefile.am

index 085d6f0..71f276f 100644 (file)
@@ -185,9 +185,7 @@ SURF_SRC= \
   xbt/xbt_sg_stubs.c
 
 if CONTEXT_THREADS
-  SURF_SRC +=  xbt/xbt_os_thread.c xbt/xbt_context_thread.c  
-else  
-  SURF_SRC += xbt/xbt_context_sysv.c
+  SURF_SRC +=  xbt/xbt_os_thread.c
 endif
 
 GTNETS_SRC= \
@@ -198,7 +196,7 @@ GTNETS_SRC= \
 
 # Separated because src/gras/rl_stubs also define the function xbt_context_mod_init() and xbt_context_mod_exit()
 # so there is an implementation of these functions in the simgrid library and an implementatin in the gras library 
-CTX_SRC= xbt/xbt_context.c
+CTX_SRC= simix/xbt_context.c
 
 SIMIX_SRC= \
   simix/smx_global.c \
@@ -208,6 +206,12 @@ SIMIX_SRC= \
   simix/smx_process.c \
   simix/smx_action.c \
   simix/smx_synchro.c
+  
+if CONTEXT_THREADS
+  SURF_SRC += simix/xbt_context_thread.c  
+else  
+  SURF_SRC += simix/xbt_context_sysv.c
+endif  
 
 SMPI_SRC= \
   smpi/smpi_base.c \
@@ -225,7 +229,7 @@ MSG_SRC=  msg/msg_config.c \
   msg/msg_actions.c
 
 JMSG_C_SRC = \
-  xbt/xbt_context_java.c \
+  simix/xbt_context_java.c \
   java/jxbt_utilities.c     java/jxbt_utilities.h      \
   java/jmsg.c               java/jmsg.h                \
   java/jmsg_channel.c       java/jmsg_channel.h        \
index c791b31..1a7a1ca 100644 (file)
@@ -13,7 +13,7 @@
 const char *gras_os_myname(void)
 {
   smx_process_t process = SIMIX_process_self();
-  if ((process != NULL) && (process->simdata))
+  if (process != NULL)
     return SIMIX_host_get_name(SIMIX_host_self());
   else
     return "";
index 0f1889e..975c627 100644 (file)
@@ -172,7 +172,7 @@ const char *xbt_procname(void)
 {
   const char *res = NULL;
   smx_process_t process = SIMIX_process_self();
-  if ((process != NULL) && (process->simdata))
+  if (process != NULL)
     res = SIMIX_process_get_name(process);
   if (res)
     return res;
@@ -182,16 +182,17 @@ const char *xbt_procname(void)
 
 int gras_os_getpid(void)
 {
-
+  gras_procdata_t *data;
   smx_process_t process = SIMIX_process_self();
-
-  if ((process != NULL) && (process->data))
-    return ((gras_procdata_t *) process->data)->pid;
-  else
-    return 0;
+  
+  if (process != NULL){
+    data = (gras_procdata_t *)SIMIX_process_get_data(process);
+    return data->pid;
+  }
+  
+  return 0;
 }
 
-
 /** @brief retrieve the value of a given host property (or NULL if not defined) */
 const char *gras_os_host_property_value(const char *name)
 {
index abdea17..a20d799 100644 (file)
@@ -1,21 +1,32 @@
-#ifndef XBT_CONTEXT_H\r
-#define XBT_CONTEXT_H\r
-\r
-#include "xbt/misc.h"                          /* XBT_PUBLIC(), SG_BEGIN_DECL() and SG_END_DECL() definitions  */\r
-#include "xbt/function_types.h"                /* function pointer types declarations                                                  */      \r
-#include "xbt_modinter.h"                      /* xbt_context_init() and xbt_context_exit() declarations               */\r
-     \rSG_BEGIN_DECL() \r \rtypedef struct s_xbt_context *xbt_context_t;
-\r\r\rXBT_PUBLIC(xbt_context_t) \r
-xbt_context_new(const char *name, xbt_main_func_t code,
-                \rvoid_f_pvoid_t startup_func, void *startup_arg,
-                \rvoid_f_pvoid_t cleanup_func, void *cleanup_arg, int argc,
-                \rchar *argv[]);
-\r\r\rXBT_PUBLIC(void) \r xbt_context_kill(xbt_context_t context);
-\r\r\rXBT_PUBLIC(void) \r xbt_context_start(xbt_context_t context);
-\r\r\rXBT_PUBLIC(void) \r xbt_context_yield(void);
-\r\r\rXBT_PUBLIC(void) \r xbt_context_schedule(xbt_context_t context);
-     \r\r\rvoid \rxbt_context_empty_trash(void);
-     \r\r\rvoid \rxbt_context_stop(int exit_code);
-     \r\r\rvoid \rxbt_context_free(xbt_context_t context);
-\r\r\r\rSG_END_DECL() \r \r
-#endif  /* !XBT_CONTEXT_H */\r
+#ifndef XBT_CONTEXT_H
+#define XBT_CONTEXT_H
+
+#include "xbt/misc.h"                          /* XBT_PUBLIC(), SG_BEGIN_DECL() and SG_END_DECL() definitions  */
+#include "xbt/function_types.h"                /* function pointer types declarations                                                  */      
+#include "xbt_modinter.h"                      /* xbt_context_init() and xbt_context_exit() declarations               */
+     
+SG_BEGIN_DECL() 
+typedef struct s_xbt_context *xbt_context_t;
+
+XBT_PUBLIC(xbt_context_t) xbt_context_new(const char *name, xbt_main_func_t code,
+                void_f_pvoid_t startup_func, void *startup_arg,
+                void_f_pvoid_t cleanup_func, void *cleanup_arg, int argc, char *argv[]);
+
+XBT_PUBLIC(void) xbt_context_kill(xbt_context_t context);
+
+XBT_PUBLIC(void) xbt_context_start(xbt_context_t context);
+
+XBT_PUBLIC(void) xbt_context_yield(void);
+
+XBT_PUBLIC(void) xbt_context_schedule(xbt_context_t context);
+     
+void xbt_context_empty_trash(void);
+
+void xbt_context_stop(int exit_code);
+     
+void xbt_context_free(xbt_context_t context);
+
+SG_END_DECL() 
+#endif  /* !XBT_CONTEXT_H */
index 3bfc99e..f1eb193 100644 (file)
 SG_BEGIN_DECL()
 
 /* ******************************** Host ************************************ */
-/** @defgroup m_datatypes_management_details Details on SIMIX datatypes
-    @ingroup  m_datatypes_management*/
-     typedef struct s_smx_simdata_host *smx_simdata_host_t;
-/** @brief Host datatype 
-    @ingroup m_datatypes_management_details */
-     typedef struct s_smx_host {
-       char *name;              /**< @brief host name if any */
-       smx_simdata_host_t simdata;
-                                /**< @brief simulator data */
-       void *data;              /**< @brief user data */
-     } s_smx_host_t;
+/** @defgroup m_datatypes_management_details Details on SIMIX datatypes */
 /** @brief Host datatype  
     @ingroup m_datatypes_management
 
@@ -65,19 +55,6 @@ SG_BEGIN_DECL()
 
 
 /* ****************************** Process *********************************** */
-     typedef struct s_smx_simdata_process *smx_simdata_process_t;
-/** @brief Process datatype 
-    @ingroup m_datatypes_management_details @{ */
-     typedef struct s_smx_process {
-
-       char *name;              /**< @brief process name if any */
-       smx_simdata_process_t simdata;   /**< @brief simulator data */
-       s_xbt_swag_hookup_t process_hookup;
-       s_xbt_swag_hookup_t synchro_hookup;
-       s_xbt_swag_hookup_t host_proc_hookup;
-       void *data;              /**< @brief user data */
-     } s_smx_process_t;
-/** @} */
 /** @brief Agent datatype  
     @ingroup m_datatypes_management 
 
index eb8503f..a9c0780 100644 (file)
@@ -117,6 +117,7 @@ XBT_PUBLIC(smx_process_t) SIMIX_process_self(void);
 XBT_PUBLIC(void) SIMIX_process_suspend(smx_process_t process);
 XBT_PUBLIC(void) SIMIX_process_resume(smx_process_t process);
 XBT_PUBLIC(int) SIMIX_process_is_suspended(smx_process_t process);
+XBT_PUBLIC(int) SIMIX_process_is_blocked(smx_process_t process);
 
 /*property handlers*/
 XBT_PUBLIC(xbt_dict_t) SIMIX_process_get_properties(smx_process_t host);
index f5ada54..fa6accc 100644 (file)
 m_host_t MSG_get_host_by_name(const char *name)
 {
   smx_host_t simix_h = NULL;
-
   simix_h = SIMIX_host_get_by_name(name);
-  if (simix_h == NULL) {
+  
+  if (simix_h == NULL)
     return NULL;
-  } else
-    return (m_host_t) simix_h->data;
+
+  return (m_host_t)SIMIX_host_get_data(simix_h);
 }
 
 /** \ingroup msg_easier_life
index 0760077..eca2729 100644 (file)
@@ -18,7 +18,6 @@
 #include "xbt/dynar.h"
 #include "xbt/swag.h"
 #include "xbt/dict.h"
-#include "xbt/context.h"
 #include "xbt/config.h"
 
 SG_BEGIN_DECL()
index bc0eccf..bcf61c9 100644 (file)
@@ -15,7 +15,8 @@
 #include "xbt/fifo.h"
 #include "xbt/swag.h"
 #include "xbt/dict.h"
-#include "xbt/context.h"
+#include "simix/context.h"
+#include "xbt/config.h"
 #include "xbt/function_types.h"
 
 /******************************* Datatypes **********************************/
 
 /********************************** Host ************************************/
 
-typedef struct s_smx_simdata_host {
-  void *host;                   /* SURF modeling */
+/** @brief Host datatype 
+    @ingroup m_datatypes_management_details */
+typedef struct s_smx_host {
+  char *name;              /**< @brief host name if any */
+  void *host;              /* SURF modeling */
   xbt_swag_t process_list;
-} s_smx_simdata_host_t;
+  void *data;              /**< @brief user data */
+} s_smx_host_t;
 
 /********************************* Simix Global ******************************/
 
@@ -46,17 +51,28 @@ extern SIMIX_Global_t simix_global;
 
 /******************************* Process *************************************/
 
-typedef struct s_smx_simdata_process {
-  smx_host_t smx_host;          /* the host on which the process is running */
-  xbt_context_t context;        /* the context that executes the scheduler fonction */
-  int blocked;
-  int suspended;
-  smx_mutex_t mutex;            /* mutex on which the process is blocked  */
-  smx_cond_t cond;              /* cond on which the process is blocked  */
-  int argc;                     /* arguments number if any */
-  char **argv;                  /* arguments table if any */
-  xbt_dict_t properties;
-} s_smx_simdata_process_t;
+/** @brief Process datatype 
+    @ingroup m_datatypes_management_details @{ */
+     typedef struct s_smx_process {
+       s_xbt_swag_hookup_t process_hookup;
+       s_xbt_swag_hookup_t synchro_hookup;
+       s_xbt_swag_hookup_t host_proc_hookup;
+
+       char *name;              /**< @brief process name if any */
+       smx_host_t smx_host;     /* the host on which the process is running */
+       xbt_context_t context;   /* the context that executes the scheduler function */
+       int argc;                /* arguments number if any */
+       char **argv;             /* arguments table if any */
+       int blocked : 1;
+       int suspended : 1;
+       int iwannadie : 1;
+       smx_mutex_t mutex;       /* mutex on which the process is blocked  */
+       smx_cond_t cond;         /* cond on which the process is blocked  */
+       xbt_dict_t properties;
+       void *data;              /* kept for compatibility, it should be replaced with moddata */
+
+     } s_smx_process_t;
+/** @} */
 
 typedef struct s_smx_process_arg {
   const char *name;
@@ -105,7 +121,7 @@ typedef struct s_smx_simdata_action {
 
 
 #define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_model->extension.workstation. \
-                                 get_state(SIMIX_host_self()->simdata->host)==SURF_RESOURCE_ON,\
+                                 get_state(SIMIX_host_self()->host)==SURF_RESOURCE_ON,\
                                   "Host failed, you cannot call this function.")
 
 smx_host_t __SIMIX_host_create(const char *name, void *workstation,
index 166ee67..b5a4cd2 100644 (file)
@@ -33,12 +33,12 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender,
 
   /* check if the host is active */
   if (surf_workstation_model->extension.
-      workstation.get_state(sender->simdata->host) != SURF_RESOURCE_ON) {
+      workstation.get_state(sender->host) != SURF_RESOURCE_ON) {
     THROW1(network_error, 0, "Host %s failed, you cannot call this function",
            sender->name);
   }
   if (surf_workstation_model->extension.
-      workstation.get_state(receiver->simdata->host) != SURF_RESOURCE_ON) {
+      workstation.get_state(receiver->host) != SURF_RESOURCE_ON) {
     THROW1(network_error, 0, "Host %s failed, you cannot call this function",
            receiver->name);
   }
@@ -56,7 +56,7 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender,
 
   simdata->surf_action =
     surf_workstation_model->extension.workstation.
-    communicate(sender->simdata->host, receiver->simdata->host, size, rate);
+    communicate(sender->host, receiver->host, size, rate);
   surf_workstation_model->action_data_set(simdata->surf_action, act);
 
   DEBUG1("Create communicate action %p", act);
@@ -79,7 +79,7 @@ smx_action_t SIMIX_action_execute(smx_host_t host, const char *name,
 
   /* check if the host is active */
   if (surf_workstation_model->extension.
-      workstation.get_state(host->simdata->host) != SURF_RESOURCE_ON) {
+      workstation.get_state(host->>host) != SURF_RESOURCE_ON) {
     THROW1(host_error, 0, "Host %s failed, you cannot call this function",
            host->name);
   }
@@ -96,7 +96,7 @@ smx_action_t SIMIX_action_execute(smx_host_t host, const char *name,
 
   /* set communication */
   simdata->surf_action =
-    surf_workstation_model->extension.workstation.execute(host->simdata->host,
+    surf_workstation_model->extension.workstation.execute(host->host,
                                                           amount);
 
   surf_workstation_model->action_data_set(simdata->surf_action, act);
@@ -120,7 +120,7 @@ smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
 
   /* check if the host is active */
   if (surf_workstation_model->extension.
-      workstation.get_state(host->simdata->host) != SURF_RESOURCE_ON) {
+      workstation.get_state(host->host) != SURF_RESOURCE_ON) {
     THROW1(host_error, 0, "Host %s failed, you cannot call this function",
            host->name);
   }
@@ -136,7 +136,7 @@ smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
   act->name = xbt_strdup(name);
 
   simdata->surf_action =
-    surf_workstation_model->extension.workstation.sleep(host->simdata->host,
+    surf_workstation_model->extension.workstation.sleep(host->host,
                                                         duration);
 
   surf_workstation_model->action_data_set(simdata->surf_action, act);
@@ -319,7 +319,7 @@ smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
 
   workstation_list = xbt_new0(void *, host_nb);
   for (i = 0; i < host_nb; i++)
-    workstation_list[i] = host_list[i]->simdata->host;
+    workstation_list[i] = host_list[i]->host;
 
   simdata->surf_action =
     surf_workstation_model->extension.
index 267302b..3c45e55 100644 (file)
@@ -89,34 +89,31 @@ void SIMIX_display_process_status(void)
   INFO0
     ("Legend of the following listing: \"<process> on <host>: <status>.\"");
   xbt_swag_foreach(process, simix_global->process_list) {
-    smx_simdata_process_t p_simdata =
-      (smx_simdata_process_t) process->simdata;
-    // simdata_host_t h_simdata=(simdata_host_t)p_simdata->host->simdata;
     char *who, *who2;
 
     asprintf(&who, "%s on %s: %s",
              process->name,
-             p_simdata->smx_host->name,
-             (process->simdata->blocked) ? "[BLOCKED] "
-             : ((process->simdata->suspended) ? "[SUSPENDED] " : ""));
+             process->smx_host->name,
+             (process->blocked) ? "[BLOCKED] "
+             : ((process->suspended) ? "[SUSPENDED] " : ""));
 
-    if (p_simdata->mutex) {
+    if (process->mutex) {
       who2 =
         bprintf("%s Blocked on mutex %p", who,
                 (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
-                p_simdata->mutex : (void *) 0xdead);
+                process->mutex : (void *) 0xdead);
       free(who);
       who = who2;
-    } else if (p_simdata->cond) {
+    } else if (process->cond) {
       who2 =
         bprintf
         ("%s Blocked on condition %p; Waiting for the following actions:",
          who,
          (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
-         p_simdata->cond : (void *) 0xdead);
+         process->cond : (void *) 0xdead);
       free(who);
       who = who2;
-      xbt_fifo_foreach(p_simdata->cond->actions, item, act, smx_action_t) {
+      xbt_fifo_foreach(process->cond->actions, item, act, smx_action_t) {
         who2 =
           bprintf("%s '%s'(%p)", who, act->name,
                   (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose))
@@ -165,7 +162,7 @@ void __SIMIX_main(void)
       xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
         xbt_swag_foreach(process, cond->sleeping) {
           DEBUG2("\t preparing to wake up %s on %s",
-                 process->name, process->simdata->smx_host->name);
+                 process->name, process->smx_host->name);
         }
         SIMIX_cond_broadcast(cond);
         /* remove conditional from action */
@@ -180,7 +177,7 @@ void __SIMIX_main(void)
       xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
         xbt_swag_foreach(process, cond->sleeping) {
           DEBUG2("\t preparing to wake up %s on %s",
-                 process->name, process->simdata->smx_host->name);
+                 process->name, process->smx_host->name);
         }
         SIMIX_cond_broadcast(cond);
         /* remove conditional from action */
@@ -283,9 +280,9 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 
   while ((process = xbt_swag_extract(simix_global->process_to_run))) {
     DEBUG2("Scheduling %s on %s",
-           process->name, process->simdata->smx_host->name);
+           process->name, process->smx_host->name);
     simix_global->current_process = process;
-    xbt_context_schedule(process->simdata->context);
+    xbt_context_schedule(process->context);
     /*       fflush(NULL); */
     simix_global->current_process = NULL;
   }
@@ -331,7 +328,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
       if (fun == SIMIX_process_kill) {
         process = arg;
         DEBUG2("Killing %s on %s", process->name,
-               process->simdata->smx_host->name);
+               process->smx_host->name);
         SIMIX_process_kill(process);
       }
     }
index 6b851bc..35aceeb 100644 (file)
@@ -18,24 +18,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
 smx_host_t __SIMIX_host_create(const char *name,
                                void *workstation, void *data)
 {
-  smx_simdata_host_t simdata = xbt_new0(s_smx_simdata_host_t, 1);
-  smx_host_t host = xbt_new0(s_smx_host_t, 1);
+  smx_host_t smx_host = xbt_new0(s_smx_host_t, 1);
   s_smx_process_t proc;
 
   /* Host structure */
-  host->name = xbt_strdup(name);
-  host->simdata = simdata;
-  host->data = data;
-
-  simdata->host = workstation;
+  smx_host->name = xbt_strdup(name);
+  smx_host->data = data;
+  smx_host->host = workstation;
+  smx_host->process_list = xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
 
-  simdata->process_list =
-    xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
   /* Update global variables */
+  xbt_dict_set(simix_global->host, smx_host->name, smx_host, &__SIMIX_host_destroy);
 
-  xbt_dict_set(simix_global->host, host->name, host, &__SIMIX_host_destroy);
-
-  return host;
+  return smx_host;
 }
 
 /**
@@ -68,7 +63,7 @@ void *SIMIX_host_get_data(smx_host_t host)
   xbt_assert0((host != NULL), "Invalid parameters");
 
   /* Return data */
-  return (host->data);
+  return host->data;
 }
 
 /**
@@ -80,11 +75,10 @@ void *SIMIX_host_get_data(smx_host_t host)
 const char *SIMIX_host_get_name(smx_host_t host)
 {
 
-  xbt_assert0((host != NULL)
-              && (host->simdata != NULL), "Invalid parameters");
+  xbt_assert0((host != NULL), "Invalid parameters");
 
   /* Return data */
-  return (host->name);
+  return host->name;
 }
 
 /**
@@ -106,21 +100,16 @@ smx_host_t SIMIX_host_self(void)
 void __SIMIX_host_destroy(void *h)
 {
   smx_host_t host = (smx_host_t) h;
-  smx_simdata_host_t simdata = NULL;
 
   xbt_assert0((host != NULL), "Invalid parameters");
 
-
   /* Clean Simulator data */
-  simdata = host->simdata;
-
-  if (xbt_swag_size(simdata->process_list) != 0) {
-    char *msg =
-      bprintf("Shutting down host %s, but it's not empty:", host->name);
+  if (xbt_swag_size(host->process_list) != 0) {
+    char *msg = bprintf("Shutting down host %s, but it's not empty:", host->name);
     char *tmp;
     smx_process_t process = NULL;
 
-    xbt_swag_foreach(process, simdata->process_list) {
+    xbt_swag_foreach(process, host->process_list) {
       tmp = bprintf("%s\n\t%s", msg, process->name);
       free(msg);
       msg = tmp;
@@ -128,9 +117,7 @@ void __SIMIX_host_destroy(void *h)
     THROW1(arg_error, 0, "%s", msg);
   }
 
-  xbt_swag_free(simdata->process_list);
-
-  free(simdata);
+  xbt_swag_free(host->process_list);
 
   /* Clean host structure */
   free(host->name);
@@ -191,7 +178,7 @@ double SIMIX_host_get_speed(smx_host_t host)
   xbt_assert0((host != NULL), "Invalid parameters");
 
   return (surf_workstation_model->extension.workstation.
-          get_speed(host->simdata->host, 1.0));
+          get_speed(host->host, 1.0));
 }
 
 /**
@@ -205,7 +192,7 @@ double SIMIX_host_get_available_speed(smx_host_t host)
   xbt_assert0((host != NULL), "Invalid parameters");
 
   return (surf_workstation_model->extension.workstation.
-          get_available_speed(host->simdata->host));
+          get_available_speed(host->host));
 }
 
 /**
@@ -233,8 +220,7 @@ xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
-  return surf_workstation_model->extension.workstation.get_properties(host->simdata->host);
-
+  return surf_workstation_model->extension.workstation.get_properties(host->host);
 }
 
 
@@ -250,6 +236,5 @@ int SIMIX_host_get_state(smx_host_t host)
   xbt_assert0((host != NULL), "Invalid parameters");
 
   return (surf_workstation_model->extension.workstation.
-          get_state(host->simdata->host));
-
+          get_state(host->host));
 }
index 890f522..d7a9f44 100644 (file)
@@ -28,14 +28,10 @@ void SIMIX_process_cleanup(void *arg)
 {
   xbt_swag_remove(arg, simix_global->process_list);
   xbt_swag_remove(arg, simix_global->process_to_run);
-  xbt_swag_remove(arg,
-                  ((smx_process_t) arg)->simdata->smx_host->
-                  simdata->process_list);
+  xbt_swag_remove(arg,((smx_process_t) arg)->smx_host->process_list);
   free(((smx_process_t) arg)->name);
   ((smx_process_t) arg)->name = NULL;
 
-  free(((smx_process_t) arg)->simdata);
-  ((smx_process_t) arg)->simdata = NULL;
   free(arg);
 }
 
@@ -58,7 +54,6 @@ smx_process_t SIMIX_process_create(const char *name,
                                    const char *hostname, int argc,
                                    char **argv, xbt_dict_t properties)
 {
-  smx_simdata_process_t simdata = NULL;
   smx_process_t process = NULL;
   smx_process_t self = NULL;
   smx_host_t host = SIMIX_host_get_by_name(hostname);
@@ -69,38 +64,36 @@ smx_process_t SIMIX_process_create(const char *name,
     WARN2("Cannot launch process '%s' on failed host '%s'", name, hostname);
     return NULL;
   }
-  simdata = xbt_new0(s_smx_simdata_process_t, 1);
   process = xbt_new0(s_smx_process_t, 1);
   /*char alias[MAX_ALIAS_NAME + 1] = {0};
      msg_mailbox_t mailbox; */
 
   xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
-  /* Simulator Data */
-
-  simdata->smx_host = host;
-  simdata->mutex = NULL;
-  simdata->cond = NULL;
-  simdata->argc = argc;
-  simdata->argv = argv;
-  simdata->context = xbt_context_new(name, code, NULL, NULL,
-                                     simix_global->cleanup_process_function,
-                                     process, simdata->argc, simdata->argv);
 
-  /* Process structure */
+  /* Process data */
   process->name = xbt_strdup(name);
-  process->simdata = simdata;
+  process->smx_host = host;
+  process->argc = argc;
+  process->argv = argv;
+  process->mutex = NULL;
+  process->cond = NULL;
+  process->context = xbt_context_new(name, code, NULL, NULL,
+                                     simix_global->cleanup_process_function,
+                                     process, process->argc, process->argv);
   process->data = data;
 
   /* Add properties */
-  simdata->properties = properties;
+  process->properties = properties;
 
-  xbt_swag_insert(process, host->simdata->process_list);
+  /* Add the process to it's host process list */
+  xbt_swag_insert(process, host->process_list);
 
   /* fix current_process, about which xbt_context_start mocks around */
   self = simix_global->current_process;
-  xbt_context_start(process->simdata->context);
+  xbt_context_start(process->context);
   simix_global->current_process = self;
 
+  /* Now insert it in the global process list */
   xbt_swag_insert(process, simix_global->process_list);
   DEBUG2("Inserting %s(%s) in the to_run list", process->name, host->name);
   xbt_swag_insert(process, simix_global->process_to_run);
@@ -123,7 +116,6 @@ void SIMIX_jprocess_create(const char *name, smx_host_t host,
                            void *data,
                            void *jprocess, void *jenv, smx_process_t * res)
 {
-  smx_simdata_process_t simdata = xbt_new0(s_smx_simdata_process_t, 1);
   smx_process_t process = xbt_new0(s_smx_process_t, 1);
   smx_process_t self = NULL;
 
@@ -140,45 +132,35 @@ void SIMIX_jprocess_create(const char *name, smx_host_t host,
    */
   *res = process;
 
-
-
   DEBUG5("jprocess_create(name=%s,host=%p,data=%p,jproc=%p,jenv=%p)",
          name, host, data, jprocess, jenv);
   xbt_assert0(host, "Invalid parameters");
-  /* Simulator Data */
-  simdata->smx_host = host;
-  simdata->mutex = NULL;
-  simdata->cond = NULL;
-  simdata->argc = 0;
-  simdata->argv = NULL;
-
-
-  simdata->context = xbt_context_new(name, NULL, NULL, jprocess,
-                                     simix_global->cleanup_process_function,
-                                     process,
-                                     /* argc/argv */ 0, NULL);
 
-  /* Process structure */
+  /* Process data */
   process->name = xbt_strdup(name);
-  process->simdata = simdata;
+  process->smx_host = host;
+  process->argc = 0;
+  process->argv = NULL;
+  process->mutex = NULL;
+  process->cond = NULL;
+  process->context = xbt_context_new(name, NULL, NULL, jprocess,
+                                     simix_global->cleanup_process_function,
+                                     process, 0, NULL);
   process->data = data;
 
-  xbt_swag_insert(process, host->simdata->process_list);
+  /* Add the process to it's host process list */
+  xbt_swag_insert(process, host->process_list);
 
   /* fix current_process, about which xbt_context_start mocks around */
   self = simix_global->current_process;
-
-  xbt_context_start(process->simdata->context);
-
+  xbt_context_start(process->context);
   simix_global->current_process = self;
 
   xbt_swag_insert(process, simix_global->process_list);
   DEBUG2("Inserting %s(%s) in the to_run list", process->name, host->name);
   xbt_swag_insert(process, simix_global->process_to_run);
-
 }
 
-
 /** \brief Kill a SIMIX process
  *
  * This function simply kills a \a process... scarry isn't it ? :).
@@ -187,22 +169,20 @@ void SIMIX_jprocess_create(const char *name, smx_host_t host,
  */
 void SIMIX_process_kill(smx_process_t process)
 {
-  smx_simdata_process_t p_simdata = process->simdata;
-
   DEBUG2("Killing process %s on %s", process->name,
-         p_simdata->smx_host->name);
+         process->smx_host->name);
 
   /* Cleanup if we were waiting for something */
-  if (p_simdata->mutex)
-    xbt_swag_remove(process, p_simdata->mutex->sleeping);
+  if (process->mutex)
+    xbt_swag_remove(process, process->mutex->sleeping);
 
-  if (p_simdata->cond)
-    xbt_swag_remove(process, p_simdata->cond->sleeping);
+  if (process->cond)
+    xbt_swag_remove(process, process->cond->sleeping);
 
   xbt_swag_remove(process, simix_global->process_to_run);
   xbt_swag_remove(process, simix_global->process_list);
   DEBUG2("%p here! killing %p", simix_global->current_process, process);
-  xbt_context_kill(process->simdata->context);
+  xbt_context_kill(process->context);
 
   if (process == SIMIX_process_self()) {
     /* I just killed myself */
@@ -234,10 +214,8 @@ void *SIMIX_process_get_data(smx_process_t process)
 void SIMIX_process_set_data(smx_process_t process, void *data)
 {
   xbt_assert0((process != NULL), "Invalid parameters");
-  //xbt_assert0((process->data == NULL), "Data already set");
 
   process->data = data;
-
   return;
 }
 
@@ -250,10 +228,8 @@ void SIMIX_process_set_data(smx_process_t process, void *data)
  */
 smx_host_t SIMIX_process_get_host(smx_process_t process)
 {
-  xbt_assert0(((process != NULL)
-               && (process->simdata)), "Invalid parameters");
-
-  return (process->simdata->smx_host);
+  xbt_assert0((process != NULL), "Invalid parameters");
+  return (process->smx_host);
 }
 
 /**
@@ -265,9 +241,7 @@ smx_host_t SIMIX_process_get_host(smx_process_t process)
  */
 const char *SIMIX_process_get_name(smx_process_t process)
 {
-  xbt_assert0(((process != NULL)
-               && (process->simdata)), "Invalid parameters");
-
+  xbt_assert0((process != NULL), "Invalid parameters");
   return (process->name);
 }
 
@@ -280,9 +254,7 @@ const char *SIMIX_process_get_name(smx_process_t process)
  */
 void SIMIX_process_set_name(smx_process_t process, char *name)
 {
-  xbt_assert0(((process != NULL)
-               && (process->simdata)), "Invalid parameters");
-
+  xbt_assert0((process != NULL), "Invalid parameters");
   process->name = name;
 }
 
@@ -293,7 +265,7 @@ void SIMIX_process_set_name(smx_process_t process, char *name)
  */
 xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
 {
-  return process->simdata->properties;
+  return process->properties;
 }
 
 /**
@@ -317,17 +289,14 @@ smx_process_t SIMIX_process_self(void)
  */
 void SIMIX_process_suspend(smx_process_t process)
 {
-  smx_simdata_process_t simdata = NULL;
-
-  xbt_assert0(((process) && (process->simdata)), "Invalid parameters");
+  xbt_assert0(process, "Invalid parameters");
 
   if (process != SIMIX_process_self()) {
-    simdata = process->simdata;
 
-    if (simdata->mutex) {
+    if (process->mutex) {
       /* process blocked on a mutex, only set suspend=1 */
-      simdata->suspended = 1;
-    } else if (simdata->cond) {
+      process->suspended = 1;
+    } else if (process->cond) {
       /* process blocked cond, suspend all actions */
 
       /* temporaries variables */
@@ -335,20 +304,20 @@ void SIMIX_process_suspend(smx_process_t process)
       xbt_fifo_item_t i;
       smx_action_t act;
 
-      simdata->suspended = 1;
-      c = simdata->cond;
+      process->suspended = 1;
+      c = process->cond;
       xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
-        surf_workstation_model->suspend(act->simdata->surf_action);
+      surf_workstation_model->suspend(act->surf_action);
       }
     } else {
-      simdata->suspended = 1;
+      process->suspended = 1;
     }
   } else {
     /* process executing, I can create an action and suspend it */
     smx_action_t dummy;
     smx_cond_t cond;
     char name[] = "dummy";
-    process->simdata->suspended = 1;
+    process->suspended = 1;
 
     cond = SIMIX_cond_init();
     dummy = SIMIX_action_execute(SIMIX_process_get_host(process), name, 0);
@@ -370,39 +339,33 @@ void SIMIX_process_suspend(smx_process_t process)
  */
 void SIMIX_process_resume(smx_process_t process)
 {
-  smx_simdata_process_t simdata = NULL;
-
-  xbt_assert0(((process != NULL)
-               && (process->simdata)), "Invalid parameters");
+  xbt_assert0((process != NULL), "Invalid parameters");
   SIMIX_CHECK_HOST();
 
-  if (process == SIMIX_process_self()) {
+  if (process == SIMIX_process_self())
     return;
-  }
 
-  simdata = process->simdata;
-  if (simdata->mutex) {
+  if (process->mutex) {
     DEBUG0("Resume process blocked on a mutex");
-    simdata->suspended = 0;     /* It'll wake up by itself when mutex releases */
+    process->suspended = 0;     /* It'll wake up by itself when mutex releases */
     return;
-  } else if (simdata->cond) {
+  } else if (process->cond) {
     /* temporaries variables */
     smx_cond_t c;
     xbt_fifo_item_t i;
     smx_action_t act;
     DEBUG0("Resume process blocked on a conditional");
-    simdata->suspended = 0;
-    c = simdata->cond;
+    process->suspended = 0;
+    c = process->cond;
     xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
       surf_workstation_model->resume(act->simdata->surf_action);
     }
     SIMIX_cond_signal(c);
     return;
   } else {
-    simdata->suspended = 0;
+    process->suspended = 0;
     xbt_swag_insert(process, simix_global->process_to_run);
   }
-
 }
 
 /**
@@ -410,15 +373,14 @@ void SIMIX_process_resume(smx_process_t process)
  *
  * This function changes the value of the host on which \a process is running.
  */
-void SIMIX_process_change_host(smx_process_t process, char *source,
-                               char *dest)
+void SIMIX_process_change_host(smx_process_t process, char *source, char *dest)
 {
-  smx_simdata_process_t p_simdata = process->simdata;
+  xbt_assert0((process != NULL), "Invalid parameters");
   smx_host_t h1 = SIMIX_host_get_by_name(source);
   smx_host_t h2 = SIMIX_host_get_by_name(dest);
-  p_simdata->smx_host = h2;
-  xbt_swag_remove(process, h1->simdata->process_list);
-  xbt_swag_insert(process, h2->simdata->process_list);
+  process->smx_host = h2;
+  xbt_swag_remove(process, h1->process_list);
+  xbt_swag_insert(process, h2->process_list);
 }
 
 /**
@@ -430,10 +392,9 @@ void SIMIX_process_change_host(smx_process_t process, char *source,
  */
 int SIMIX_process_is_suspended(smx_process_t process)
 {
-  xbt_assert0(((process != NULL)
-               && (process->simdata)), "Invalid parameters");
+  xbt_assert0(((process != NULL), "Invalid parameters");
 
-  return (process->simdata->suspended);
+  return (process->suspended);
 }
 
 /**
index 92ac1a0..9a4cde6 100644 (file)
@@ -49,13 +49,13 @@ void SIMIX_mutex_lock(smx_mutex_t mutex)
   if (mutex->refcount) {
     /* somebody using the mutex, block */
     xbt_swag_insert(self, mutex->sleeping);
-    self->simdata->mutex = mutex;
+    self->mutex = mutex;
     /* wait for some process make the unlock and wake up me from mutex->sleeping */
     xbt_context_yield();
-    self->simdata->mutex = NULL;
+    self->mutex = NULL;
 
     /* verify if the process was suspended */
-    while (self->simdata->suspended) {
+    while (self->suspended) {
       xbt_context_yield();
     }
 
@@ -148,7 +148,7 @@ smx_cond_t SIMIX_cond_init()
 /**
  * \brief Signalizes a condition.
  *
- * Signalizes a condition and wakes up a sleping process. If there are no process sleeping, no action is done.
+ * Signalizes a condition and wakes up a sleeping process. If there are no process sleeping, no action is done.
  * \param cond A condition
  */
 void SIMIX_cond_signal(smx_cond_t cond)
@@ -211,11 +211,11 @@ void __SIMIX_cond_wait(smx_cond_t cond)
 
   /* process status */
 
-  self->simdata->cond = cond;
+  self->cond = cond;
   xbt_swag_insert(self, cond->sleeping);
   xbt_context_yield();
-  self->simdata->cond = NULL;
-  while (self->simdata->suspended) {
+  self->cond = NULL;
+  while (self->suspended) {
     xbt_context_yield();
   }
   return;
@@ -326,7 +326,7 @@ void SIMIX_cond_display_info(smx_cond_t cond)
     INFO0("Blocked process on this condition:");
     xbt_swag_foreach(process, cond->sleeping) {
       INFO2("\t %s running on host %s", process->name,
-            process->simdata->smx_host->name);
+            process->smx_host->name);
     }
   }
 }
index d969580..5159b76 100644 (file)
@@ -20,7 +20,6 @@ xbt_context_t current_context = NULL;
 /* the context associated with the maestro                                             */
 xbt_context_t maestro_context = NULL;
 
-
 /* this list contains the contexts to destroy                                  */
 xbt_swag_t context_to_destroy = NULL;
 
@@ -271,16 +270,29 @@ xbt_context_init_factory_by_name(xbt_context_factory_t * factory,
                                  const char *name)
 {
   if (!strcmp(name, "java"))
+#ifdef HAVE_JAVA     
     xbt_ctx_java_factory_init(factory);
-#ifdef CONTEXT_THREADS
+#else
+    THROW0(not_found_error, 0, "Factory 'Java' does not exist: Java support was not compiled in the SimGrid library");
+#endif /* HAVE_JAVA */
+   
   else if (!strcmp(name, "thread"))
+#ifdef CONTEXT_THREADS
     xbt_ctx_thread_factory_init(factory);
-#elif !defined(WIN32)
+#else
+    THROW0(not_found_error, 0, "Factory 'thread' does not exist: thread support was not compiled in the SimGrid library");
+#endif /* CONTEXT_THREADS */
+   
   else if (!strcmp(name, "sysv"))
+#ifndef WIN32
     xbt_ctx_sysv_factory_init(factory);
+#else
+    THROW0(not_found_error, 0, "Factory 'sysv' does not exist: no System V thread support under Windows");
 #endif
+   
   else
     THROW1(not_found_error, 0, "Factory '%s' does not exist", name);
+
 }
 
 /** Garbage collection
index 5976489..6797af1 100644 (file)
@@ -10,7 +10,7 @@
 #define _XBT_CONTEXT_PRIVATE_H
 
 #include "xbt/sysdep.h"
-#include "xbt/context.h"
+#include "simix/context.h"
 #include "xbt/swag.h"
 
 SG_BEGIN_DECL()
@@ -18,18 +18,20 @@ SG_BEGIN_DECL()
 /* *********************** */
 /* Context type definition */
 /* *********************** */
-/* the following function pointers describe the interface that all context concepts must implement */
-     typedef void (*xbt_pfn_context_free_t) (xbt_context_t);    /* pointer type to the function used to destroy the specified context   */
+/* the following function pointers types describe the interface that all context
+   concepts must implement */
 
-     typedef void (*xbt_pfn_context_kill_t) (xbt_context_t);    /* pointer type to the function used to kill the specified context              */
+typedef void (*xbt_pfn_context_free_t) (xbt_context_t);    /* function used to destroy the specified context */
 
-     typedef void (*xbt_pfn_context_schedule_t) (xbt_context_t);        /* pointer type to the function used to resume the specified context    */
+typedef void (*xbt_pfn_context_kill_t) (xbt_context_t);    /* function used to kill the specified context */
 
-     typedef void (*xbt_pfn_context_yield_t) (void);    /* pointer type to the function used to yield the specified context             */
+typedef void (*xbt_pfn_context_schedule_t) (xbt_context_t);    /* function used to resume the specified context */
 
-     typedef void (*xbt_pfn_context_start_t) (xbt_context_t);   /* pointer type to the function used to start the specified context             */
+typedef void (*xbt_pfn_context_yield_t) (void);    /* function used to yield the specified context */
 
-     typedef void (*xbt_pfn_context_stop_t) (int);      /* pointer type to the function used to stop the current context                */
+typedef void (*xbt_pfn_context_start_t) (xbt_context_t);   /* function used to start the specified context */
+
+typedef void (*xbt_pfn_context_stop_t) (int);    /* function used to stop the current context */
 
 /* each context type must contain this macro at its begining -- OOP in C :/ */
 #define XBT_CTX_BASE_T \
@@ -52,94 +54,65 @@ SG_BEGIN_DECL()
   xbt_pfn_context_stop_t stop
 
 /* all other context types derive from this structure */
-     typedef struct s_xbt_context {
-       XBT_CTX_BASE_T;
-     } s_xbt_context_t;
+typedef struct s_xbt_context {
+  XBT_CTX_BASE_T;
+} s_xbt_context_t;
 
 /* ****************** */
 /* Globals definition */
 /* ****************** */
 
 /* Important guys */
-     extern xbt_context_t current_context;
-
-     extern xbt_context_t maestro_context;
+extern xbt_context_t current_context;
+extern xbt_context_t maestro_context;
 
 /* All dudes lists */
-     extern xbt_swag_t context_living;
-
-     extern xbt_swag_t context_to_destroy;
+extern xbt_swag_t context_living;
+extern xbt_swag_t context_to_destroy;
 
 /* *********************** */
 /* factory type definition */
 /* *********************** */
-     typedef struct s_xbt_context_factory *xbt_context_factory_t;
-
-/* this function describes the interface that all context factory must implement */
-     typedef xbt_context_t(*xbt_pfn_context_factory_create_context_t) (const
-                                                                       char *,
-                                                                       xbt_main_func_t,
-                                                                       void_f_pvoid_t,
-                                                                       void *,
-                                                                       void_f_pvoid_t,
-                                                                       void *,
-                                                                       int,
-                                                                       char
-                                                                       **);
-     typedef
-     int (*xbt_pfn_context_factory_create_maestro_context_t) (xbt_context_t
-                                                              *);
-
-/* this function finalize the specified context factory */
-     typedef int (*xbt_pfn_context_factory_finalize_t) (xbt_context_factory_t
-                                                        *);
-
-/* this interface is used by the xbt context module to create the appropriate concept */
-     typedef struct s_xbt_context_factory {
-       xbt_pfn_context_factory_create_maestro_context_t create_maestro_context; /* create the context of the maestro    */
-       xbt_pfn_context_factory_create_context_t create_context; /* create a new context                 */
-       xbt_pfn_context_factory_finalize_t finalize;     /* finalize the context factory         */
-       const char *name;        /* the name of the context factory      */
-
-     } s_xbt_context_factory_t;
-
-/**
- * This function select a context factory associated with the name specified by
- * the parameter name.
- * If successful the function returns 0. Otherwise the function returns the error
- * code.
- */
-     int
-       xbt_context_select_factory(const char *name);
-
-/**
- * This function initialize a context factory from the name specified by the parameter
- * name.
- * If the factory cannot be found, an exception is raised.
- */
-     void
-
 
+typedef struct s_xbt_context_factory *xbt_context_factory_t;
 
+/* The following function pointer types describe the interface that any context 
+   factory should implement */
 
+/* function used to create a new context */
+typedef xbt_context_t (*xbt_pfn_context_factory_create_context_t)
+  (const char *, xbt_main_func_t, void_f_pvoid_t, void *, void_f_pvoid_t, void *, int, char **);
 
+/* function used to create the context for the maestro process */
+typedef int (*xbt_pfn_context_factory_create_maestro_context_t) (xbt_context_t*);
 
+/* this function finalize the specified context factory */
+typedef int (*xbt_pfn_context_factory_finalize_t) (xbt_context_factory_t*);
+
+/* interface of the context factories */
+typedef struct s_xbt_context_factory {
+  xbt_pfn_context_factory_create_maestro_context_t create_maestro_context;
+  xbt_pfn_context_factory_create_context_t create_context;
+  xbt_pfn_context_factory_finalize_t finalize;
+  const char *name;
+} s_xbt_context_factory_t;
+
+/* Selects a context factory associated with the name specified by the parameter name.
+ * If successful the function returns 0. Otherwise the function returns the error code.
+ */
+int xbt_context_select_factory(const char *name);
 
-      
-       xbt_context_init_factory_by_name(xbt_context_factory_t * factory,
-                                        const char *name);
-
+/* Initializes a context factory from the name specified by the parameter name.
+ * If the factory cannot be found, an exception is raised.
+ */
+void xbt_context_init_factory_by_name(xbt_context_factory_t * factory, const char *name);
 
 /* All factories init */
-     void xbt_ctx_thread_factory_init(xbt_context_factory_t * factory);
-
-     void xbt_ctx_sysv_factory_init(xbt_context_factory_t * factory);
-
-     void xbt_ctx_java_factory_init(xbt_context_factory_t * factory);
-
-
+void xbt_ctx_thread_factory_init(xbt_context_factory_t * factory);
 
+void xbt_ctx_sysv_factory_init(xbt_context_factory_t * factory);
 
+void xbt_ctx_java_factory_init(xbt_context_factory_t * factory);
 
 SG_END_DECL()
-#endif /* !_XBT_CONTEXT_PRIVATE_H */
+#endif /* !_XBT_CONTEXT_PRIVATE_H */
\ No newline at end of file
index 821b501..0eb57b8 100644 (file)
@@ -8,7 +8,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/ex_interface.h"
-#include "xbt/xbt_context_private.h"
+#include "xbt_context_private.h"
 
 #include "context_sysv_config.h"        /* loads context system definitions                             */
 #include "portable.h"
index 7feeeec..ba565a6 100644 (file)
@@ -136,9 +136,9 @@ void xbt_os_cond_destroy(xbt_os_cond_t cond)
 #endif
 
 
-#ifndef HAVE_JAVA
+/*#ifndef HAVE_JAVA
 #include "xbt/xbt_context_private.h"
 void xbt_ctx_java_factory_init(xbt_context_factory_t * factory)
 {
 }
-#endif
+#endif*/
index d982628..618c7bc 100644 (file)
@@ -71,14 +71,14 @@ noinst_PROGRAMS += gras/datadesc/datadesc_usage
 gras_datadesc_datadesc_usage_SOURCES=   gras/datadesc/datadesc_usage.c gras/datadesc/datadesc_structs.c
 gras_datadesc_datadesc_usage_LDADD=     $(LDADD_RL)
 
-gras/datadesc/datadesc_structs.c: gras/datadesc/mk_datadesc_structs.pl
+gras/datadesc/datadesc_structs.c: gras/datadesc/mk_datadesc_structs.pl; \
        perl $(top_srcdir)/teshsuite/gras/datadesc/mk_datadesc_structs.pl > $@
 
   ## Ensures the gras_msg_handle semantic ##
   ##########################################
 EXTRA_DIST += gras/msg_handle/msg_handle.xml \
               gras/msg_handle/test_rl \
-             gras/msg_handle/test_sg_32 gras/msg_handle/test_sg_64
+              gras/msg_handle/test_sg_32 gras/msg_handle/test_sg_64
 noinst_PROGRAMS+=\
   gras/msg_handle/msg_handle_client \
   gras/msg_handle/msg_handle_server \
@@ -92,7 +92,7 @@ gras_msg_handle_msg_handle_simulator_LDADD=   $(LDADD_SG)
 gras_msg_handle_msg_handle_client_LDADD=      $(LDADD_RL)
 gras_msg_handle_msg_handle_server_LDADD=      $(LDADD_RL)
 
-gras/msg_handle/_msg_handle_simulator.c gras/msg_handle/_msg_handle_client.c gras/msg_handle/_msg_handle_server.c : gras/msg_handle/msg_handle.c gras/msg_handle/msg_handle.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
+gras/msg_handle/_msg_handle_simulator.c gras/msg_handle/_msg_handle_client.c gras/msg_handle/_msg_handle_server.c : gras/msg_handle/msg_handle.c gras/msg_handle/msg_handle.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@; \
        mkdir -p gras/msg_handle; \
          cd gras/msg_handle;\
          $(abs_top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ msg_handle $(abs_top_srcdir)/teshsuite/gras/msg_handle/msg_handle.xml
@@ -118,7 +118,7 @@ gras_empty_main_empty_main_function_SOURCES=  gras/empty_main/empty_main.c gras/
 gras_empty_main_empty_main_simulator_LDADD=   $(LDADD_SG)
 gras_empty_main_empty_main_function_LDADD=    $(LDADD_RL)
 
-gras/empty_main/_empty_main_simulator.c gras/empty_main/_empty_main_function.c : gras/empty_main/empty_main.c gras/empty_main/empty_main.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
+gras/empty_main/_empty_main_simulator.c gras/empty_main/_empty_main_function.c : gras/empty_main/empty_main.c gras/empty_main/empty_main.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ ; \
        mkdir -p gras/empty_main; \
          cd gras/empty_main;\
          $(abs_top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ empty_main $(abs_top_srcdir)/teshsuite/gras/empty_main/empty_main.xml
@@ -139,7 +139,7 @@ gras_small_sleep_small_sleep_function_SOURCES=  gras/small_sleep/small_sleep.c g
 gras_small_sleep_small_sleep_simulator_LDADD=   $(LDADD_SG)
 gras_small_sleep_small_sleep_function_LDADD=    $(LDADD_RL)
 
-gras/small_sleep/_small_sleep_simulator.c gras/small_sleep/_small_sleep_function.c : gras/small_sleep/small_sleep.c gras/small_sleep/small_sleep.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
+gras/small_sleep/_small_sleep_simulator.c gras/small_sleep/_small_sleep_function.c : gras/small_sleep/small_sleep.c gras/small_sleep/small_sleep.xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@; \
        mkdir -p gras/small_sleep; \
          cd gras/small_sleep;\
          $(abs_top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ small_sleep $(abs_top_srcdir)/teshsuite/gras/small_sleep/small_sleep.xml