Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
debug debug debug
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 21 Dec 2004 21:43:22 +0000 (21:43 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 21 Dec 2004 21:43:22 +0000 (21:43 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@691 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/surf/surf.h
src/msg/deployment.c
src/msg/environment.c
src/msg/global.c
src/surf/workstation.c

index 8459660..4a7ebcf 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "xbt/swag.h"
 #include "xbt/dynar.h"
+#include "xbt/dict.h"
 
 /* Actions and resources are higly connected structures... */
 typedef struct surf_action *surf_action_t;
@@ -147,6 +148,7 @@ typedef struct surf_workstation_resource {
 
 extern surf_workstation_resource_t surf_workstation_resource;
 void surf_workstation_resource_init(const char *filename);
+extern xbt_dict_t workstation_set;
 
 /*******************************************/
 /*** SURF Globals **************************/
index 2e792b9..3cf1577 100644 (file)
@@ -65,7 +65,7 @@ void MSG_launch_application(const char *file)
       xbt_assert1(code, "Unknown function %s",argv[0]);
 
       host = MSG_get_host_by_name(host_name);
-      xbt_assert1(host_name, "Unknown host %s",host_name);
+      xbt_assert1(host, "Unknown host %s",host_name);
 
      process = MSG_process_create(argv[0], code, NULL, host);
      MSG_set_arguments(process, argc, argv);
@@ -77,7 +77,7 @@ void MSG_launch_application(const char *file)
     }
   }
 
-  close_section("CPU");
+  close_section("DEPLOYMENT");
 }
 
 /** \ingroup msg_easier_life
index e0644ec..981db97 100644 (file)
@@ -60,8 +60,16 @@ src_name dst_name (link_name link_name link_name ... )
  * it looks like.
  */
 void MSG_create_environment(const char *file) {
+  xbt_dict_cursor_t cursor = NULL;
+  char *name = NULL;
+  void *workstation = NULL;
+
   surf_workstation_resource_init(file);
 
+  xbt_dict_foreach(workstation_set, cursor, name, workstation) {
+    __MSG_host_create(name, workstation, NULL);
+  }
+
   return;
 }
 
index 41ff1b2..fee4cb9 100644 (file)
@@ -24,9 +24,12 @@ MSG_Global_t msg_global = NULL;
 void MSG_global_init(void)
 {
   if (!msg_global) {
+    int argc=0;
+    char **argv=NULL;
+
     msg_global = xbt_new0(s_MSG_Global_t,1);
 
-    surf_init(NULL, NULL);     /* Initialize some common structures */
+    surf_init(&argc, argv);    /* Initialize some common structures */
     msg_global->host = xbt_fifo_new();
     msg_global->process_to_run = xbt_fifo_new();
     msg_global->process_list = xbt_fifo_new();
@@ -41,7 +44,7 @@ void MSG_global_init(void)
  */
 void MSG_set_verbosity(MSG_outputmode_t mode)
 {
-  CRITICAL0("Not implemented yet.");
+  CRITICAL0("MSG_set_verbosity : Not implemented yet.");
 }
 
 /** \ingroup m_channel_management
@@ -80,7 +83,7 @@ MSG_error_t MSG_set_channel_number(int number)
  */
 MSG_error_t MSG_set_sharing_policy(MSG_sharing_t mode, long double param)
 {
-  xbt_assert0(0,"This function is now deprecated and useless. Store and forward does not exist anymore. Please stop using it.");
+  CRITICAL0("MSG_set_sharing_policy: this function is now deprecated and useless. Store and forward does not exist anymore. Please stop using it.");
   
   return MSG_OK;
 }
index f201e08..50a294f 100644 (file)
@@ -15,7 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(workstation, surf,
 
 surf_workstation_resource_t surf_workstation_resource = NULL;
 
-static xbt_dict_t workstation_set = NULL;
+xbt_dict_t workstation_set = NULL;
 
 static workstation_t workstation_new(const char *name,
                                     void *cpu, void *card)