Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 3 Feb 2016 07:35:47 +0000 (08:35 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 3 Feb 2016 07:35:47 +0000 (08:35 +0100)
14 files changed:
ChangeLog
doc/doxygen/tracing.doc
examples/smpi/mc/bugged1_liveness.c
examples/smpi/mc/non_deterministic.tesh
examples/smpi/mc/only_send_deterministic.c
examples/smpi/mc/only_send_deterministic.tesh
include/simgrid/simdag.h
src/instr/instr_config.cpp
src/simdag/sd_dotloader.cpp
src/simgrid/sg_config.c
src/smpi/smpi_base.c
src/smpi/smpi_global.c
src/surf/maxmin.cpp
src/xbt/config.c

index b1d4706..679c590 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,19 @@
 SimGrid (3.13) UNRELEASED; urgency=low
 
  The Easter Trim Release.
+
+ Backwards Compatibility breaks
+   - The option "model-check/sparse-checkpoint" was renamed to
+     "model-check/sparse_checkpoint" as we attempt to unify our naming
+     schemes.
+   - The option smpi/async_small_thres was renamed to smpi/async_small_thresh
+     as we attempt to unify our naming schemes. 
+   - The option smpi/send_is_detached_thres was renamed to
+     smpi/send_is_detached_thresh as we attempt to unify our naming schemes.
+   - We removed support for writing your simulation in Lua; you can use
+     the Java bindings.
+    
  
  S4U
  * s4u::Host is now the prefered public interface to the Host features.
@@ -16,19 +29,10 @@ SimGrid (3.13) UNRELEASED; urgency=low
     the lambda or closure passed as a parameter will run in kernel mode.
    Every callbacks should be rewritten to that interface at some point.
    
- MC
- * BC breaks:
-   - The option "model-check/sparse-checkpoint" was renamed to
-     "model-check/sparse_checkpoint" as we attempt to unify our naming
-     schemes.
-
  Surf
  * Reorganizing and cleaning the internals all around the place.
 
  SMPI
- * BC breaks:
-   - The option smpi/async_small_thres was renamed to smpi/async_small_thresh
-     as we attempt to unify our naming schemes -> smpi/send_is_detached_thresh
  * Remove old default barrier/bcast buggy algorithms (see #18407)
  * Various bugfixes to handle more codes
 
index b4b203e..7c11bda 100644 (file)
@@ -143,17 +143,6 @@ tracing/filename
 \endverbatim
   If you do not provide this parameter, the trace file will be named simgrid.trace.
 
-\li <b>\c
-tracing/onelink_only
-</b>:
-  By default, the tracing system uses all routes in the platform file
-  to re-create a "graph" of the platform and register it in the trace file.
-  This option let the user tell the tracing system to use only the routes
-  that are composed with just one link.
-\verbatim
---cfg=tracing/onelink_only:yes
-\endverbatim
-
 \li <b>\c
 tracing/smpi
 </b>:
@@ -201,6 +190,38 @@ exchanged in the trace, both in the links and on the states. For collective, siz
 --cfg=tracing/smpi/display_sizes:yes
 \endverbatim
 
+\li <b>\c
+tracing/smpi/sleeping
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/smpi/format
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/smpi/format/ti_one_file
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/msg/vm
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 tracing/msg/process
 </b>:
@@ -237,6 +258,22 @@ traced as usual.
 --cfg=tracing/onelink_only:yes
 \endverbatim
 
+\li <b>\c
+tracing/disable_link
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/disable_power
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 tracing/disable_destroy
 </b>:
@@ -274,6 +311,30 @@ Use this to add the contents of a file to the top of the trace file as comment.
 --cfg=tracing/comment_file:textual_file.txt
 \endverbatim
 
+\li <b>\c
+tracing/precision
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/platform
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
+\li <b>\c
+tracing/platform/topology
+</b>:
+TODO
+\verbatim
+TODO
+\endverbatim
+
 \li <b>\c
 viva/categorized
 </b>:
index b0f36ce..fb41816 100644 (file)
@@ -11,7 +11,7 @@
 /******************************************************************************/
 
 /* Run :
-  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thres:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
+  /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */
 
 #include <stdio.h>
 #include <mpi.h>
index a5d8e62..04f1b35 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_non_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_non_deterministic
 > [0.000000] [mc_global/INFO] Check communication determinism
 > [0.000000] [mc_comm_determinism/INFO] The communications pattern of the process 1 is different! (Different communication : 1)
 > [0.000000] [mc_comm_determinism/INFO] ****************************************************
index fa4215f..a554e56 100644 (file)
@@ -1,4 +1,4 @@
-/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send_is_detached_thres:0 gdb\ --args\ ./send_deterministic */
+/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send_is_detached_thresh:0 gdb\ --args\ ./send_deterministic */
 
 /* Copyright (c) 2009-2015. The SimGrid Team.
  * All rights reserved.                                                     */
index daab716..c7993f4 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 ! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic
+$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic
 > [0.000000] [mc_comm_determinism/INFO] Check communication determinism
 > [0.000000] [mc_global/INFO] ******************************************************
 > [0.000000] [mc_global/INFO] **** Only-send-deterministic communication pattern ****
index 0fcdfbd..dffd6f7 100644 (file)
@@ -106,17 +106,14 @@ XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
  *
  *  This section describes the functions for managing the tasks.
  *
- *  A task is some <em>working amount</em> that can be executed
- *  in parallel on several workstations. A task may depend on other
- *  tasks, this means that the task cannot start until the other tasks are done.
- *  Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether
- *  the task is scheduled, running, done, etc.
+ *  A task is some <em>working amount</em> that can be executed in parallel on several hosts. A task may depend on other
+ *  tasks, this means that the task cannot start until the other tasks are done. Each task has a
+ *  <em>\ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, etc.
  *
  *  @see SD_task_t, SD_task_dependency_management
  *  @{
  */
-XBT_PUBLIC(SD_task_t) SD_task_create(const char *name, void *data,
-                                     double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create(const char *name, void *data, double amount);
 XBT_PUBLIC(void *) SD_task_get_data(SD_task_t task);
 XBT_PUBLIC(void) SD_task_set_data(SD_task_t task, void *data);
 XBT_PUBLIC(e_SD_task_state_t) SD_task_get_state(SD_task_t task);
@@ -130,46 +127,29 @@ XBT_PUBLIC(double) SD_task_get_amount(SD_task_t task);
 XBT_PUBLIC(void) SD_task_set_amount(SD_task_t task, double amount);
 XBT_PUBLIC(double) SD_task_get_alpha(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
-XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
-                                              int workstation_nb,
-                                              const sg_host_t *
-                                              workstation_list,
-                                              const double *flops_amount,
-                                              const double *bytes_amount);
+XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task, int workstation_nb, const sg_host_t *workstation_list,
+                                              const double *flops_amount, const double *bytes_amount);
 XBT_PUBLIC(e_SD_task_kind_t) SD_task_get_kind(SD_task_t task);
-XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb,
-                                  const sg_host_t *
-                                  workstation_list,
-                                  const double *flops_amount,
-                                  const double *bytes_amount,
-                                  double rate);
+XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb, const sg_host_t *workstation_list,
+                                  const double *flops_amount, const double *bytes_amount, double rate);
 XBT_PUBLIC(void) SD_task_unschedule(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_start_time(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_finish_time(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_parents(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_children(SD_task_t task);
 XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task);
-XBT_PUBLIC(sg_host_t *) SD_task_get_workstation_list(SD_task_t
-                                                            task);
+XBT_PUBLIC(sg_host_t *) SD_task_get_workstation_list(SD_task_t task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dotty(SD_task_t task, void *out_FILE);
 
-XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data,
-                                              double amount);
-XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name,
-                                                     void *data,
-                                                     double amount,
-                                                     double alpha);
-XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data,
-                                              double amount);
-XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name,
-                                                           void *data,
-                                                           double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data, double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name, void *data, double amount, double alpha);
+XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data, double amount);
+XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name, void *data, double amount);
 
 XBT_PUBLIC(void) SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count);
-XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
-                                   const sg_host_t * list);
+XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list);
 XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
 
 
@@ -177,11 +157,7 @@ XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
  *
  *  For example, create a pure computation task (no comm) like this:
  *
- *  SD_task_schedule(task, my_workstation_nb,
- *                   my_workstation_list,
- *                   my_flops_amount,
- *                   SD_TASK_SCHED_NO_COST,
- *                   my_rate);
+ *  SD_task_schedule(task, my_host_count, my_host_list, my_flops_amount, SD_TASK_SCHED_NO_COST, my_rate);
  */
 #define SD_SCHED_NO_COST NULL
 
@@ -196,13 +172,10 @@ XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
  *  @see SD_task_management
  *  @{
  */
-XBT_PUBLIC(void) SD_task_dependency_add(const char *name, void *data,
-                                        SD_task_t src, SD_task_t dst);
+XBT_PUBLIC(void) SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst);
 XBT_PUBLIC(void) SD_task_dependency_remove(SD_task_t src, SD_task_t dst);
-XBT_PUBLIC(const char *) SD_task_dependency_get_name(SD_task_t src,
-                                                     SD_task_t dst);
-XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src,
-                                               SD_task_t dst);
+XBT_PUBLIC(const char *) SD_task_dependency_get_name(SD_task_t src, SD_task_t dst);
+XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src, SD_task_t dst);
 XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
 /** @} */
 
@@ -211,8 +184,7 @@ XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
 /** @defgroup SD_simulation Simulation
  *  @brief Functions for creating the environment and launching the simulation
  *
- *  This section describes the functions for initializing SimDag, launching
- *  the simulation and exiting SimDag.
+ *  This section describes the functions for initializing SimDag, launching the simulation and exiting SimDag.
  *
  *  @{
  */
@@ -230,6 +202,38 @@ XBT_PUBLIC(xbt_dynar_t) SD_dotload_with_sched(const char *filename);
 
 /** @} */
 
+/* Support some backward compatibility */
+#define SD_workstation_t sg_host_t
+
+#define SD_link_get_name sg_link_name
+#define SD_link_get_current_latency sg_link_latency
+#define SD_link_get_current_bandwidth sg_link_bandwidth
+
+#define SD_route_get_current_latency SD_route_get_latency
+#define SD_route_get_current_bandwidth SD_route_get_bandwidth
+
+#define SD_workstation_get_list sg_host_list
+#define SD_workstation_get_number sg_host_count
+
+#define SD_workstation_get_name sg_host_get_name
+#define SD_workstation_get_by_name sg_host_by_name
+#define SD_workstation_dump sg_host_dump
+#define SD_workstation_get_data sg_host_user
+#define SD_workstation_set_data sg_host_user_set
+#define SD_workstation_get_properties sg_host_get_properties
+#define SD_workstation_get_property_value sg_host_get_property_value
+#define SD_workstation_get_power sg_host_speed
+#define SD_workstation_get_available_power sg_host_get_available_speed
+
+#define SD_workstation_get_mounted_storage_list sg_host_get_mounted_storage_list
+// Lost functions
+//SD_workstation_get_access_mode
+//SD_workstation_set_access_mode
+//SD_workstation_get_current_task
+//SD_route_get_communication_time => SG_route_get_latency() + amount / SD_route_get_bandwidth()
+//SD_workstation_get_computation_time => amount / sg_host_speed()
+//TRACE_sd_set_task_category
+
 SG_END_DECL()
 
 #include "simgrid/instr.h"
index 82033ac..73bfa4d 100644 (file)
 XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used for Visualization/Analysis of simulations)");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 
-#define OPT_TRACING               "tracing"
-#define OPT_TRACING_PLATFORM      "tracing/platform"
-#define OPT_TRACING_TOPOLOGY      "tracing/platform/topology"
-#define OPT_TRACING_SMPI          "tracing/smpi"
-#define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
-#define OPT_TRACING_SMPI_COMPUTING "tracing/smpi/computing"
-#define OPT_TRACING_SMPI_SLEEPING "tracing/smpi/sleeping"
-#define OPT_TRACING_SMPI_INTERNALS "tracing/smpi/internals"
-#define OPT_TRACING_DISPLAY_SIZES  "tracing/smpi/display_sizes"
-#define OPT_TRACING_FORMAT        "tracing/smpi/format"
-#define OPT_TRACING_FORMAT_TI_ONEFILE "tracing/smpi/format/ti_one_file"
-#define OPT_TRACING_CATEGORIZED   "tracing/categorized"
-#define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
-#define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
-#define OPT_TRACING_MSG_VM        "tracing/msg/vm"
-#define OPT_TRACING_FILENAME      "tracing/filename"
-#define OPT_TRACING_BUFFER        "tracing/buffer"
-#define OPT_TRACING_ONELINK_ONLY  "tracing/onelink_only"
-#define OPT_TRACING_DISABLE_DESTROY "tracing/disable_destroy"
-#define OPT_TRACING_BASIC         "tracing/basic"
-#define OPT_TRACING_COMMENT       "tracing/comment"
-#define OPT_TRACING_COMMENT_FILE  "tracing/comment_file"
-#define OPT_VIVA_UNCAT_CONF      "viva/uncategorized"
-#define OPT_VIVA_CAT_CONF        "viva/categorized"
-#define OPT_TRACING_DISABLE_LINK        "tracing/disable_link"
-#define OPT_TRACING_DISABLE_POWER       "tracing/disable_power"
-#define OPT_TRACING_PRECISION     "tracing/precision"
+#define OPT_TRACING_BASIC                "tracing/basic"
+#define OPT_TRACING_BUFFER               "tracing/buffer"
+#define OPT_TRACING_CATEGORIZED          "tracing/categorized"
+#define OPT_TRACING_COMMENT_FILE         "tracing/comment_file"
+#define OPT_TRACING_COMMENT              "tracing/comment"
+#define OPT_TRACING_DISABLE_DESTROY      "tracing/disable_destroy"
+#define OPT_TRACING_DISABLE_LINK         "tracing/disable_link"
+#define OPT_TRACING_DISABLE_POWER        "tracing/disable_power"
+#define OPT_TRACING_DISPLAY_SIZES        "tracing/smpi/display_sizes"
+#define OPT_TRACING_FILENAME             "tracing/filename"
+#define OPT_TRACING_FORMAT_TI_ONEFILE    "tracing/smpi/format/ti_one_file"
+#define OPT_TRACING_FORMAT               "tracing/smpi/format"
+#define OPT_TRACING_MSG_PROCESS          "tracing/msg/process"
+#define OPT_TRACING_MSG_VM               "tracing/msg/vm"
+#define OPT_TRACING_ONELINK_ONLY         "tracing/onelink_only"
+#define OPT_TRACING_PLATFORM             "tracing/platform"
+#define OPT_TRACING_PRECISION            "tracing/precision"
+#define OPT_TRACING_SMPI_COMPUTING       "tracing/smpi/computing"
+#define OPT_TRACING_SMPI_GROUP           "tracing/smpi/group"
+#define OPT_TRACING_SMPI_INTERNALS       "tracing/smpi/internals"
+#define OPT_TRACING_SMPI_SLEEPING        "tracing/smpi/sleeping"
+#define OPT_TRACING_SMPI                 "tracing/smpi"
+#define OPT_TRACING_TOPOLOGY             "tracing/platform/topology"
+#define OPT_TRACING                      "tracing"
+#define OPT_TRACING_UNCATEGORIZED        "tracing/uncategorized"
+#define OPT_VIVA_CAT_CONF                "viva/categorized"
+#define OPT_VIVA_UNCAT_CONF              "viva/uncategorized"
 
 static int trace_enabled = 0;
 static int trace_platform;
index 9333294..352125e 100644 (file)
@@ -6,11 +6,9 @@
 
 #include "src/simdag/simdag_private.h"
 #include "simgrid/simdag.h"
-#include "xbt/misc.h"
 #include "xbt/log.h"
 #include <stdbool.h>
 #include <string.h>
-#include <libgen.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
 
@@ -21,8 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
 #elif HAVE_AGRAPH_H
 #include <graphviz/agraph.h>
 #define agnxtnode(dot, node)    agnxtnode(node)
-#define agfstin(dot, node)      agfstin(node)
-#define agnxtin(dot, edge)      agnxtin(edge)
 #define agfstout(dot, node)     agfstout(node)
 #define agnxtout(dot, edge)     agnxtout(edge)
 #endif
@@ -32,97 +28,31 @@ typedef enum {
   parallel
 } seq_par_t;
 
-xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par);
+xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par, bool schedule);
 
-static xbt_dynar_t result;
-static xbt_dict_t jobs;
-static xbt_dict_t computers;
-static Agraph_t *dag_dot;
-static bool schedule = true;
 
 static void dot_task_p_free(void *task) {
-  SD_task_t *t = (SD_task_t *)task;
-  SD_task_destroy(*t);
+  SD_task_destroy(*(SD_task_t *)task);
 }
 
 /** @brief loads a DOT file describing a DAG
  * 
- * See http://www.graphviz.org/doc/info/lang.html
- * for more details.
- * To obtain information about transfers and tasks, two attributes are
- * required : size on task (execution time in Flop) and size on edge
- * (the amount of data transfer in bit).
- * if they aren't here, there choose to be equal to zero.
+ * See http://www.graphviz.org/doc/info/lang.html  for more details.
+ * The size attribute of a node describes:
+ *   - for a compute task: the amount of flops to execute
+ *   - for a communication task : the amount of bytes to transfer
+ * If this attribute is ommited, the default value is zero.
  */
 xbt_dynar_t SD_dotload(const char *filename) {
-  computers = xbt_dict_new_homogeneous(NULL);
-  schedule = false;
-  SD_dotload_generic(filename, sequential);
-  xbt_dynar_t computer = NULL;
-  xbt_dict_cursor_t dict_cursor;
-  char *computer_name;
-  xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-    xbt_dynar_free(&computer);
-  }
-  xbt_dict_free(&computers);
-  return result;
+  return SD_dotload_generic(filename, sequential, false);
 }
 
-xbt_dynar_t SD_dotload_with_sched(const char *filename) {
-  computers = xbt_dict_new_homogeneous(NULL);
-  SD_dotload_generic(filename, sequential);
-
-  if(schedule){
-    xbt_dynar_t computer = NULL;
-    xbt_dict_cursor_t dict_cursor;
-    char *computer_name;
-    const sg_host_t *workstations = sg_host_list ();
-    xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-      int count_computer = atoi(computer_name);
-      unsigned int count=0;
-      SD_task_t task;
-      SD_task_t task_previous = NULL;
-      xbt_dynar_foreach(computer,count,task){
-        /* add dependency between the previous and the task to avoid
-         * parallel execution */
-        if(task != NULL ){
-          if(task_previous != NULL &&
-             !SD_task_dependency_exists(task_previous, task))
-            SD_task_dependency_add(NULL, NULL, task_previous, task);
-          SD_task_schedulel(task, 1, workstations[count_computer]);
-          task_previous = task;
-        }
-      }
-      xbt_dynar_free(&computer);
-    }
-    xbt_dict_free(&computers);
-    if(acyclic_graph_detail(result))
-      return result;
-    else
-      XBT_WARN("There is at least one cycle in the provided task graph");
-  }else{
-    XBT_WARN("The scheduling is ignored");
-  }
-  xbt_dynar_t computer = NULL;
-  xbt_dict_cursor_t dict_cursor;
-  char *computer_name;
-  xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
-    xbt_dynar_free(&computer);
-  }
-  xbt_dict_free(&computers);
-  xbt_dynar_free(&result);
-  return NULL;
+xbt_dynar_t SD_PTG_dotload(const char * filename) {
+  return SD_dotload_generic(filename, parallel, false);
 }
 
-xbt_dynar_t SD_PTG_dotload(const char * filename) {
-  xbt_dynar_t result = SD_dotload_generic(filename, parallel);
-  if (!acyclic_graph_detail(result)) {
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.",
-              basename((char*)filename));
-    xbt_dynar_free(&result);
-    /* (result == NULL) here */
-  }
-  return result;
+xbt_dynar_t SD_dotload_with_sched(const char *filename) {
+  return SD_dotload_generic(filename, sequential, true);
 }
 
 #ifdef HAVE_CGRAPH_H
@@ -134,55 +64,51 @@ static int edge_compare(const void *a, const void *b)
 }
 #endif
 
-xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
+xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par, bool schedule){
   xbt_assert(filename, "Unable to use a null file descriptor\n");
   unsigned int i;
-  result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free);
-  jobs = xbt_dict_new_homogeneous(NULL);
+  SD_task_t root, end, task;
+  xbt_dict_t computers;
+  xbt_dynar_t computer = NULL;
+  char *computer_name;
+  xbt_dict_cursor_t dict_cursor;
+  bool schedule_success = true;
+
+  xbt_dynar_t result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free);
+  xbt_dict_t jobs = xbt_dict_new_homogeneous(NULL);
+
   FILE *in_file = fopen(filename, "r");
   if (in_file == NULL)
     xbt_die("Failed to open file: %s", filename);
-  dag_dot = agread(in_file, NIL(Agdisc_t *));
-  SD_task_t root, end, task;
-  /*
-   * Create all the nodes
-   */
+
+  Agraph_t * dag_dot = agread(in_file, NIL(Agdisc_t *));
+
+  if (schedule)
+    computers = xbt_dict_new_homogeneous(NULL);
+
+  /* Create all the nodes */
   Agnode_t *node = NULL;
   for (node = agfstnode(dag_dot); node; node = agnxtnode(dag_dot, node)) {
-
     char *name = agnameof(node);
     double amount = atof(agget(node, (char *) "size"));
     double alpha = 0.0;
 
-    if (seq_or_par == sequential){
-      XBT_DEBUG("See <job id=%s amount =%.0f>", name, amount);
-    } else {
-      if (!strcmp(agget(node, (char *) "alpha"), "")){
-        alpha = atof(agget(node, (char *) "alpha"));
-        if (alpha == -1.){
-          XBT_DEBUG("negative alpha value provided. Set to 0.");
-          alpha = 0.0 ;
-        }
-      } else {
-        XBT_DEBUG("no alpha value provided. Set to 0");
-        alpha = 0.0 ;
-      }
-
-      XBT_DEBUG("See <job id=%s amount =%.0f alpha = %.3f>",
-          name, amount, alpha);
-    }
-
     if (!(task = (SD_task_t)xbt_dict_get_or_null(jobs, name))) {
       if (seq_or_par == sequential){
+        XBT_DEBUG("See <job id=%s amount =%.0f>", name, amount);
         task = SD_task_create_comp_seq(name, NULL , amount);
       } else {
+        alpha = atof(agget(node, (char *) "alpha"));
+        XBT_DEBUG("See <job id=%s amount =%.0f alpha = %.3f>", name, amount, alpha);
         task = SD_task_create_comp_par_amdahl(name, NULL , amount, alpha);
       }
+
       xbt_dict_set(jobs, name, task, NULL);
+
       if (!strcmp(name, "root")){
-      /* by design the root task is always SCHEDULABLE */
-      SD_task_set_state(task, SD_SCHEDULABLE);
-      /* Put it at the beginning of the dynar */
+        /* by design the root task is always SCHEDULABLE */
+        SD_task_set_state(task, SD_SCHEDULABLE);
+        /* Put it at the beginning of the dynar */
         xbt_dynar_insert_at(result, 0, &task);
       } else {
         if (!strcmp(name, "end")){
@@ -195,21 +121,17 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
       }
 
       if((seq_or_par == sequential) &&
-          (schedule ||
-              XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose))){
-        /* try to take the information to schedule the task only if all is
-         * right*/
+        ((schedule && schedule_success) || XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose))){
+        /* try to take the information to schedule the task only if all is right*/
         int performer, order;
         char *char_performer = agget(node, (char *) "performer");
         char *char_order = agget(node, (char *) "order");
         /* performer is the computer which execute the task */
-        performer =
-            ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
+        performer = ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
         /* order is giving the task order on one computer */
         order = ((!char_order || !strcmp(char_order, ""))? -1:atoi(char_order));
 
-        XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'",
-                    task->name, performer, order);
+        XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
         xbt_dynar_t computer = NULL;
         if(performer != -1 && order != -1){
           /* required parameters are given */
@@ -225,10 +147,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
               task_test = (SD_task_t *)xbt_dynar_get_ptr(computer,order);
             if(task_test != NULL && *task_test != NULL && *task_test != task){
               /* the user gives the same order to several tasks */
-              schedule = false;
+              schedule_success = false;
               XBT_VERB("The task %s starts on the computer %s at the position : %s like the task %s",
-                     (*task_test)->name, char_performer, char_order,
-                     task->name);
+                     (*task_test)->name, char_performer, char_order, task->name);
             }else{
               /* the parameter seems to be ok */
               xbt_dynar_set_as(computer, order, SD_task_t, task);
@@ -236,15 +157,14 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
           }else{
             /* the platform has not enough processors to schedule the DAG like
              * the user wants*/
-            schedule = false;
+            schedule_success = false;
             XBT_VERB("The schedule is ignored, there are not enough computers");
           }
         }
         else {
           /* one of required parameters is not given */
-          schedule = false;
-          XBT_VERB("The schedule is ignored, the task %s is not correctly scheduled",
-              task->name);
+          schedule_success = false;
+          XBT_VERB("The schedule is ignored, the task %s is not correctly scheduled", task->name);
         }
       }
     } else {
@@ -252,10 +172,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     }
   }
 
-  /*
-   * Check if 'root' and 'end' nodes have been explicitly declared.
-   * If not, create them.
-   */
+  /*Check if 'root' and 'end' nodes have been explicitly declared.  If not, create them. */
   if (!(root = (SD_task_t)xbt_dict_get_or_null(jobs, "root"))){
     if (seq_or_par == sequential)
       root = SD_task_create_comp_seq("root", NULL, 0);
@@ -264,7 +181,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     /* by design the root task is always SCHEDULABLE */
     SD_task_set_state(root, SD_SCHEDULABLE);
     /* Put it at the beginning of the dynar */
-      xbt_dynar_insert_at(result, 0, &root);
+    xbt_dynar_insert_at(result, 0, &root);
   }
 
   if (!(end = (SD_task_t)xbt_dict_get_or_null(jobs, "end"))){
@@ -272,12 +189,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
       end = SD_task_create_comp_seq("end", NULL, 0);
     else
       end = SD_task_create_comp_par_amdahl("end", NULL, 0, 0);
-    /* Should be inserted later in the dynar */
   }
 
-  /*
-   * Create edges
-   */
+  /* Create edges */
   xbt_dynar_t edges = xbt_dynar_new(sizeof(Agedge_t*), NULL);
   for (node = agfstnode(dag_dot); node; node = agnxtnode(dag_dot, node)) {
     unsigned cursor;
@@ -286,10 +200,9 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
     for (edge = agfstout(dag_dot, node); edge; edge = agnxtout(dag_dot, edge))
       xbt_dynar_push_as(edges, Agedge_t *, edge);
 #ifdef HAVE_CGRAPH_H
-    /* Hack: circumvent a bug in libcgraph, where the edges are not always given
-     * back in creation order.  We sort them again, according to their sequence
-     * id.  The problem appears to be solved (i.e.: I did not test it) in
-     * graphviz' mercurial repository by the following changeset:
+    /* Hack: circumvent a bug in libcgraph, where the edges are not always given back in creation order.  We sort them
+     * again, according to their sequence id.  The problem appears to be solved (i.e.: I did not test it) in graphviz'
+     * mercurial repository by the following changeset:
      *    changeset:   8431:d5f1fb7e8103
      *    user:        Emden Gansner <erg@research.att.com>
      *    date:        Tue Oct 11 12:38:58 2011 -0400
@@ -331,25 +244,21 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
   }
   xbt_dynar_free(&edges);
 
-  /* all compute and transfer tasks have been created, put the "end" node at
-   * the end of dynar
-   */
-  XBT_DEBUG("All tasks have been created, put %s at the end of the dynar",
-      end->name);
+  /* all compute and transfer tasks have been created, put the "end" node at the end of dynar */
+  XBT_DEBUG("All tasks have been created, put %s at the end of the dynar", end->name);
   xbt_dynar_push(result, &end);
 
   /* Connect entry tasks to 'root', and exit tasks to 'end'*/
-
   xbt_dynar_foreach (result, i, task){
     if (task == root || task == end)
       continue;
     if (xbt_dynar_is_empty(task->tasks_before)) {
-      XBT_DEBUG("file '%s' has no source. Add dependency from 'root'",
-          task->name);
+      XBT_DEBUG("file '%s' has no source. Add dependency from 'root'", task->name);
       SD_task_dependency_add(NULL, NULL, root, task);
-    } else if (xbt_dynar_is_empty(task->tasks_after)) {
-      XBT_DEBUG("file '%s' has no destination. Add dependency to 'end'",
-          task->name);
+    }
+
+    if (xbt_dynar_is_empty(task->tasks_after)) {
+      XBT_DEBUG("file '%s' has no destination. Add dependency to 'end'", task->name);
       SD_task_dependency_add(NULL, NULL, task, end);
     }
   }
@@ -358,11 +267,43 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
   xbt_dict_free(&jobs);
   fclose(in_file);
 
+  if(schedule){
+    if (schedule_success) {
+      const sg_host_t *workstations = sg_host_list ();
+      xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
+        int count_computer = atoi(computer_name);
+        unsigned int count=0;
+        SD_task_t task;
+        SD_task_t task_previous = NULL;
+        xbt_dynar_foreach(computer,count,task){
+          /* add dependency between the previous and the task to avoid parallel execution */
+          if(task != NULL ){
+            if(task_previous != NULL && !SD_task_dependency_exists(task_previous, task))
+              SD_task_dependency_add(NULL, NULL, task_previous, task);
+
+            SD_task_schedulel(task, 1, workstations[count_computer]);
+            task_previous = task;
+          }
+        }
+        xbt_dynar_free(&computer);
+      }
+      xbt_dict_free(&computers);
+    } else {
+      XBT_WARN("The scheduling is ignored");
+      xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
+        xbt_dynar_free(&computer);
+      }
+
+      xbt_dict_free(&computers);
+      xbt_dynar_free(&result);
+      result = NULL;
+    }
+  }
+
   if (!acyclic_graph_detail(result)) {
-    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.",
-              basename((char*)filename));
+    XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", basename((char*)filename));
     xbt_dynar_free(&result);
-    /* (result == NULL) here */
+    result = NULL;
   }
   return result;
 }
index 760acb6..310d0f6 100644 (file)
@@ -836,10 +836,10 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_int, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thresh", 0);
 
-    xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
+    xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thresh",
                      "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
                      xbt_cfgelm_int, 1, 1, NULL, NULL);
-    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thresh", 65536);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/privatize_global_variables",
                      "Boolean indicating whether we should privatize global variable at runtime.",
index 21a8356..568168b 100644 (file)
@@ -460,7 +460,7 @@ void smpi_mpi_start(MPI_Request request)
     }
 
     void* buf = request->buf;
-    if ( (! (request->flags & SSEND)) && (request->size < sg_cfg_get_int("smpi/send_is_detached_thres"))) {
+    if ( (! (request->flags & SSEND)) && (request->size < sg_cfg_get_int("smpi/send_is_detached_thresh"))) {
       void *oldbuf = NULL;
       request->detached = 1;
       XBT_DEBUG("Send request %p is detached", request);
index 7b47526..692d2eb 100644 (file)
@@ -411,7 +411,7 @@ static void smpi_check_options(){
   //check correctness of MPI parameters
 
    xbt_assert(sg_cfg_get_int("smpi/async_small_thresh") <=
-              sg_cfg_get_int("smpi/send_is_detached_thres"));
+              sg_cfg_get_int("smpi/send_is_detached_thresh"));
 
    if (sg_cfg_is_default_value("smpi/running_power")) {
      XBT_INFO("You did not set the power of the host running the simulation.  "
index 70e6c56..6cb3110 100644 (file)
@@ -1144,7 +1144,7 @@ XBT_INLINE lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
-XBT_INLINE int lmm_is_variable_limited_by_latency(lmm_variable_t var)
+XBT_PUBLIC(int) lmm_is_variable_limited_by_latency(lmm_variable_t var)
 {
   return (double_equals(var->bound, var->value, var->bound*sg_maxmin_precision));
 }
index 0798011..642a6a9 100644 (file)
@@ -212,8 +212,7 @@ void xbt_cfgelm_free(void *data)
  *  @param cb_rm callback function called when a value is removed
  */
 
-void
-xbt_cfg_register(xbt_cfg_t * cfg,
+void xbt_cfg_register(xbt_cfg_t * cfg,
                  const char *name, const char *desc,
                  e_xbt_cfgelm_type_t type, int min,
                  int max, xbt_cfg_cb_t cb_set, xbt_cfg_cb_t cb_rm)
@@ -465,7 +464,8 @@ static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t cfg,
   if (!res) {
     xbt_cfg_help(cfg);
     THROWF(not_found_error, 0,
-           "No registered variable '%s' in this config set", name);
+           "No registered variable '%s' in this config set. It is possible that this "\
+           "configuration option has been renamed; please read the file ChangeLog carefully!", name);
   }
 
   xbt_assert(type == xbt_cfgelm_any || res->type == type,