Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finish the merging of Cristian branch by fixing some of the remaining glitches preven...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 18:04:22 +0000 (18:04 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 18:04:22 +0000 (18:04 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6498 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/msg/actions/actions.c
src/gras/Virtu/sg_dns.c
src/simix/private.h
src/simix/smx_action.c
src/simix/smx_global.c
src/simix/smx_process.c

index f7c0178..8ca04c2 100644 (file)
@@ -24,20 +24,6 @@ static double parse_double(const char *string) {
   return value;
 }
 
-
-/* Helper function */
-static double parse_double(const char *string)
-{
-  double value;
-  char *endptr;
-
-  value = strtod(string, &endptr);
-  if (*endptr != '\0')
-    THROW1(unknown_error, 0, "%s is not a double", string);
-  return value;
-}
-
-
 /* My actions */
 static void send(xbt_dynar_t action)
 {
index 1a7a1ca..09bba46 100644 (file)
@@ -12,8 +12,8 @@
 
 const char *gras_os_myname(void)
 {
-  smx_process_t process = SIMIX_process_self();
-  if (process != NULL)
+  smx_host_t host = SIMIX_host_self();
+  if (host != NULL)
     return SIMIX_host_get_name(SIMIX_host_self());
   else
     return "";
index 9151438..424d772 100644 (file)
@@ -15,7 +15,6 @@
 #include "xbt/fifo.h"
 #include "xbt/swag.h"
 #include "xbt/dict.h"
-#include "xbt/config.h"
 #include "xbt/function_types.h"
 
 /******************************** Datatypes ***********************************/
@@ -23,7 +22,7 @@
 
 /*********************************** Host *************************************/
 
-/** @brief Host datatype 
+/** @brief Host datatype
     @ingroup m_datatypes_management_details */
 typedef struct s_smx_host {
   char *name;              /**< @brief host name if any */
@@ -56,7 +55,7 @@ extern SIMIX_Global_t simix_global;
 
 typedef struct s_smx_context *smx_context_t;
 
-/** @brief Process datatype 
+/** @brief Process datatype
     @ingroup m_datatypes_management_details @{ */
      typedef struct s_smx_process {
        s_xbt_swag_hookup_t process_hookup;
@@ -116,7 +115,7 @@ typedef struct s_smx_cond {
 
 /********************************* Action *************************************/
 
-/** @brief Action datatype 
+/** @brief Action datatype
     @ingroup m_datatypes_management_details */
 typedef struct s_smx_action {
   char *name;              /**< @brief action name if any */
@@ -129,16 +128,12 @@ typedef struct s_smx_action {
 
 /************************** Configuration support *****************************/
 
-void simix_config_init(void);   /* create the config set, call this before use! */
-void simix_config_finalize(void);       /* destroy the config set, call this at cleanup. */
-extern int _simix_init_status;  /* 0: beginning of time; 
-                                   1: pre-inited (cfg_set created); 
+extern int _simix_init_status;  /* 0: beginning of time; FIXME: KILLME ?
+                                   1: pre-inited (cfg_set created);
                                    2: inited (running) */
-extern xbt_cfg_t _simix_cfg_set;
 
-
-#define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_model->extension_public-> \
-                                 get_state(SIMIX_host_self()->host)==SURF_CPU_ON,\
+#define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_model->extension.workstation. \
+                                 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, void *data);
@@ -161,11 +156,11 @@ void SIMIX_context_start(smx_process_t process);
 void SIMIX_context_yield(void);
 
 void SIMIX_context_schedule(smx_process_t process);
-     
+
 void SIMIX_context_empty_trash(void);
 
 void SIMIX_context_stop(int exit_code);
-     
+
 void SIMIX_context_free(smx_process_t process);
 
 void SIMIX_context_mod_init(void);
index 39e981c..90ed720 100644 (file)
@@ -75,7 +75,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->>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);
   }
@@ -311,7 +311,7 @@ smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
                                       computation_amount,
                                       communication_amount, amount, rate);
 
-  surf_workstation_model->action_data_set(simdata->surf_action, act);
+  surf_workstation_model->action_data_set(act->surf_action, act);
 
   return act;
 }
@@ -357,4 +357,4 @@ void SIMIX_action_signal_all(smx_action_t action)
     SIMIX_cond_broadcast(cond);
 
   return;
-}
\ No newline at end of file
+}
index 7c7d9c1..84d623f 100644 (file)
@@ -45,7 +45,7 @@ static void _XBT_CALL inthandler(int ignored)
 void SIMIX_global_init(int *argc, char **argv)
 {
   s_smx_process_t proc;
-  
+
   if (!simix_global) {
     /* Connect our log channels: that must be done manually under windows */
     XBT_LOG_CONNECT(simix_action, simix);
@@ -76,7 +76,7 @@ void SIMIX_global_init(int *argc, char **argv)
 
     SIMIX_context_mod_init();
     __SIMIX_create_maestro_process();
-    
+
     /* Prepare to display some more info when dying on Ctrl-C pressing */
     signal(SIGINT, inthandler);
     surf_init(argc, argv);      /* Initialize SURF structures */
@@ -227,9 +227,7 @@ void SIMIX_clean(void)
 {
   /* Kill everyone (except maestro) */
   SIMIX_process_killall();
-  
-  simix_config_finalize();
-  
+
   /* Free the remaining data structures*/
   xbt_swag_free(simix_global->process_to_run);
   xbt_swag_free(simix_global->process_to_destroy);
@@ -237,18 +235,18 @@ void SIMIX_clean(void)
   simix_global->process_list = NULL;
   xbt_dict_free(&(simix_global->registered_functions));
   xbt_dict_free(&(simix_global->host));
-  
+
   /* Let's free maestro now */
   SIMIX_context_free(simix_global->maestro_process);
-  free(simix_global->maestro_process);  
+  free(simix_global->maestro_process);
 
   /* Finish context module and SURF */
   SIMIX_context_mod_exit();
   surf_exit();
-  
+
   free(simix_global);
   simix_global = NULL;
-  
+
   return;
 }
 
index b2384bb..a35a229 100644 (file)
@@ -51,11 +51,11 @@ void __SIMIX_create_maestro_process()
   /* Set it as the maestro process */
   simix_global->maestro_process = process;
   simix_global->current_process = process;
-  
+
   return;
 }
 
-/** 
+/**
  * \brief Creates and runs a new #smx_process_t.
  *
  * A constructor for #m_process_t taking four arguments and returning the corresponding object. The structure (and the corresponding thread) is created, and put in the list of ready process.
@@ -404,7 +404,7 @@ void SIMIX_process_change_host(smx_process_t process, char *source, char *dest)
  */
 int SIMIX_process_is_suspended(smx_process_t process)
 {
-  xbt_assert0(((process != NULL), "Invalid parameters");
+  xbt_assert0((process != NULL), "Invalid parameters");
 
   return (process->suspended);
 }