Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge stuff again. Damn, I should pull before changing stuff
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 08:27:04 +0000 (10:27 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 08:27:04 +0000 (10:27 +0200)
13 files changed:
.gitignore
ChangeLog
buildtools/Cmake/MakeExe.cmake
examples/platforms/One_cluster_no_backbone.xml
examples/simdag/dot/dot_test.c
examples/simdag/goal/CMakeLists.txt [new file with mode: 0644]
examples/simdag/goal/goal_test.c [new file with mode: 0644]
src/simdag/private.h
src/simdag/sd_global.c
src/simdag/sd_task.c
src/surf/network.c
src/surf/network_im.c
src/surf/surf.c

index 954df21..f25af12 100644 (file)
@@ -96,6 +96,13 @@ doc/index-API.doc
 doc/index.php\r
 doc/simgrid.tag\r
 doc/simgrid_modules.map\r
+doc/publis_core.bib\r
+doc/publis_core_bib.html\r
+doc/publis_count.html\r
+doc/publis_extern.bib\r
+doc/publis_extern_bib.html\r
+doc/publis_intra.bib\r
+doc/publis_intra_bib.html\r
 \r
 ################################################\r
 ### Specific of project \r
@@ -209,6 +216,7 @@ examples/simdag/properties/sd_prop
 examples/simdag/sd_test\r
 examples/simdag/sd_test2\r
 examples/simdag/dax/dax_test\r
+examples/simdag/goal/goal_test\r
 examples/simdag/scheduling/minmin_test\r
 examples/smpi/reduce\r
 examples/smpi/bcast\r
@@ -292,3 +300,28 @@ test_sg
 examples/smpi/smpi_traced.trace\r
 examples/simdag/dot/simulate_dot\r
 teshsuite/simdag/platforms/graphicator\r
+\r
+#########################################""\r
+## tutorial files\r
+doc/gtut-files/01-bones_client\r
+doc/gtut-files/01-bones_server\r
+doc/gtut-files/02-simple_client\r
+doc/gtut-files/02-simple_server\r
+doc/gtut-files/03-args_client\r
+doc/gtut-files/03-args_server\r
+doc/gtut-files/04-callback_client\r
+doc/gtut-files/04-callback_server\r
+doc/gtut-files/05-globals_client\r
+doc/gtut-files/05-globals_server\r
+doc/gtut-files/06-logs_client\r
+doc/gtut-files/06-logs_server\r
+doc/gtut-files/07-timers_client\r
+doc/gtut-files/07-timers_server\r
+doc/gtut-files/08-exceptions_client\r
+doc/gtut-files/08-exceptions_server\r
+doc/gtut-files/09-simpledata_client\r
+doc/gtut-files/09-simpledata_server\r
+doc/gtut-files/10-rpc_client\r
+doc/gtut-files/10-rpc_server\r
+doc/gtut-files/11-explicitwait_client\r
+doc/gtut-files/11-explicitwait_server\r
index 8893458..b3d154b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
-SimGrid (3.7.0) unstable; urgency=low 
+SimGrid (3.7) NOT RELEASED; urgency=low 
 
-(still to be done)
+  Models:
+  * Use the partial invalidation optimization by default for the
+    network too. Should produce the exact same results, only faster.
+
+  SimDag:
+  * Performance boost by using a swag internally to compute the set of
+    tasks that are finished and should constitute the return value of
+    SD_simulate.
+
+  -- $date Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.6.2) stable; urgency=low 
 
@@ -119,6 +128,8 @@ SimGrid (3.6) stable; urgency=medium
    combine Vivaldi based latencies with last-mile platforms.
 
  SIMIX
+ * Added a check for NaN of IEEE754 infinite in the double entries of 
+   the smx_user.c file
  * Introduce a new context factory "raw", highly inspirated from the
    ucontext factory, but using manually crafted functions in assembly to
    do the work in an efficient manner.
index ed00683..da26f94 100644 (file)
@@ -78,6 +78,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/amok/saturate)
 \r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)\r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)\r
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)\r
 if(HAVE_GRAPHVIZ)\r
   add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dot)\r
 endif(HAVE_GRAPHVIZ)\r
index 3e470a9..2054334 100644 (file)
@@ -15,7 +15,7 @@
 
 <platform version="3">
 <AS  id="AS0"  routing="Full">
-  <cluster id="my_cluster_1" prefix="c-" suffix=".me"
-               radical="0-2"   power="1000000000"    bw="125000000"     lat="5E-5"/>
+  <cluster id="my_cluster_1" prefix="" suffix=""
+               radical="0-262144"      power="1000000000"    bw="125000000"     lat="5E-5"/>
 </AS>
 </platform>
index ac12b00..c441405 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
   unsigned int cursor;
   SD_task_t task;
 
-  /* initialisation of SD */
+  /* initialization of SD */
   SD_init(&argc, argv);
 
   /* Check our arguments */
diff --git a/examples/simdag/goal/CMakeLists.txt b/examples/simdag/goal/CMakeLists.txt
new file mode 100644 (file)
index 0000000..941fc7d
--- /dev/null
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(goal_test goal_test.c)
+
+### Add definitions for compile
+if(NOT WIN32)
+target_link_libraries(goal_test simgrid pthread m )
+else(NOT WIN32)
+target_link_libraries(goal_test simgrid)
+endif(NOT WIN32)
diff --git a/examples/simdag/goal/goal_test.c b/examples/simdag/goal/goal_test.c
new file mode 100644 (file)
index 0000000..e35e30e
--- /dev/null
@@ -0,0 +1,95 @@
+/* GOAL loader prototype. Not ready for public usage yet */
+
+/* Copyright (c) 2011. 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. */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "simdag/simdag.h"
+#include "xbt/log.h"
+#include "xbt/ex.h"
+#include <string.h>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(goal, "The GOAL loader into SimDag");
+
+typedef struct {
+  int i, j, k;
+} s_bcast_task_t,*bcast_task_t;
+
+
+const SD_workstation_t* ws_list;
+int count = 0;
+
+xbt_dynar_t reclaimed;
+
+static void send_one(int from, int to) {
+  //XBT_DEBUG("send_one(%d, %d)",from,to);
+
+  if (count %100000 == 0)
+    XBT_INFO("Sending task #%d",count);
+  count++;
+
+  bcast_task_t bt;
+  if (xbt_dynar_length(reclaimed)>0) {
+     bt = xbt_dynar_pop_as(reclaimed,bcast_task_t);
+  } else {
+    bt = xbt_new(s_bcast_task_t,1);
+  }
+  bt->i=from;
+  bt->j=(from+to)/2;
+  bt->k=to;
+
+  SD_task_t task = SD_task_create_comm_e2e("Blab",bt,424242);
+
+  XBT_DEBUG("Schedule task between %d and %d",bt->i,bt->j);
+  SD_task_schedulel(task,2,ws_list[bt->i],ws_list[bt->j]);
+  SD_task_watch(task,SD_DONE);
+}
+
+
+int main(int argc, char **argv) {
+
+  /* initialization of SD */
+  SD_init(&argc, argv);
+
+  if (argc > 1) {
+    SD_create_environment(argv[1]);
+  } else {
+    SD_create_environment("../../platforms/One_cluster_no_backbone.xml");
+  }
+
+  ws_list = SD_workstation_get_list();
+  reclaimed = xbt_dynar_new(sizeof(bcast_task_t),NULL);
+  xbt_dynar_t done = NULL;
+  send_one(0,262144);
+  do {
+    if (done != NULL && xbt_dynar_length(done) > 0) {
+      unsigned int cursor;
+      SD_task_t task;
+
+      xbt_dynar_foreach(done, cursor, task) {
+        bcast_task_t bt = SD_task_get_data(task);
+
+        if (bt->i != bt->j -1)
+          send_one(bt->i,bt->j);
+        if (bt->j != bt->k -1)
+          send_one(bt->j,bt->k);
+
+        if (xbt_dynar_length(reclaimed)<100) {
+          xbt_dynar_push_as(reclaimed,bcast_task_t,bt);
+        } else {
+          free(bt);
+        }
+        SD_task_destroy(task);
+      }
+      xbt_dynar_free(&done);
+    }
+    done=SD_simulate(-1);
+  } while(xbt_dynar_length(done) > 0);
+
+  SD_exit();
+  return 0;
+}
index fc7026a..6939eca 100644 (file)
@@ -13,6 +13,7 @@
 #include "simdag/simdag.h"
 #include "simdag/datatypes.h"
 #include "surf/surf.h"
+#include "xbt/swag.h"
 #include <stdbool.h>
 
 #define SD_INITIALISED() (sd_global != NULL)
@@ -40,6 +41,7 @@ typedef struct SD_global {
   xbt_swag_t done_task_set;
   xbt_swag_t failed_task_set;
 
+  xbt_swag_t return_set;
   int task_number;
 
 } s_SD_global_t, *SD_global_t;
@@ -66,6 +68,7 @@ typedef struct SD_workstation {
 /* Task */
 typedef struct SD_task {
   s_xbt_swag_hookup_t state_hookup;
+  s_xbt_swag_hookup_t return_hookup;
   xbt_swag_t state_set;
   e_SD_task_state_t state;
   void *data;                   /* user data */
@@ -110,6 +113,8 @@ typedef struct SD_dependency {
 } s_SD_dependency_t, *SD_dependency_t;
 
 /* SimDag private functions */
+XBT_PUBLIC(xbt_swag_t) SD_simulate_swag(double how_long); /* could be public, but you need to see the internals of the SD_task_t to use it */
+
 
 SD_link_t __SD_link_create(void *surf_link, void *data);
 void __SD_link_destroy(void *link);
index 762d002..12682cc 100644 (file)
@@ -82,6 +82,8 @@ void SD_init(int *argc, char **argv)
       xbt_swag_new(xbt_swag_offset(task, state_hookup));
   sd_global->failed_task_set =
       xbt_swag_new(xbt_swag_offset(task, state_hookup));
+  sd_global->return_set =
+      xbt_swag_new(xbt_swag_offset(task, return_hookup));
   sd_global->task_number = 0;
 
   surf_init(argc, argv);
@@ -228,34 +230,46 @@ void SD_create_environment(const char *platform_file)
  * \return a NULL-terminated array of \ref SD_task_t whose state has changed.
  * \see SD_task_schedule(), SD_task_watch()
  */
-xbt_dynar_t SD_simulate(double how_long)
-{
+
+xbt_dynar_t SD_simulate(double how_long) {
+  xbt_dynar_t changed_tasks = xbt_dynar_new(sizeof(SD_task_t), NULL);
+  SD_task_t task;
+
+  SD_simulate_swag(how_long);
+  while( (task = xbt_swag_extract(sd_global->return_set)) != NULL) {
+    xbt_dynar_push(changed_tasks, &task);
+  }
+
+  return changed_tasks;
+}
+
+xbt_swag_t SD_simulate_swag(double how_long) {
   double total_time = 0.0;      /* we stop the simulation when total_time >= how_long */
   double elapsed_time = 0.0;
   SD_task_t task, task_safe, dst;
   SD_dependency_t dependency;
   surf_action_t action;
-  xbt_dynar_t changed_tasks = xbt_dynar_new(sizeof(SD_task_t), NULL);
   unsigned int iter, depcnt;
   static int first_time = 1;
 
   SD_CHECK_INIT_DONE();
 
    if (first_time) {
-    XBT_VERB("Starting simulation...");
+     XBT_VERB("Starting simulation...");
 
-    surf_presolve();            /* Takes traces into account */
-    first_time = 0;
-  }
+     surf_presolve();            /* Takes traces into account */
+     first_time = 0;
+   }
 
   sd_global->watch_point_reached = 0;
 
+  while(xbt_swag_extract(sd_global->return_set)) {}
+
   /* explore the runnable tasks */
-  xbt_swag_foreach_safe(task, task_safe, sd_global->runnable_task_set) {
+  xbt_swag_foreach(task, sd_global->runnable_task_set) {
     XBT_VERB("Executing task '%s'", SD_task_get_name(task));
-    if (__SD_task_try_to_run(task)
-        && !xbt_dynar_member(changed_tasks, &task))
-      xbt_dynar_push(changed_tasks, &task);
+    if (__SD_task_try_to_run(task))
+      xbt_swag_insert(task,sd_global->return_set);
   }
 
   /* main loop */
@@ -289,8 +303,7 @@ xbt_dynar_t SD_simulate(double how_long)
                SD_task_get_name(task));
 
         /* the state has changed */
-        if (!xbt_dynar_member(changed_tasks, &task))
-          xbt_dynar_push(changed_tasks, &task);
+        xbt_swag_insert(task,sd_global->return_set);
 
         /* remove the dependencies after this task */
         xbt_dynar_foreach(task->tasks_after, depcnt, dependency) {
@@ -326,9 +339,8 @@ xbt_dynar_t SD_simulate(double how_long)
           if (__SD_task_is_runnable(dst)
               && !sd_global->watch_point_reached) {
             XBT_VERB("Executing task '%s'", SD_task_get_name(dst));
-            if (__SD_task_try_to_run(dst) &&
-                !xbt_dynar_member(changed_tasks, &task))
-              xbt_dynar_push(changed_tasks, &task);
+            if (__SD_task_try_to_run(dst))
+              xbt_swag_insert(dst,sd_global->return_set);
           }
         }
       }
@@ -345,8 +357,7 @@ xbt_dynar_t SD_simulate(double how_long)
         surf_workstation_model->action_unref(action);
         task->surf_action = NULL;
 
-        if (!xbt_dynar_member(changed_tasks, &task))
-          xbt_dynar_push(changed_tasks, &task);
+        xbt_swag_insert(task,sd_global->return_set);
       }
     }
   }
@@ -370,7 +381,7 @@ xbt_dynar_t SD_simulate(double how_long)
          elapsed_time, total_time, sd_global->watch_point_reached);
   XBT_DEBUG("current time = %f", surf_get_clock());
 
-  return changed_tasks;
+  return sd_global->return_set;
 }
 
 /**
index 9735f36..57e34a8 100644 (file)
@@ -41,6 +41,9 @@ SD_task_t SD_task_create(const char *name, void *data, double amount)
   task->state_hookup.next = NULL;
   task->state_set = sd_global->not_scheduled_task_set;
   task->state = SD_NOT_SCHEDULED;
+  task->return_hookup.prev = NULL;
+  task->return_hookup.next = NULL;
+
   task->marked = 0;
   xbt_swag_insert(task, task->state_set);
 
@@ -1253,6 +1256,7 @@ void SD_task_destroy(SD_task_t task)
   if (__SD_task_is_scheduled_or_runnable(task))
     __SD_task_destroy_scheduling_data(task);
   xbt_swag_remove(task, task->state_set);
+  xbt_swag_remove(task, sd_global->return_set);
 
   if (task->name != NULL)
     xbt_free(task->name);
@@ -1364,7 +1368,7 @@ void SD_task_schedulev(SD_task_t task, int count,
   switch (task->kind) {
   case SD_TASK_COMM_E2E:
   case SD_TASK_COMP_SEQ:
-    xbt_assert(task->workstation_nb == count);
+    xbt_assert(task->workstation_nb == count,"Got %d locations, but were expecting %d locations",count,task->workstation_nb);
     for (i = 0; i < count; i++)
       task->workstation_list[i] = list[i];
     SD_task_do_schedule(task);
index c8649e1..e22c2b6 100644 (file)
@@ -911,7 +911,7 @@ void surf_network_model_init_LegrandVelho(const char *filename)
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
 
   update_model_description(surf_network_model_description,
-                           "LV08", surf_network_model);
+                           "LV08_fullupdate", surf_network_model);
 }
 
 /***************************************************************************/
index b5ba625..24b4942 100644 (file)
@@ -873,8 +873,6 @@ static void im_net_finalize(void)
 static void im_surf_network_model_init_internal(void)
 {
   s_surf_action_network_CM02_im_t comm;
-  XBT_INFO("You are using the UNSAFE lazy management optimization, I hope you know what you are doing.");
-  XBT_INFO("====> For now this optimization is only available for LV08_im network model.");
 
   surf_network_model = surf_model_init();
 
@@ -951,7 +949,7 @@ void im_surf_network_model_init_LegrandVelho(const char *filename)
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
 
   update_model_description(surf_network_model_description,
-                           "LV08_im", surf_network_model);
+                           "LV08", surf_network_model);
 }
 
 
index 9623d4a..47d6bb7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -119,11 +119,11 @@ s_surf_model_description_t surf_network_model_description[] = {
    "Realistic network model with lmm_solve and no correction factors",
    NULL, surf_network_model_init_CM02},
   {"LV08",
-   "Realistic network model with lmm_solve and these correction factors: latency*=10.4, bandwidth*=.92, S=8775",
-   NULL, surf_network_model_init_LegrandVelho},
-   {"LV08_im",
-    "Realistic network model with IMPROVED ACTION MANAGEMENT and these correction factors: latency*=10.4, bandwidth*=.92, S=8775",
-    NULL, im_surf_network_model_init_LegrandVelho},
+   "Realistic network model with lmm_solve, adequate correction factors (latency*=10.4, bandwidth*=.92, S=8775) and partial invalidation optimization",
+   NULL, im_surf_network_model_init_LegrandVelho},
+   {"LV08_fullupdate",
+    "Realistic network model wit lmm_solve, adequate correction factors (latency*=10.4, bandwidth*=.92, S=8775) but no further optimization. Should produce the same results as LV08, only slower.",
+    NULL, surf_network_model_init_LegrandVelho},
   {"SMPI",
    "Realistic network model with lmm_solve and correction factors on three intervals (< 1KiB, < 64 KiB, >= 64 KiB)",
    NULL, surf_network_model_init_SMPI},